upcoming tournament page, minor changes
This commit is contained in:
@@ -2,6 +2,7 @@ import { redirect, createFileRoute, Outlet } from "@tanstack/react-router";
|
||||
import Layout from "@/features/core/components/layout";
|
||||
import { useServerEvents } from "@/hooks/use-server-events";
|
||||
import { Loader } from "@mantine/core";
|
||||
import FullScreenLoader from "@/components/full-screen-loader";
|
||||
|
||||
export const Route = createFileRoute("/_authed")({
|
||||
beforeLoad: ({ context }) => {
|
||||
@@ -26,7 +27,7 @@ export const Route = createFileRoute("/_authed")({
|
||||
},
|
||||
pendingComponent: () => (
|
||||
<Layout>
|
||||
<Loader size="xl" />
|
||||
<FullScreenLoader />
|
||||
</Layout>
|
||||
),
|
||||
});
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { TrophyIcon } from "@phosphor-icons/react";
|
||||
import ListLink from "@/components/list-link";
|
||||
import { Box, Divider, Text } from "@mantine/core";
|
||||
import { useCurrentTournament } from "@/features/tournaments/queries";
|
||||
import UpcomingTournament from "@/features/tournaments/components/upcoming-tournament";
|
||||
|
||||
export const Route = createFileRoute("/_authed/")({
|
||||
component: Home,
|
||||
loader: () => ({
|
||||
withPadding: false
|
||||
})
|
||||
withPadding: true,
|
||||
}),
|
||||
});
|
||||
|
||||
function Home() {
|
||||
return (
|
||||
<>
|
||||
<Box h='60vh' p="md">
|
||||
<Text m='16vh' fw={500}>Some Content Here</Text>
|
||||
</Box>
|
||||
const { data: tournament } = useCurrentTournament();
|
||||
const now = new Date();
|
||||
|
||||
<Box>
|
||||
<Text pl='md'>Quick Links</Text>
|
||||
<Divider />
|
||||
<ListLink label="All Tournaments" to="/tournaments" Icon={TrophyIcon} />
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
if (new Date(tournament.start_time) > now) {
|
||||
return <UpcomingTournament tournament={tournament} />;
|
||||
}
|
||||
|
||||
return <p>Started Tournament</p>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user