Add ErrorBoundary to /mine, remove header underline
This commit is contained in:
parent
0b6d31373d
commit
f2d42a6c0c
4 changed files with 15 additions and 17 deletions
|
@ -3,9 +3,7 @@ import { Providers } from "./providers"
|
|||
import Layout from "@components/layout"
|
||||
import { Toasts } from "@components/toasts"
|
||||
import Header from "@components/header"
|
||||
import { Inter } from "@next/font/google"
|
||||
import { Suspense } from "react"
|
||||
import { Spinner } from "@components/spinner"
|
||||
import { Inter } from "next/font/google"
|
||||
|
||||
const inter = Inter({ subsets: ["latin"], variable: "--inter-font" })
|
||||
|
||||
|
@ -22,9 +20,7 @@ export default async function RootLayout({
|
|||
<Toasts />
|
||||
<Layout>
|
||||
<Providers>
|
||||
<Suspense fallback={<Spinner />}>
|
||||
<Header />
|
||||
</Suspense>
|
||||
{children}
|
||||
</Providers>
|
||||
</Layout>
|
||||
|
|
|
@ -4,6 +4,7 @@ import PostList from "@components/post-list"
|
|||
import { getCurrentUser } from "@lib/server/session"
|
||||
import { authOptions } from "@lib/server/auth"
|
||||
import { Suspense } from "react"
|
||||
import ErrorBoundary from "@components/error/fallback"
|
||||
|
||||
export default async function Mine() {
|
||||
const userId = (await getCurrentUser())?.id
|
||||
|
@ -14,6 +15,7 @@ export default async function Mine() {
|
|||
|
||||
const posts = (await getPostsByUser(userId, true)).map(serverPostToClientPost)
|
||||
return (
|
||||
<ErrorBoundary>
|
||||
<Suspense fallback={<PostList skeleton={true} initialPosts={[]} />}>
|
||||
<PostList
|
||||
userId={userId}
|
||||
|
@ -22,6 +24,7 @@ export default async function Mine() {
|
|||
hideSearch={false}
|
||||
/>
|
||||
</Suspense>
|
||||
</ErrorBoundary>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -21,13 +21,12 @@
|
|||
.tabs button,
|
||||
.tabs a {
|
||||
color: var(--darker-gray);
|
||||
transition: color, box-shadow 0.2s ease-in-out;
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
|
||||
.tabs .buttons a:hover,
|
||||
.tabs .buttons button:hover {
|
||||
color: var(--fg);
|
||||
box-shadow: inset 0 -1px 0 var(--fg);
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
|
|
@ -2,7 +2,7 @@ import "@styles/globals.css"
|
|||
import "@styles/markdown.css"
|
||||
|
||||
import Layout from "@components/layout"
|
||||
import { Inter } from "@next/font/google"
|
||||
import { Inter } from "next/font/google"
|
||||
import ThemeProvider from "./theme-provider"
|
||||
|
||||
const inter = Inter({ subsets: ["latin"], variable: "--inter-font" })
|
||||
|
|
Loading…
Reference in a new issue