mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 17:57:10 +00:00
feat: hjfdhsdjfgjksdfds
This commit is contained in:
@@ -3,7 +3,11 @@ import { CompetitionGrid } from "./modules/CompetitionsGrid";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getCompetitions } from "@/shared/api/competitions";
|
||||
import { NoCompetitions } from "./modules/NoCompetitions";
|
||||
import {
|
||||
NoActiveCompetitions,
|
||||
NoCompetitions,
|
||||
NoCompletedCompetitions,
|
||||
} from "./modules/NoCompetitions";
|
||||
import { TabsContent } from "@radix-ui/react-tabs";
|
||||
import { Loading } from "@/components/ui/loading";
|
||||
import { CompetitionState } from "@/shared/types/competition";
|
||||
@@ -54,8 +58,8 @@ const CompetitionsPage = () => {
|
||||
return (
|
||||
<div className="flex flex-col gap-6 sm:gap-8">
|
||||
{(activeCompetitionsQuery.data ?? []).length > 0 && (
|
||||
<Section>
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab}>
|
||||
<Tabs value={activeTab} onValueChange={setActiveTab} asChild>
|
||||
<Section>
|
||||
<SectionHeader>
|
||||
<SectionTitle>Мои события</SectionTitle>
|
||||
|
||||
@@ -70,14 +74,22 @@ const CompetitionsPage = () => {
|
||||
</SectionHeader>
|
||||
|
||||
<TabsContent value={CompetitionTab.ONGOING} asChild>
|
||||
<CompetitionGrid competitions={startedCompetitions} />
|
||||
{startedCompetitions.length > 0 ? (
|
||||
<CompetitionGrid competitions={startedCompetitions} />
|
||||
) : (
|
||||
<NoActiveCompetitions />
|
||||
)}
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value={CompetitionTab.COMPLETED} asChild>
|
||||
<CompetitionGrid competitions={finishedCompetitions} />
|
||||
{finishedCompetitions.length > 0 ? (
|
||||
<CompetitionGrid competitions={finishedCompetitions} />
|
||||
) : (
|
||||
<NoCompletedCompetitions />
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</Section>
|
||||
</Section>
|
||||
</Tabs>
|
||||
)}
|
||||
|
||||
<Section>
|
||||
|
||||
@@ -13,3 +13,27 @@ export const NoCompetitions = () => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const NoActiveCompetitions = () => {
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<Ban size={32} />
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<h2 className="text-2xl font-semibold">Нет активных событий</h2>
|
||||
<p className="text-muted-foreground text-lg">Начните новое</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export const NoCompletedCompetitions = () => {
|
||||
return (
|
||||
<div className="flex flex-col items-center gap-4">
|
||||
<Ban size={32} />
|
||||
<div className="flex flex-col items-center gap-2">
|
||||
<h2 className="text-2xl font-semibold">Завершенных событий нет</h2>
|
||||
<p className="text-muted-foreground text-lg">Завершите начатое</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { User } from "@/shared/types/user";
|
||||
import { UserInfo } from "./widgets/user-info";
|
||||
import { UserAchievements } from "./widgets/user-achievements";
|
||||
import { UserStats } from "./widgets/user-stats";
|
||||
|
||||
Reference in New Issue
Block a user