Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create dashboard group #1562

Merged
merged 4 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const metadata = {
};

const CreateGuild = () => (
<main className="container mx-auto grid max-w-lg gap-8 px-4 py-16">
<main className="container mx-auto grid max-w-lg gap-8 py-16">
<div
className="-z-10 absolute inset-0 opacity-40 dark:opacity-60"
style={{
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

return (
<>
<main className="container mx-auto grid max-w-screen-lg gap-4 px-4 py-8">
<main className="container grid gap-4 py-16">
<section className="pt-6 pb-8">
<h1
className="font-black font-display text-5xl tracking-tight"
Expand Down Expand Up @@ -129,7 +129,7 @@
return (
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{[...Array(3)].map((_, i) => (
<GuildCardSkeleton key={i} />

Check notice on line 132 in src/app/(dashboard)/explorer/page.tsx

View workflow job for this annotation

GitHub Actions / quality-assurance

lint/suspicious/noArrayIndexKey

Avoid using the index of an array as key property in an element.
))}
</div>
);
Expand Down
21 changes: 8 additions & 13 deletions src/app/(dashboard)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import { DashboardContainer } from "@/components/DashboardContainer";
import { Header } from "@/components/Header";
import type { PropsWithChildren } from "react";

const Dashboard = ({ children }: PropsWithChildren) => {
return <>{children}</>;
//<Layout>
// <LayoutHero className="pb-28">
// <Header />
// <LayoutHeadline className="max-w-screen-md">
// <LayoutTitle className="text-foreground">Privacy Policy</LayoutTitle>
// </LayoutHeadline>
// </LayoutHero>
//
// <LayoutMain className="prose flex max-w-screen-md flex-col prose-headings:font-display prose-headings:text-foreground prose-li:text-foreground text-foreground marker:text-foreground">
// {children}
// </LayoutMain>
//</Layout>
return (
<>
<Header />
<DashboardContainer>{children}</DashboardContainer>
</>
);
};

export default Dashboard;
33 changes: 33 additions & 0 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"use client";

import { useEffect } from "react";

const ErrorBoundary = ({
error,
reset,
}: {
error: Error & { digest?: string };
reset: () => void;
}) => {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);

return (
<div>
<h1>Something went wrong!</h1>
<button
type="button"
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
</div>
);
};

export default ErrorBoundary;
2 changes: 0 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Metadata } from "next";
import "@/styles/globals.css";
import { Header } from "@/components/Header";
import { PreloadResources } from "@/components/PreloadResources";
import { Providers } from "@/components/Providers";
import { SignInDialog } from "@/components/SignInDialog";
Expand Down Expand Up @@ -28,7 +27,6 @@ const RootLayout = ({
<body className={cn(dystopian.variable)}>
<PreloadResources />
<Providers>
<Header />
{children}

{/* TODO: maybe load this dynamically? */}
Expand Down
11 changes: 11 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import Link from "next/link";

export default function NotFound() {
return (
<div>
<h1>Not Found</h1>
<p>Could not find requested resource</p>
<Link href="/">Return Home</Link>
</div>
);
}
27 changes: 27 additions & 0 deletions src/components/DashboardContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { cn } from "@/lib/cssUtils";
import { Slot } from "@radix-ui/react-slot";
import type { HTMLAttributes } from "react";

interface DashboardContainerProps extends HTMLAttributes<HTMLDivElement> {
asChild?: boolean;
}

export const DashboardContainer = ({
children,
className,
asChild = false,
...props
}: DashboardContainerProps) => {
const Comp = asChild ? Slot : "div";
return (
<Comp
className={cn(
"mx-auto w-full max-w-screen-lg px-4 sm:px-8 md:px-10",
className,
)}
{...props}
>
{children}
</Comp>
);
};
Loading