fix: move user fetch
This commit is contained in:
@@ -18,10 +18,10 @@ import {
|
||||
DynamicContentComponents,
|
||||
} from "@/types/requests/myPages/accountpage"
|
||||
|
||||
function DynamicComponent({ user, component, props }: AccountPageContentProps) {
|
||||
function DynamicComponent({ component, props }: AccountPageContentProps) {
|
||||
switch (component) {
|
||||
case DynamicContentComponents.membership_overview:
|
||||
return <Overview user={user} title={props.title} />
|
||||
return <Overview title={props.title} />
|
||||
case DynamicContentComponents.previous_stays:
|
||||
return <PreviousStays {...props} />
|
||||
case DynamicContentComponents.soonest_stays:
|
||||
@@ -37,7 +37,7 @@ function DynamicComponent({ user, component, props }: AccountPageContentProps) {
|
||||
}
|
||||
}
|
||||
|
||||
export default function Content({ user, lang, content }: ContentProps) {
|
||||
export default function Content({ lang, content }: ContentProps) {
|
||||
return (
|
||||
<>
|
||||
{content.map((item) => {
|
||||
@@ -61,7 +61,6 @@ export default function Content({ user, lang, content }: ContentProps) {
|
||||
return (
|
||||
<DynamicComponent
|
||||
component={item.dynamic_content.component}
|
||||
user={user}
|
||||
props={componentProps}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { serverClient } from "@/lib/trpc/server"
|
||||
|
||||
import Title from "@/components/Title"
|
||||
|
||||
import Friend from "./Friend"
|
||||
@@ -7,7 +9,9 @@ import styles from "./overview.module.css"
|
||||
|
||||
import type { OverviewProps } from "@/types/components/myPages/myPage/overview"
|
||||
|
||||
export default function Overview({ user, title }: OverviewProps) {
|
||||
export default async function Overview({ title }: OverviewProps) {
|
||||
const user = await serverClient().user.get()
|
||||
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<header>
|
||||
|
||||
Reference in New Issue
Block a user