Skip to content

Commit

Permalink
Coming soon (#14)
Browse files Browse the repository at this point in the history
* coming soon

* more coming soon

* tweak things around coming soon
  • Loading branch information
thatguyinabeanie authored Nov 11, 2024
1 parent 9fd1f34 commit 4aef35c
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 46 deletions.
1 change: 1 addition & 0 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@tsparticles/slim": "^3.5.0",
"@uploadthing/react": "^7.1.0",
"@vercel/analytics": "^1.3.2",
"@vercel/flags": "^2.6.3",
"@vercel/functions": "^1.5.0",
"@vercel/kv": "^3.0.0",
"@vercel/speed-insights": "^1.0.14",
Expand Down
12 changes: 8 additions & 4 deletions apps/nextjs/src/app/analytics/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import type { Metadata } from "next";

import ComingSoon from "~/components/coming-soon";

export const metadata: Metadata = {
title: "Analytics",
};

export default function Analytics() {
export default function PlayersPage() {
return (
<div>
<h1>Analytics</h1>
</div>
<ComingSoon title={"Analytics"}>
<div className="flex flex-col items-center">
<h2>"Analytics is under construction</h2>
</div>
</ComingSoon>
);
}
10 changes: 7 additions & 3 deletions apps/nextjs/src/app/dashboard/@pokemon/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import ComingSoon from "~/components/coming-soon";

export default function DashboardPokemon() {
return (
<div>
<h1>DASHBOARD POKEMON PAGE</h1>
</div>
<ComingSoon title="Pokemon">
<div className="flex flex-col items-center">
<h2>Pokemon Team Management is under construction</h2>
</div>
</ComingSoon>
);
}
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/dashboard/@settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@battle-stadium/ui";

export default function Settings() {
return (
<div className="border-small w-full max-w-2xl flex-col rounded-3xl border-neutral-400 border-opacity-15 p-10 backdrop-blur">
<div className="border-small w-full max-w-2xl flex-col rounded-3xl border-neutral-400 border-opacity-15 backdrop-blur">
<Tabs>
<TabsList>
<TabsTrigger value="account" title="Account">
Expand Down
10 changes: 7 additions & 3 deletions apps/nextjs/src/app/dashboard/@tournament_history/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import ComingSoon from "~/components/coming-soon";

export default function TournamentHistory() {
return (
<div>
<h1>Tournament History</h1>
</div>
<ComingSoon title="Tournament History">
<div className="flex flex-col items-center">
<h2>Tournament History is under construction</h2>
</div>
</ComingSoon>
);
}
21 changes: 10 additions & 11 deletions apps/nextjs/src/app/dashboard/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import type { DashboardLayoutProps } from "~/types";
import { getAccountMe } from "~/app/server-actions/accounts/actions";

const tabsList = [
{ key: "dashboard", title: "Dashboard" },
{ key: "profiles", title: "Profiles" },
{ key: "pokemon", title: "Pokemon" },
{ key: "tournaments", title: "Tournaments" },
{ key: "dashboard", title: "Dashboard" },
{ key: "settings", title: "Settings" },
];
const adminTab = { key: "admin", title: "Admin" };
Expand All @@ -20,9 +20,9 @@ export default async function DashboardLayout(
const tabsToRender = me?.admin ? [...tabsList, adminTab] : tabsList;

return (
<div className="flex min-h-screen w-full flex-col items-center">
<Tabs defaultValue="account" className="w-[400px]">
<TabsList>
<div className="flex min-h-screen w-full flex-col items-center pt-2">
<Tabs defaultValue="dashboard" className="flex flex-col">
<TabsList className="flex w-fit flex-row">
{tabsToRender.map(({ key, title }) => (
<TabsTrigger key={key} value={key}>
{title}
Expand All @@ -31,24 +31,23 @@ export default async function DashboardLayout(
</TabsList>
{tabsToRender.map(({ key }) => (
<TabsContent key={key} value={key}>
{renderTabContent(key, props)}
<div className="flex flex-col items-center">
{renderTabContent(key, props)}
</div>
</TabsContent>
))}
</Tabs>
</div>
);
}

function renderTabContent(
activeTab: string,
props: Readonly<DashboardLayoutProps>,
) {
switch (activeTab) {
function renderTabContent(key: string, props: Readonly<DashboardLayoutProps>) {
switch (key) {
case "profiles":
return props.profiles;
case "pokemon":
return props.pokemon;
case "tournament_history":
case "tournaments":
return props.tournament_history;
case "dashboard":
return props.children;
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/organizations/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default async function OrganizationsPage() {
const orgs = await getOrganizations();
return (
<>
<div className="mt-8 md:mt-20">
<div className="mt-4">
<PartneredOrganizations />
</div>

Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export default function Home() {
return (
<HydrateClient>
<div className="min--h-screen flex flex-col items-center justify-between">
<div className="mt-8 md:mt-20">
<div className="mt-4">
<PartneredOrganizations />
</div>
<div className="flex w-full max-w-fit flex-col items-center justify-center bg-transparent pt-10 text-center">
<div className="flex w-full max-w-fit flex-col items-center justify-center bg-transparent text-center">
<h1 className={title({ color: "violet", size: "xl" })}>
battlestadium.gg
</h1>
Expand Down
8 changes: 4 additions & 4 deletions apps/nextjs/src/app/players/[username]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { getProfile } from "~/app/server-actions/profiles/actions";
import ComingSoon from "~/components/coming-soon";

interface PlayerProfilePageProps {
params: Promise<{
Expand All @@ -22,9 +23,8 @@ export default async function PlayerProfilePage(
const player = await getProfile(params.username);

return (
<div>
<h1>{player?.username}</h1>
<p> {player?.slug} </p>
</div>
<ComingSoon title={player?.username ?? "Player Profile"}>
<h2>The Player Profiles are under construction</h2>
</ComingSoon>
);
}
26 changes: 9 additions & 17 deletions apps/nextjs/src/app/players/page.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
import PlayersTable from "~/app/players/players-table";
import { getProfiles } from "~/app/server-actions/profiles/actions";
import ComingSoon from "~/components/coming-soon";

const columns = [
{
key: "username",
label: "Username",
},
{
key: "pronouns",
label: "Pronouns",
},
];

export default async function PlayersPage() {
const players = await getProfiles();

return <PlayersTable columns={columns} players={players} />;
export default function PlayersPage() {
return (
<ComingSoon title={"Player Profiles"}>
<div className="flex flex-col items-center">
<h2>Player profiles are under construction</h2>
</div>
</ComingSoon>
);
}
22 changes: 22 additions & 0 deletions apps/nextjs/src/components/coming-soon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { ReactNode } from "react";

interface ComingSoonProps {
title: string;
children: ReactNode;
}
export default function ComingSoon({
title,
children,
}: Readonly<ComingSoonProps>) {
return (
<div className="flex min-h-screen flex-col pt-4">
<div className="animate-fade-in space-y-6 rounded-xl bg-white/10 p-8 text-center shadow-xl backdrop-blur-lg">
<div className="space-y-2">
<h1 className="text-4xl font-bold">{title}</h1>
{children}
</div>
<p className="text-xl">Coming Soon</p>
</div>
</div>
);
}
33 changes: 33 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 comment on commit 4aef35c

@vercel
Copy link

@vercel vercel bot commented on 4aef35c Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.