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:
@@ -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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,18 +20,21 @@ export default async function LoyaltyPage({ lang }: LangParams) {
|
||||
const { tracking, loyaltyPage } = loyaltyPageRes
|
||||
|
||||
return (
|
||||
<section className={styles.content}>
|
||||
{loyaltyPage.sidebar.length ? (
|
||||
<Sidebar blocks={loyaltyPage.sidebar} lang={lang} />
|
||||
) : null}
|
||||
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
<Title>{loyaltyPage.heading}</Title>
|
||||
{loyaltyPage.blocks ? (
|
||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||
<>
|
||||
<section className={styles.content}>
|
||||
{loyaltyPage.sidebar.length ? (
|
||||
<Sidebar blocks={loyaltyPage.sidebar} lang={lang} />
|
||||
) : null}
|
||||
</MaxWidth>
|
||||
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
<Title>{loyaltyPage.heading}</Title>
|
||||
{loyaltyPage.blocks ? (
|
||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||
) : null}
|
||||
</MaxWidth>
|
||||
</section>
|
||||
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -25,10 +25,13 @@ export default async function MyPages({ lang }: LangParams) {
|
||||
const linkToOverview = `/${lang}/webview${accountPage.url}` !== overview[lang]
|
||||
|
||||
return (
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
{linkToOverview ? <LinkToOverview lang={lang} /> : null}
|
||||
<Content lang={lang} content={accountPage.content} />
|
||||
<>
|
||||
<MaxWidth className={styles.blocks} tag="main">
|
||||
{linkToOverview ? <LinkToOverview lang={lang} /> : null}
|
||||
<Content lang={lang} content={accountPage.content} />
|
||||
</MaxWidth>
|
||||
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</MaxWidth>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -19,13 +19,16 @@ export default async function AboutScandicFriends({ lang }: LangParams) {
|
||||
|
||||
const { tracking, loyaltyPage } = loyaltyPageRes
|
||||
return (
|
||||
<section className={styles.content}>
|
||||
<LinkToOverview lang={lang} />
|
||||
<MaxWidth tag="main" className={styles.blocks}>
|
||||
<Title>{loyaltyPage.heading}</Title>
|
||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||
</MaxWidth>
|
||||
<>
|
||||
<section className={styles.content}>
|
||||
<LinkToOverview lang={lang} />
|
||||
<MaxWidth tag="main" className={styles.blocks}>
|
||||
<Title>{loyaltyPage.heading}</Title>
|
||||
<Blocks blocks={loyaltyPage.blocks} lang={lang} />
|
||||
</MaxWidth>
|
||||
</section>
|
||||
|
||||
<TrackingSDK pageData={tracking} />
|
||||
</section>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user