mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-22 23:17:09 +00:00
fix history
This commit is contained in:
@@ -59,14 +59,14 @@ const CompetitionPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleViewResults = () => {
|
const handleViewResults = () => {
|
||||||
navigate(`/competition/${competitionId}/results`);
|
console.log("sorryan")
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if competition has ended
|
// Check if competition has ended
|
||||||
const isCompetitionEnded = () => {
|
const isCompetitionEnded = () => {
|
||||||
if (!competitionQuery.data?.end_date) return false;
|
if (!competition?.end_date) return false;
|
||||||
|
|
||||||
const endDate = new Date(competitionQuery.data.end_date);
|
const endDate = new Date(competition.end_date);
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
return now > endDate;
|
return now > endDate;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const TaskContent: React.FC<TaskContentProps> = ({ task }) => {
|
|||||||
return (
|
return (
|
||||||
<div className="flex-1 bg-white rounded-lg p-6">
|
<div className="flex-1 bg-white rounded-lg p-6">
|
||||||
<h2 className="text-3xl font-semibold mb-6 font-hse-sans">
|
<h2 className="text-3xl font-semibold mb-6 font-hse-sans">
|
||||||
Задача {task.in_competition_position}
|
{task.title}
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div className="prose prose-lg max-w-none text-gray-700 font-hse-sans mb-6">
|
<div className="prose prose-lg max-w-none text-gray-700 font-hse-sans mb-6">
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import { getCompetition } from "@/shared/api/competitions";
|
|||||||
import { Loader2 } from "lucide-react";
|
import { Loader2 } from "lucide-react";
|
||||||
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { TaskType } from "@/shared/types/task";
|
import { TaskType } from "@/shared/types/task";
|
||||||
import { CompetitionType } from "@/shared/types/task";
|
|
||||||
|
|
||||||
const CompetitionSession = () => {
|
const CompetitionSession = () => {
|
||||||
const { id, taskId } = useParams<{ id: string; taskId?: string }>();
|
const { id, taskId } = useParams<{ id: string; taskId?: string }>();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const TaskSolution: React.FC<TaskSolutionProps> = ({
|
|||||||
const latestSolution = solutionHistory[solutionHistory.length - 1];
|
const latestSolution = solutionHistory[solutionHistory.length - 1];
|
||||||
setDisplayedSolution(latestSolution);
|
setDisplayedSolution(latestSolution);
|
||||||
}
|
}
|
||||||
}, [solutionHistory, displayedSolution]);
|
}, [solutionHistory]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (prevTaskIdRef.current !== task.id) {
|
if (prevTaskIdRef.current !== task.id) {
|
||||||
|
|||||||
Reference in New Issue
Block a user