refactor: render TrackingSDK as first child to pages

This helps with debugging and profiling.

Also tracking isn't tied to the rendering of the UI. So nitpicking could also
justify this change :)
This commit is contained in:
Michael Zetterberg
2024-07-30 15:44:48 +02:00
parent 2c0116e67b
commit bbc8801d3f
4 changed files with 43 additions and 30 deletions

View File

@@ -20,15 +20,19 @@ export default async function MyPages({
}
const { tracking, accountPage } = accountPageRes
return (
<main className={styles.blocks}>
<Title>{accountPage.heading}</Title>
{accountPage.content.length ? (
<Content lang={params.lang} content={accountPage.content} />
) : (
<p>{formatMessage({ id: "No content published" })}</p>
)}
<>
<main className={styles.blocks}>
<Title>{accountPage.heading}</Title>
{accountPage.content.length ? (
<Content lang={params.lang} content={accountPage.content} />
) : (
<p>{formatMessage({ id: "No content published" })}</p>
)}
</main>
<TrackingSDK pageData={tracking} />
</main>
</>
)
}