From 65f73fb4a0b5170776b131e158efb4893133275e Mon Sep 17 00:00:00 2001 From: moolcoov Date: Sat, 1 Mar 2025 12:39:09 +0300 Subject: [PATCH] fix: main page --- services/frontend/src/App.tsx | 14 +- .../frontend/src/components/layout/header.tsx | 21 ++ services/frontend/src/components/ui/card.tsx | 36 ++-- .../src/components/ui/icons/datarush.tsx | 22 ++ services/frontend/src/components/ui/tabs.tsx | 36 ++-- .../frontend/src/modules/Navbar/index.tsx | 24 --- .../pages/CompetitionPreviewPage/index.tsx | 55 ++--- .../src/pages/CompetitionRunnerPage/index.tsx | 69 +++--- .../components/CompetitionCard/index.tsx | 74 +++---- .../src/pages/CompetitionsPage/index.tsx | 198 ++++++++++-------- .../modules/CompetitionGrid/index.tsx | 40 +--- services/frontend/src/shared/mocks/mocks.ts | 66 +++--- services/frontend/src/shared/types.ts | 25 +++ services/frontend/src/shared/types/types.ts | 25 --- services/frontend/src/styles/globals.css | 13 +- .../frontend/src/widgets/navbar-layout.tsx | 15 ++ services/frontend/tailwind.config.js | 11 - 17 files changed, 383 insertions(+), 361 deletions(-) create mode 100644 services/frontend/src/components/layout/header.tsx create mode 100644 services/frontend/src/components/ui/icons/datarush.tsx delete mode 100644 services/frontend/src/modules/Navbar/index.tsx create mode 100644 services/frontend/src/shared/types.ts delete mode 100644 services/frontend/src/shared/types/types.ts create mode 100644 services/frontend/src/widgets/navbar-layout.tsx delete mode 100644 services/frontend/tailwind.config.js diff --git a/services/frontend/src/App.tsx b/services/frontend/src/App.tsx index 820d663..d7bd1eb 100644 --- a/services/frontend/src/App.tsx +++ b/services/frontend/src/App.tsx @@ -3,17 +3,21 @@ import "./styles/globals.css"; import CompetitionsPage from "./pages/CompetitionsPage"; import CompetitionPreviewPage from "./pages/CompetitionPreviewPage"; import CompetitionRunnerPage from "./pages/CompetitionRunnerPage"; - +import { NavbarLayout } from "./widgets/navbar-layout"; const App = () => { return ( - } /> + }> + } /> + } /> - } /> + } + /> - ); }; -export default App; \ No newline at end of file +export default App; diff --git a/services/frontend/src/components/layout/header.tsx b/services/frontend/src/components/layout/header.tsx new file mode 100644 index 0000000..f9a7264 --- /dev/null +++ b/services/frontend/src/components/layout/header.tsx @@ -0,0 +1,21 @@ +import { DataRush } from "@/components/ui/icons/datarush"; +import { ChevronDown } from "lucide-react"; +import { Link } from "react-router"; + +const Header = () => { + return ( +
+
+ + + +
+ itqdev + +
+
+
+ ); +}; + +export { Header }; diff --git a/services/frontend/src/components/ui/card.tsx b/services/frontend/src/components/ui/card.tsx index 4704955..7f668c5 100644 --- a/services/frontend/src/components/ui/card.tsx +++ b/services/frontend/src/components/ui/card.tsx @@ -1,18 +1,15 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/shared/lib/utils" +import { cn } from "@/shared/lib/utils"; function Card({ className, ...props }: React.ComponentProps<"div">) { return (
- ) + ); } function CardHeader({ className, ...props }: React.ComponentProps<"div">) { @@ -22,7 +19,7 @@ function CardHeader({ className, ...props }: React.ComponentProps<"div">) { className={cn("flex flex-col gap-1.5 px-6", className)} {...props} /> - ) + ); } function CardTitle({ className, ...props }: React.ComponentProps<"div">) { @@ -32,7 +29,7 @@ function CardTitle({ className, ...props }: React.ComponentProps<"div">) { className={cn("leading-none font-semibold", className)} {...props} /> - ) + ); } function CardDescription({ className, ...props }: React.ComponentProps<"div">) { @@ -42,17 +39,13 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) { className={cn("text-muted-foreground text-sm", className)} {...props} /> - ) + ); } function CardContent({ className, ...props }: React.ComponentProps<"div">) { return ( -
- ) +
+ ); } function CardFooter({ className, ...props }: React.ComponentProps<"div">) { @@ -62,7 +55,14 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) { className={cn("flex items-center px-6", className)} {...props} /> - ) + ); } -export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardDescription, + CardContent, +}; diff --git a/services/frontend/src/components/ui/icons/datarush.tsx b/services/frontend/src/components/ui/icons/datarush.tsx new file mode 100644 index 0000000..ecc1627 --- /dev/null +++ b/services/frontend/src/components/ui/icons/datarush.tsx @@ -0,0 +1,22 @@ +const DataRush = ({ size = 52 }: { size?: number }) => { + return ( + + + + + + ); +}; + +export { DataRush }; diff --git a/services/frontend/src/components/ui/tabs.tsx b/services/frontend/src/components/ui/tabs.tsx index 55c8eae..44d0b06 100644 --- a/services/frontend/src/components/ui/tabs.tsx +++ b/services/frontend/src/components/ui/tabs.tsx @@ -1,7 +1,7 @@ -import * as React from "react" -import * as TabsPrimitive from "@radix-ui/react-tabs" +import * as React from "react"; +import * as TabsPrimitive from "@radix-ui/react-tabs"; -import { cn } from "@/shared/lib/utils" +import { cn } from "@/shared/lib/utils"; function Tabs({ className, @@ -10,10 +10,10 @@ function Tabs({ return ( - ) + ); } function TabsList({ @@ -24,34 +24,28 @@ function TabsList({ - ) + ); } function TabsTrigger({ className, - value, ...props -}: React.ComponentProps & { value: string }) { +}: React.ComponentProps) { return ( - ) + ); } function TabsContent({ @@ -61,10 +55,10 @@ function TabsContent({ return ( - ) + ); } -export { Tabs, TabsList, TabsTrigger, TabsContent } \ No newline at end of file +export { Tabs, TabsList, TabsTrigger, TabsContent }; diff --git a/services/frontend/src/modules/Navbar/index.tsx b/services/frontend/src/modules/Navbar/index.tsx deleted file mode 100644 index ba1062a..0000000 --- a/services/frontend/src/modules/Navbar/index.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { ChevronDown } from "lucide-react"; - -const Navbar = () => { - return ( - - ); -}; - - -export default Navbar \ No newline at end of file diff --git a/services/frontend/src/pages/CompetitionPreviewPage/index.tsx b/services/frontend/src/pages/CompetitionPreviewPage/index.tsx index 7feea79..e6261f7 100644 --- a/services/frontend/src/pages/CompetitionPreviewPage/index.tsx +++ b/services/frontend/src/pages/CompetitionPreviewPage/index.tsx @@ -1,12 +1,11 @@ import { useEffect, useState } from "react"; import { useParams, useNavigate } from "react-router-dom"; -import Navbar from "@/modules/Navbar"; +import Navbar from "@/widgets/Navbar"; import { Button } from "@/components/ui/button"; import { ArrowLeft } from "lucide-react"; -import { Competition } from "@/shared/types/types"; +import { Competition } from "@/shared/types"; import { mockCompetitions, mockTasks } from "@/shared/mocks/mocks"; - const CompetitionPreview = () => { const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); @@ -17,7 +16,7 @@ const CompetitionPreview = () => { const fetchCompetition = async () => { try { setTimeout(() => { - const found = mockCompetitions.find(comp => comp.id === id); + const found = mockCompetitions.find((comp) => comp.id === id); setCompetition(found || null); setIsLoading(false); }, 500); @@ -37,7 +36,7 @@ const CompetitionPreview = () => { const handleContinue = () => { if (competition?.id) { const competitionTasks = mockTasks[competition.id]; - + if (competitionTasks && competitionTasks.length > 0) { const firstTaskId = competitionTasks[0].id; navigate(`/competition/${competition.id}/tasks/${firstTaskId}`); @@ -50,49 +49,55 @@ const CompetitionPreview = () => { return ( <> -
- {isLoading ? ( -
+

Загрузка...

) : competition ? ( -
-
- +
+ {competition.name}
- +
-
-

{competition.name}

-
- -
+ +

{competition.description}

) : ( -
-

Соревнование не найдено

-

Запрошенное соревнование не существует или было удалено.

+
+

+ Соревнование не найдено +

+

+ Запрошенное соревнование не существует или было удалено. +

)}
@@ -100,4 +105,4 @@ const CompetitionPreview = () => { ); }; -export default CompetitionPreview; \ No newline at end of file +export default CompetitionPreview; diff --git a/services/frontend/src/pages/CompetitionRunnerPage/index.tsx b/services/frontend/src/pages/CompetitionRunnerPage/index.tsx index fe030dd..73b8797 100644 --- a/services/frontend/src/pages/CompetitionRunnerPage/index.tsx +++ b/services/frontend/src/pages/CompetitionRunnerPage/index.tsx @@ -1,9 +1,7 @@ import { useState } from "react"; import { useParams } from "react-router-dom"; -import Navbar from "@/modules/Navbar"; -import { Task, TaskStatus } from "@/shared/types/types"; - - +import Navbar from "@/widgets/Navbar"; +import { Task, TaskStatus } from "@/shared/types"; const sampleTasks: Task[] = [ { id: "1", number: "1.1", status: "uncleared" }, @@ -18,27 +16,39 @@ const sampleTasks: Task[] = [ const CompetitionRunnerPage = () => { const { id } = useParams<{ id: string }>(); - const [competitionTitle, setCompetitionTitle] = useState("Олимпиада DANO 2025. Индивидуальный этап"); + const [competitionTitle, setCompetitionTitle] = useState( + "Олимпиада DANO 2025. Индивидуальный этап", + ); const [tasks, setTasks] = useState(sampleTasks); const [selectedTaskId, setSelectedTaskId] = useState(null); const getTaskBgColor = (status: TaskStatus): string => { switch (status) { - case "uncleared": return "bg-[var(--color-task-uncleared)]"; - case "checking": return "bg-[var(--color-task-checking)]"; - case "correct": return "bg-[var(--color-task-correct)]"; - case "partial": return "bg-[var(--color-task-partial)]"; - case "wrong": return "bg-[var(--color-task-wrong)]"; + case "uncleared": + return "bg-[var(--color-task-uncleared)]"; + case "checking": + return "bg-[var(--color-task-checking)]"; + case "correct": + return "bg-[var(--color-task-correct)]"; + case "partial": + return "bg-[var(--color-task-partial)]"; + case "wrong": + return "bg-[var(--color-task-wrong)]"; } }; const getTaskTextColor = (status: TaskStatus): string => { switch (status) { - case "uncleared": return "text-gray-600"; - case "checking": return "text-gray-800"; - case "correct": return "text-green-800"; - case "partial": return "text-green-700"; - case "wrong": return "text-red-800"; + case "uncleared": + return "text-gray-600"; + case "checking": + return "text-gray-800"; + case "correct": + return "text-green-800"; + case "partial": + return "text-green-700"; + case "wrong": + return "text-red-800"; } }; @@ -49,21 +59,20 @@ const CompetitionRunnerPage = () => { return ( <> - -
+ +
-

{competitionTitle}

+

+ {competitionTitle} +

- -
+ +
{tasks.map((task) => ( -
handleTaskClick(task.id)} > {task.number} @@ -72,13 +81,13 @@ const CompetitionRunnerPage = () => {
- +
-
+
{selectedTaskId ? (
-

- Задание {tasks.find(t => t.id === selectedTaskId)?.number} +

+ Задание {tasks.find((t) => t.id === selectedTaskId)?.number}

Содержание задания будет отображаться здесь. @@ -95,4 +104,4 @@ const CompetitionRunnerPage = () => { ); }; -export default CompetitionRunnerPage; \ No newline at end of file +export default CompetitionRunnerPage; diff --git a/services/frontend/src/pages/CompetitionsPage/components/CompetitionCard/index.tsx b/services/frontend/src/pages/CompetitionsPage/components/CompetitionCard/index.tsx index 5c06328..2e65038 100644 --- a/services/frontend/src/pages/CompetitionsPage/components/CompetitionCard/index.tsx +++ b/services/frontend/src/pages/CompetitionsPage/components/CompetitionCard/index.tsx @@ -1,55 +1,47 @@ -import { Competition } from "@/shared/types/types"; +import { Competition, CompetitionStatus } from "@/shared/types"; import { cn } from "@/shared/lib/utils"; -import { - Card, - CardContent, - CardFooter, -} from "@/components/ui/card"; -import { useNavigate } from "react-router"; +import { Card, CardContent } from "@/components/ui/card"; interface CompetitionCardProps { competition: Competition; className?: string; } -export function CompetitionCard({ competition, className }: CompetitionCardProps) { - const { id, name, imageUrl, isOlympics, status } = competition; - const navigate = useNavigate(); - - const handleClick = () => { - navigate(`/competition/${id}`); - }; - +export function CompetitionCard({ + competition, + className, +}: CompetitionCardProps) { return ( - -

- {name} + {competition.name}
- - - - {isOlympics ? "Олимпиада" : "Тренировка"} - - - - {status.replace(/^\w/, c => c.toUpperCase())} - - - - -

{name}

+ + +
+
+ {competition.isOlympics ? "Олимпиада" : "Тренировка"} + {competition.status != CompetitionStatus.NotParticipating && ( + <> + + + {competition.status} + + + )} +
+

{competition.name}

+
); -} \ No newline at end of file +} diff --git a/services/frontend/src/pages/CompetitionsPage/index.tsx b/services/frontend/src/pages/CompetitionsPage/index.tsx index 3996b7b..f7c208b 100644 --- a/services/frontend/src/pages/CompetitionsPage/index.tsx +++ b/services/frontend/src/pages/CompetitionsPage/index.tsx @@ -1,98 +1,122 @@ -import { useState, useEffect } from 'react'; -import { Competition, Status } from '@/shared/types/types'; -import { CompetitionGrid } from './modules/CompetitionGrid'; -import { Alert, AlertDescription } from "@/components/ui/alert"; -import { AlertCircle } from "lucide-react"; +import { useState, useEffect } from "react"; +import { Competition, CompetitionStatus } from "@/shared/types"; +import { CompetitionGrid } from "./modules/CompetitionGrid"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import Navbar from '@/modules/Navbar'; -import { mockCompetitions } from '@/shared/mocks/mocks'; + +const mockCompetitions: Competition[] = [ + { + id: "1", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: true, + status: CompetitionStatus.InProgress, + }, + { + id: "2", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: false, + status: CompetitionStatus.NotParticipating, + }, + { + id: "3", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: false, + status: CompetitionStatus.InProgress, + }, + { + id: "4", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: true, + status: CompetitionStatus.Completed, + }, + { + id: "5", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: false, + status: CompetitionStatus.Completed, + }, + { + id: "6", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: true, + status: CompetitionStatus.NotParticipating, + }, + { + id: "6", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: true, + status: CompetitionStatus.NotParticipating, + }, + { + id: "6", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", + isOlympics: true, + status: CompetitionStatus.NotParticipating, + }, +]; const CompetitionsPage = () => { - const [competitions, setCompetitions] = useState([]); - const [isLoading, setIsLoading] = useState(true); - const [error, setError] = useState(null); + const [competitions] = useState(mockCompetitions); const [activeTab, setActiveTab] = useState("ongoing"); - useEffect(() => { - // ! симуляция фетча - const fetchCompetitions = async () => { - try { - setTimeout(() => { - setCompetitions(mockCompetitions); - setIsLoading(false); - }, 800); - } catch (error) { - setError('Соревнования не найдены, пожалуйста, попробуйте позже'); - setIsLoading(false); - } - }; - - fetchCompetitions(); - }, []); - - const myCompetitions = competitions.filter(comp => - comp.status === Status.InProgress || comp.status === Status.Completed + const myCompetitions = competitions.filter( + (comp) => + comp.status === CompetitionStatus.InProgress || + comp.status === CompetitionStatus.Completed, ); - - const filteredMyCompetitions = myCompetitions.filter(comp => - activeTab === "ongoing" ? comp.status === Status.InProgress : comp.status === Status.Completed + + const filteredMyCompetitions = myCompetitions.filter((comp) => + activeTab === "ongoing" + ? comp.status === CompetitionStatus.InProgress + : comp.status === CompetitionStatus.Completed, ); - - const availableCompetitions = competitions.filter(comp => - comp.status === 'Не участвую' + + const availableCompetitions = competitions.filter( + (comp) => comp.status === "Не участвую", ); return ( - <> - -
- {error && ( - - - {error} - - )} - -
-
-

Мои события

- - - Текущие - Завершенные - - -
- - {isLoading ? ( - - ) : filteredMyCompetitions.length > 0 ? ( - - ) : ( -
-

- {activeTab === "ongoing" ? "У вас нет текущих соревнований" : "У вас нет завершенных соревнований"} -

-
- )} -
- -
-

Доступные события

- - {isLoading ? ( - - ) : availableCompetitions.length > 0 ? ( - - ) : ( -
-

Нет доступных соревнований

-
- )} -
-
- - ); -} +
+
+ + Мои события + + + В процессе + Завершенные + + + + +
-export default CompetitionsPage; \ No newline at end of file +
+ + События + + +
+
+ ); +}; + +const Section = ({ children }: { children: React.ReactNode }) => { + return
{children}
; +}; + +const SectionHeader = ({ children }: { children: React.ReactNode }) => { + return
{children}
; +}; + +const SectionTitle = ({ children }: { children: React.ReactNode }) => { + return

{children}

; +}; + +export default CompetitionsPage; diff --git a/services/frontend/src/pages/CompetitionsPage/modules/CompetitionGrid/index.tsx b/services/frontend/src/pages/CompetitionsPage/modules/CompetitionGrid/index.tsx index 7bcc1fa..19b376c 100644 --- a/services/frontend/src/pages/CompetitionsPage/modules/CompetitionGrid/index.tsx +++ b/services/frontend/src/pages/CompetitionsPage/modules/CompetitionGrid/index.tsx @@ -1,46 +1,16 @@ -import { Competition } from "@/shared/types/types"; +import { Competition } from "@/shared/types"; import { CompetitionCard } from "../../components/CompetitionCard"; -import CompetitionSkeleton from "../../components/CompetitionSkeleton"; -import { cn } from "@/shared/lib/utils"; interface CompetitionGridProps { competitions: Competition[]; - isLoading?: boolean; - className?: string; - skeletonCount?: number; } -export function CompetitionGrid({ - competitions, - isLoading = false, - className, - skeletonCount -}: CompetitionGridProps) { - const gridClasses = cn( - "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6", - className - ); - - const numberOfSkeletons = skeletonCount ?? (competitions.length > 0 ? competitions.length : 4); - - if (isLoading) { - return ( -
- {Array.from({ length: numberOfSkeletons }).map((_, index) => ( - - ))} -
- ); - } - +export function CompetitionGrid({ competitions }: CompetitionGridProps) { return ( -
+
{competitions.map((competition) => ( - + ))}
); -} \ No newline at end of file +} diff --git a/services/frontend/src/shared/mocks/mocks.ts b/services/frontend/src/shared/mocks/mocks.ts index ac54fe8..b05ad67 100644 --- a/services/frontend/src/shared/mocks/mocks.ts +++ b/services/frontend/src/shared/mocks/mocks.ts @@ -1,62 +1,64 @@ -import { Competition, Status } from "../types/types"; +import { Competition, CompetitionStatus } from "../types"; const mockCompetitions: Competition[] = [ { - id: '1', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "1", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: true, - status: Status.InProgress, - description: 'Проверка глубоких знаний и навыков в анализе данных. Будет несколько творческих заданий со свободным ответом. Задания выполняются индивидуально, вес тура в итоговом результате – 0,5. Этап пройдет онлайн в заданное время, с применением системы прокторинга. На работу дается 240 минут.' + status: CompetitionStatus.InProgress, + description: + "Проверка глубоких знаний и навыков в анализе данных. Будет несколько творческих заданий со свободным ответом. Задания выполняются индивидуально, вес тура в итоговом результате – 0,5. Этап пройдет онлайн в заданное время, с применением системы прокторинга. На работу дается 240 минут.", }, { - id: '2', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "2", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: false, - status: Status.NotParticipating, - description: 'Индивидуальный этап олимпиады DANO 2025 – это уникальная возможность для студентов продемонстрировать свои навыки анализа данных и решения сложных задач. Участники будут работать с реальными наборами данных и применять современные методы машинного обучения и статистического анализа.' + status: CompetitionStatus.NotParticipating, + description: + "Индивидуальный этап олимпиады DANO 2025 – это уникальная возможность для студентов продемонстрировать свои навыки анализа данных и решения сложных задач. Участники будут работать с реальными наборами данных и применять современные методы машинного обучения и статистического анализа.", }, { - id: '3', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "3", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: false, - status: Status.InProgress + status: CompetitionStatus.InProgress, }, { - id: '4', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "4", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: true, - status: Status.Completed + status: CompetitionStatus.Completed, }, { - id: '5', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "5", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: false, - status: Status.Completed + status: CompetitionStatus.Completed, }, { - id: '6', - name: 'Олимпиада DANO 2025. Индивидуальный этап', - imageUrl: '/DANO.png', + id: "6", + name: "Олимпиада DANO 2025. Индивидуальный этап", + imageUrl: "/DANO.png", isOlympics: true, - status: Status.NotParticipating - } + status: CompetitionStatus.NotParticipating, + }, ]; const mockTasks = { - '1': [ + "1": [ { id: "1.1", number: "1.1", status: "uncleared" }, { id: "1.2", number: "1.2", status: "checking" }, { id: "1.3", number: "1.3", status: "correct" }, ], - '2': [ + "2": [ { id: "2.1", number: "1.1", status: "uncleared" }, { id: "2.2", number: "1.2", status: "uncleared" }, - ] + ], }; -export { mockCompetitions, mockTasks } \ No newline at end of file +export { mockCompetitions, mockTasks }; diff --git a/services/frontend/src/shared/types.ts b/services/frontend/src/shared/types.ts new file mode 100644 index 0000000..3732350 --- /dev/null +++ b/services/frontend/src/shared/types.ts @@ -0,0 +1,25 @@ +enum CompetitionStatus { + InProgress = "В процессе", + NotParticipating = "Не участвую", + Completed = "Завершено", +} + +interface Competition { + id: string; + name: string; + imageUrl: string; + isOlympics: boolean; + status: CompetitionStatus; + description?: string; +} + +type TaskStatus = "uncleared" | "checking" | "correct" | "partial" | "wrong"; + +interface Task { + id: string; + number: string; + status: TaskStatus; +} + +export { CompetitionStatus }; +export type { Competition, TaskStatus, Task }; diff --git a/services/frontend/src/shared/types/types.ts b/services/frontend/src/shared/types/types.ts deleted file mode 100644 index d670376..0000000 --- a/services/frontend/src/shared/types/types.ts +++ /dev/null @@ -1,25 +0,0 @@ -enum Status { - InProgress = 'В процессе', - NotParticipating = 'Не участвую', - Completed = 'Завершено' -} - -interface Competition { - id: string; - name: string; - imageUrl: string; - isOlympics: boolean; - status: Status; - description?: string; -} - -type TaskStatus = "uncleared" | "checking" | "correct" | "partial" | "wrong"; - -interface Task { - id: string; - number: string; - status: TaskStatus; -} - -export {Status} -export type {Competition, TaskStatus, Task} \ No newline at end of file diff --git a/services/frontend/src/styles/globals.css b/services/frontend/src/styles/globals.css index bcfe1c4..f7807bf 100644 --- a/services/frontend/src/styles/globals.css +++ b/services/frontend/src/styles/globals.css @@ -5,14 +5,14 @@ @custom-variant dark (&:is(.dark *)); :root { - --background: oklch(1 0 0); + --background: oklch(0.97 0 0); --foreground: oklch(0.145 0 0); --card: oklch(1 0 0); --card-foreground: oklch(0.145 0 0); --popover: oklch(1 0 0); --popover-foreground: oklch(0.145 0 0); - --primary: oklch(0.205 0 0); - --primary-foreground: oklch(0.985 0 0); + --primary: oklch(89.97% 0.1763 97.07); + --primary-foreground: oklch(82.87% 0.1701 94.8); --secondary: oklch(0.97 0 0); --secondary-foreground: oklch(0.205 0 0); --muted: oklch(0.97 0 0); @@ -41,7 +41,7 @@ } @theme inline { - --font-hse-sans: "HSE Sans", system-ui, sans-serif + --font-hse-sans: "HSE Sans", system-ui, sans-serif; } .dark { --background: oklch(0.145 0 0); @@ -76,7 +76,7 @@ --sidebar-accent-foreground: oklch(0.985 0 0); --sidebar-border: oklch(0.269 0 0); --sidebar-ring: oklch(0.439 0 0); - + --task-uncleared: oklch(0.955 0 0); --task-checking: oklch(0.899 0.1763 97.07); --task-correct: oklch(0.962 0.0561 158.62); @@ -127,12 +127,11 @@ --color-task-correct: var(--task-correct); --color-task-partial: var(--task-partial); --color-task-wrong: var(--task-wrong); - } @layer base { * { - @apply border-border outline-ring/50; + @apply border-border outline-ring/50 font-hse-sans; } body { @apply bg-background text-foreground; diff --git a/services/frontend/src/widgets/navbar-layout.tsx b/services/frontend/src/widgets/navbar-layout.tsx new file mode 100644 index 0000000..3b40070 --- /dev/null +++ b/services/frontend/src/widgets/navbar-layout.tsx @@ -0,0 +1,15 @@ +import { Header } from "@/components/layout/header"; +import { Outlet } from "react-router"; + +const NavbarLayout = () => { + return ( + <> +
+
+ +
+ + ); +}; + +export { NavbarLayout }; diff --git a/services/frontend/tailwind.config.js b/services/frontend/tailwind.config.js deleted file mode 100644 index 50cd5f6..0000000 --- a/services/frontend/tailwind.config.js +++ /dev/null @@ -1,11 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -module.exports = { - theme: { - extend: { - fontFamily: { - 'hse-sans': ['"HSE Sans"', 'system-ui', 'sans-serif'], - }, - }, - }, - plugins: [], -}