feat: move my-pages view to overview
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import Breadcrumbs from "@/components/MyPages/Breadcrumbs"
|
||||
|
||||
export default async function MyPagesBreadcrumbs() {
|
||||
const breadcrumbs = await serverClient().contentstack.breadcrumbs.get({
|
||||
href: "/my-pages",
|
||||
})
|
||||
return <Breadcrumbs breadcrumbs={breadcrumbs} />
|
||||
}
|
||||
@@ -11,4 +11,4 @@
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
26
app/[lang]/(live)/(protected)/my-pages/overview/page.tsx
Normal file
26
app/[lang]/(live)/(protected)/my-pages/overview/page.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { _ } from "@/lib/translation"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import UpcomingStays from "@/components/MyPages/Blocks/UpcomingStays"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function MyPage({ params }: PageArgs<LangParams>) {
|
||||
const user = await serverClient().user.get()
|
||||
return (
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
<Overview user={user} />
|
||||
<UpcomingStays lang={params.lang} stays={user.stays} />
|
||||
<Shortcuts
|
||||
shortcuts={user.shortcuts}
|
||||
subtitle={_("The community at your fingertips")}
|
||||
title={_("Handy Shortcuts")}
|
||||
/>
|
||||
</MaxWidth>
|
||||
)
|
||||
}
|
||||
@@ -1,26 +1,10 @@
|
||||
import { _ } from "@/lib/translation"
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
import MaxWidth from "@/components/MaxWidth"
|
||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import UpcomingStays from "@/components/MyPages/Blocks/UpcomingStays"
|
||||
|
||||
import styles from "./page.module.css"
|
||||
import { overview } from "@/constants/routes/myPages"
|
||||
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function MyPage({ params }: PageArgs<LangParams>) {
|
||||
const user = await serverClient().user.get()
|
||||
return (
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
<Overview user={user} />
|
||||
<UpcomingStays lang={params.lang} stays={user.stays} />
|
||||
<Shortcuts
|
||||
shortcuts={user.shortcuts}
|
||||
subtitle={_("The community at your fingertips")}
|
||||
title={_("Handy Shortcuts")}
|
||||
/>
|
||||
</MaxWidth>
|
||||
)
|
||||
export default function MyPages({ params }: PageArgs<LangParams>) {
|
||||
redirect(overview[params.lang])
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
export default function Default() {
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user