feat: finish my pages overview page according to wireframe

This commit is contained in:
Simon Emanuelsson
2024-04-02 10:26:12 +02:00
parent d902a5a704
commit 8c8fa2d02c
48 changed files with 1161 additions and 91 deletions

View File

@@ -1,8 +1,10 @@
import { serverClient } from "@/lib/trpc/server"
import { challenges, shortcuts, stays } from "./_constants"
import Challenges from "@/components/MyPages/Blocks/Challenges"
import Overview from "@/components/MyPages/Blocks/Overview"
import OverviewMobile from "@/components/MyPages/Blocks/Overview/Mobile"
import Title from "@/components/MyPages/Title"
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
import UpcomingStays from "@/components/MyPages/Blocks/UpcomingStays"
import styles from "./page.module.css"
@@ -11,16 +13,24 @@ import type { LangParams, PageArgs } from "@/types/params"
export default async function MyPage({ params }: PageArgs<LangParams>) {
const data = await serverClient().user.get()
const user = {
...data,
journeys: challenges.journeys,
membershipId: 30812404844732,
nights: 14,
points: 20720,
qualifyingPoints: 5000,
shortcuts,
stays,
victories: challenges.victories,
}
return (
<section className={styles.container}>
<header className={styles.header}>
<Title uppercase>Good morning {data.name}</Title>
</header>
<section className={styles.blocks}>
<Overview />
<OverviewMobile />
<UpcomingStays lang={params.lang} />
</section>
<section className={styles.blocks}>
<Overview user={user} />
<UpcomingStays lang={params.lang} stays={user.stays} />
{/* Deals You Can't Miss - TBD */}
<Challenges journeys={user.journeys} victories={user.victories} />
<Shortcuts shortcuts={user.shortcuts} />
</section>
)
}