mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 16:47:10 +00:00
code review
This commit is contained in:
@@ -6,7 +6,7 @@ import CompetitionHeader from "./components/CompetitionHeader";
|
|||||||
import TaskContent from "./components/TaskContent";
|
import TaskContent from "./components/TaskContent";
|
||||||
import TaskSolution from "./modules/TaskSolution";
|
import TaskSolution from "./modules/TaskSolution";
|
||||||
|
|
||||||
const CompetitionSessionPage = () => {
|
const CompetitionSession = () => {
|
||||||
const { id, taskId } = useParams<{ id: string; taskId?: string }>();
|
const { id, taskId } = useParams<{ id: string; taskId?: string }>();
|
||||||
const [tasks] = useState<Task[]>(mockTasks);
|
const [tasks] = useState<Task[]>(mockTasks);
|
||||||
const [answer, setAnswer] = useState("");
|
const [answer, setAnswer] = useState("");
|
||||||
@@ -21,9 +21,6 @@ const CompetitionSessionPage = () => {
|
|||||||
console.log("Submitting answer:", answer);
|
console.log("Submitting answer:", answer);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleHistoryClick = () => {
|
|
||||||
console.log("View history");
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col min-h-screen">
|
<div className="flex flex-col min-h-screen">
|
||||||
@@ -44,7 +41,6 @@ const CompetitionSessionPage = () => {
|
|||||||
answer={answer}
|
answer={answer}
|
||||||
setAnswer={setAnswer}
|
setAnswer={setAnswer}
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
onHistoryClick={handleHistoryClick}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
@@ -60,4 +56,4 @@ const CompetitionSessionPage = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default CompetitionSessionPage;
|
export default CompetitionSession;
|
||||||
-3
@@ -5,13 +5,11 @@ import { Solution } from "@/shared/types";
|
|||||||
import { mockSolutions } from '@/shared/mocks/mocks';
|
import { mockSolutions } from '@/shared/mocks/mocks';
|
||||||
|
|
||||||
interface ActionButtonsProps {
|
interface ActionButtonsProps {
|
||||||
onHistoryClick: () => void;
|
|
||||||
onSubmit: () => void;
|
onSubmit: () => void;
|
||||||
solutionHistory?: Solution[];
|
solutionHistory?: Solution[];
|
||||||
}
|
}
|
||||||
|
|
||||||
const ActionButtons: React.FC<ActionButtonsProps> = ({
|
const ActionButtons: React.FC<ActionButtonsProps> = ({
|
||||||
onHistoryClick,
|
|
||||||
onSubmit,
|
onSubmit,
|
||||||
solutionHistory = mockSolutions
|
solutionHistory = mockSolutions
|
||||||
}) => {
|
}) => {
|
||||||
@@ -19,7 +17,6 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
|
|||||||
|
|
||||||
const handleHistoryClick = () => {
|
const handleHistoryClick = () => {
|
||||||
setIsHistoryOpen(true);
|
setIsHistoryOpen(true);
|
||||||
onHistoryClick();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import React, { useRef, useEffect, useState } from 'react';
|
import React, { useRef, useEffect, useState } from 'react';
|
||||||
import * as monaco from 'monaco-editor';
|
import * as monaco from 'monaco-editor';
|
||||||
import { Copy, Check } from 'lucide-react'; // Import Lucide React icons
|
import { Copy, Check } from 'lucide-react';
|
||||||
|
|
||||||
interface CodeSolutionProps {
|
interface CodeSolutionProps {
|
||||||
answer: string;
|
answer: string;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ interface TaskSolutionProps {
|
|||||||
answer: string;
|
answer: string;
|
||||||
setAnswer: (value: string) => void;
|
setAnswer: (value: string) => void;
|
||||||
onSubmit: () => void;
|
onSubmit: () => void;
|
||||||
onHistoryClick: () => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const TaskSolution: React.FC<TaskSolutionProps> = ({
|
const TaskSolution: React.FC<TaskSolutionProps> = ({
|
||||||
@@ -21,7 +21,6 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
answer,
|
answer,
|
||||||
setAnswer,
|
setAnswer,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onHistoryClick,
|
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedFile, setSelectedFile] = useState<File | null>(null);
|
const [selectedFile, setSelectedFile] = useState<File | null>(null);
|
||||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||||
@@ -46,7 +45,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
<CodeSolution answer={answer} setAnswer={setAnswer} />
|
<CodeSolution answer={answer} setAnswer={setAnswer} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ActionButtons onHistoryClick={onHistoryClick} onSubmit={onSubmit} />
|
<ActionButtons onSubmit={onSubmit} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user