mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
test
This commit is contained in:
+3
-1
@@ -80,6 +80,7 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
||||
<header className="bg-white shadow-sm sticky top-0 z-30 w-full">
|
||||
<div className="mx-auto max-w-6xl px-4">
|
||||
<div className="flex items-center justify-between py-4">
|
||||
<div>
|
||||
<Link
|
||||
to={`/competition/${competitionId}`}
|
||||
className="flex items-center text-gray-600 hover:text-gray-900 transition-colors font-hse-sans text-sm"
|
||||
@@ -90,10 +91,11 @@ const CompetitionHeader: React.FC<CompetitionHeaderProps> = ({
|
||||
<h1 className="font-hse-sans text-xl font-semibold text-center flex-1">
|
||||
{title}
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
{showTimeSection ? (
|
||||
<div className="flex items-center text-gray-600 font-hse-sans text-sm">
|
||||
<Clock className="h-4 w-4 mr-1" />
|
||||
<div className="flex flex-col items-end">
|
||||
{startDate && (
|
||||
<span className="text-xs text-gray-500">
|
||||
|
||||
@@ -82,13 +82,14 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
||||
useEffect(() => {
|
||||
const loadSolutionContent = async () => {
|
||||
if (!displayedSolution || !displayedSolution.content) return;
|
||||
|
||||
console.log(displayedSolution, solutionHistory, "CHECK")
|
||||
try {
|
||||
if (task.type === TaskType.FILE) {
|
||||
setAnswer("");
|
||||
setSelectedFile(null);
|
||||
setSelectedSolutionUrl(displayedSolution.content);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
setSelectedFile(null);
|
||||
setSelectedSolutionUrl(null);
|
||||
const response = await fetch(displayedSolution.content);
|
||||
@@ -96,6 +97,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
||||
throw new Error(`Failed to fetch solution content: ${response.status}`);
|
||||
}
|
||||
const text = await response.text();
|
||||
|
||||
setAnswer(text);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -104,7 +106,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
||||
};
|
||||
|
||||
loadSolutionContent();
|
||||
}, [displayedSolution, task.type, setAnswer, setSelectedFile]);
|
||||
}, [displayedSolution, setAnswer, setSelectedFile]);
|
||||
|
||||
const handleOpenHistory = () => {
|
||||
setIsHistoryOpen(true);
|
||||
|
||||
Reference in New Issue
Block a user