minor fixes

This commit is contained in:
rngsurrounded
2025-03-03 01:06:25 +09:00
parent fc17430ff4
commit e76d1e8a6e
3 changed files with 32 additions and 26 deletions
+3
View File
@@ -15,6 +15,7 @@
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"dayjs": "^1.11.13",
"js-cookie": "^3.0.5",
"katex": "^0.16.21",
@@ -393,6 +394,8 @@
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
"date-fns": ["date-fns@4.1.0", "", {}, "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg=="],
"dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="],
"debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
+1
View File
@@ -21,6 +21,7 @@
"autoprefixer": "^10.4.20",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"dayjs": "^1.11.13",
"js-cookie": "^3.0.5",
"katex": "^0.16.21",
@@ -1,6 +1,8 @@
import React from 'react';
import { Solution } from '@/shared/types/task';
import { getSolutionBgColor, getSolutionTextColor, getStatusText } from '@/pages/CompetitionSession/utils/utils';
import { format, parseISO } from 'date-fns';
import { ru } from 'date-fns/locale';
interface SolutionStatusProps {
solution: Solution;
@@ -8,7 +10,7 @@ interface SolutionStatusProps {
}
const SolutionStatus: React.FC<SolutionStatusProps> = ({ solution, maxPoints }) => {
const formattedDate = solution.timestamp ? format(parseISO(solution.timestamp), "d MMMM, HH:mm", { locale: ru }) : '';
return (
<div className={`${getSolutionBgColor(solution.status, solution.earned_points, maxPoints)} rounded-lg p-4 relative`}>
<div className="flex flex-col">
@@ -20,7 +22,7 @@ const SolutionStatus: React.FC<SolutionStatusProps> = ({ solution, maxPoints })
</span>
</div>
<div className={`absolute bottom-2 right-3 text-xs ${getSolutionTextColor(solution.status, solution.earned_points, maxPoints)}`}>
{solution.timestamp}
{formattedDate}
</div>
</div>
);