feat(WEB-169): get profile data from API

This commit is contained in:
Simon Emanuelsson
2024-04-16 12:42:44 +02:00
parent d2c1887179
commit 55794034c5
44 changed files with 632 additions and 607 deletions

View File

@@ -1,3 +0,0 @@
export default function Default() {
return null
}

View File

@@ -1,3 +0,0 @@
export default function Default() {
return null
}

View File

@@ -0,0 +1,8 @@
"use client"
import type { ErrorPage } from "@/types/next/error"
export default function MyPageOverviewError({ error }: ErrorPage) {
console.error(error)
return <h1>Error happened, overview</h1>
}

View File

@@ -10,7 +10,7 @@ import styles from "./page.module.css"
import type { LangParams, PageArgs } from "@/types/params"
export default async function MyPage({ params }: PageArgs<LangParams>) {
export default async function MyPageOverview({ params }: PageArgs<LangParams>) {
const user = await serverClient().user.get()
return (
<MaxWidth className={styles.blocks} tag="main">

View File

@@ -1,8 +1,5 @@
import { serverClient } from "@/lib/trpc/server"
import EditProfile from "@/components/MyProfile/Profile/Edit"
export default async function EditProfileSlot() {
const user = await serverClient().user.get()
return <EditProfile user={user} />
export default function EditProfileSlot() {
return <EditProfile />
}

View File

@@ -0,0 +1,8 @@
"use client"
import type { ErrorPage } from "@/types/next/error"
export default function ProfileError({ error }: ErrorPage) {
console.error(error)
return <h1>Error happened, Profile</h1>
}

View File

@@ -1,8 +1,5 @@
import { serverClient } from "@/lib/trpc/server"
import Profile from "@/components/MyProfile/Profile"
export default async function ProfileInfo() {
const user = await serverClient().user.get()
return <Profile user={user} />
export default function ProfileInfo() {
return <Profile />
}