Merged in fix/edit-profile-tracking (pull request #1446)
feat:editprofile - added tracking * feat:editprofile - added tracking * Refactor Approved-by: Erik Tiekstra Approved-by: Christian Andolf
This commit is contained in:
@@ -1,11 +1,15 @@
|
|||||||
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
import { getProfile } from "@/lib/trpc/memoizedRequests"
|
||||||
|
import { serverClient } from "@/lib/trpc/server"
|
||||||
|
|
||||||
import Form from "@/components/Forms/Edit/Profile"
|
import Form from "@/components/Forms/Edit/Profile"
|
||||||
|
import TrackingSDK from "@/components/TrackingSDK"
|
||||||
|
|
||||||
import styles from "./page.module.css"
|
import styles from "./page.module.css"
|
||||||
|
|
||||||
export default async function EditProfileSlot() {
|
export default async function EditProfileSlot() {
|
||||||
|
const accountPage = await serverClient().contentstack.accountPage.get()
|
||||||
const user = await getProfile()
|
const user = await getProfile()
|
||||||
|
|
||||||
if (!user || "error" in user) {
|
if (!user || "error" in user) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
@@ -13,6 +17,7 @@ export default async function EditProfileSlot() {
|
|||||||
<>
|
<>
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<Form user={user} />
|
<Form user={user} />
|
||||||
|
{accountPage && <TrackingSDK pageData={accountPage.tracking} />}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,14 +10,10 @@ export { generateMetadata } from "@/utils/generateMetadata"
|
|||||||
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
export default async function ProfilePage({}: PageArgs<LangParams>) {
|
||||||
const accountPage = await serverClient().contentstack.accountPage.get()
|
const accountPage = await serverClient().contentstack.accountPage.get()
|
||||||
|
|
||||||
if (!accountPage) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Profile />
|
<Profile />
|
||||||
<TrackingSDK pageData={accountPage.tracking} />
|
{accountPage && <TrackingSDK pageData={accountPage.tracking} />}
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user