-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move files into dashboard group * chore: remove horizonal padding from routes * feat: add error and not found page, provided by nextjs example
- Loading branch information
1 parent
fe568d4
commit 27136f8
Showing
20 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
}; |