contests
This commit is contained in:
@@ -4,16 +4,16 @@ import { useNavigate } from 'react-router-dom';
|
||||
|
||||
export interface MissionItemProps {
|
||||
id: number;
|
||||
authorId: number;
|
||||
authorId?: number;
|
||||
name: string;
|
||||
difficulty: 'Easy' | 'Medium' | 'Hard';
|
||||
tags: string[];
|
||||
timeLimit: number;
|
||||
memoryLimit: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
type: 'first' | 'second';
|
||||
status: 'empty' | 'success' | 'error';
|
||||
tags?: string[];
|
||||
timeLimit?: number;
|
||||
memoryLimit?: number;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
type?: 'first' | 'second';
|
||||
status?: 'empty' | 'success' | 'error';
|
||||
}
|
||||
|
||||
export function formatMilliseconds(ms: number): string {
|
||||
@@ -31,8 +31,8 @@ const MissionItem: React.FC<MissionItemProps> = ({
|
||||
id,
|
||||
name,
|
||||
difficulty,
|
||||
timeLimit,
|
||||
memoryLimit,
|
||||
timeLimit = 1000,
|
||||
memoryLimit = 256 * 1024 * 1024,
|
||||
type,
|
||||
status,
|
||||
}) => {
|
||||
@@ -41,7 +41,7 @@ const MissionItem: React.FC<MissionItemProps> = ({
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
'h-[44px] w-full relative rounded-[10px] text-liquid-white',
|
||||
'min-h-[44px] w-full relative rounded-[10px] text-liquid-white',
|
||||
type == 'first' ? 'bg-liquid-lighter' : 'bg-liquid-background',
|
||||
'grid grid-cols-[80px,1fr,1fr,60px,24px] grid-flow-col gap-[20px] px-[20px] box-border items-center',
|
||||
status == 'error' &&
|
||||
|
||||
@@ -3,7 +3,6 @@ import { SecondaryButton } from '../../../components/button/SecondaryButton';
|
||||
import { useAppDispatch, useAppSelector } from '../../../redux/hooks';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { setMenuActivePage } from '../../../redux/slices/store';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { fetchMissions } from '../../../redux/slices/missions';
|
||||
import ModalCreate from './ModalCreate';
|
||||
|
||||
|
||||
@@ -97,12 +97,15 @@ const ModalCreate: FC<ModalCreateProps> = ({ active, setActive }) => {
|
||||
|
||||
<div className="mt-4">
|
||||
<label className="block mb-2">Файл задачи</label>
|
||||
<input
|
||||
type="file"
|
||||
onChange={handleFileChange}
|
||||
accept=".zip"
|
||||
required
|
||||
/>
|
||||
<label className="cursor-pointer inline-flex items-center justify-center px-4 py-2 bg-liquid-lighter hover:bg-liquid-dark transition-colors rounded-[10px] text-liquid-white font-medium shadow-md">
|
||||
{file ? file.name : 'Выбрать файл'}
|
||||
<input
|
||||
type="file"
|
||||
onChange={handleFileChange}
|
||||
accept=".zip"
|
||||
className="hidden"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
{/* Теги */}
|
||||
|
||||
Reference in New Issue
Block a user