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,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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user