Skip to content

Commit f318068

Browse files
authored
Merge pull request #13448 from bbc/WS-1671-support-URL-var
WS-1671 support URL variants for scripts
2 parents a2af715 + 4d215d8 commit f318068

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

ws-nextjs-app/pages/[service]/watch/[id]/live.page.tsx renamed to ws-nextjs-app/pages/[service]/watch/[id]/live/[[...variant]].page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import deriveVariant from '#nextjs/utilities/deriveVariant';
12
import dynamic from 'next/dynamic';
23
import { GetServerSideProps } from 'next';
34
import { LIVE_TV_PAGE } from '#app/routes/utils/pageTypes';
@@ -32,14 +33,18 @@ export const getServerSideProps: GetServerSideProps = async context => {
3233
id,
3334
service,
3435
renderer_env: rendererEnv,
36+
variant: variantFromUrl,
3537
} = context.query as PageDataParams;
3638

39+
const variant = deriveVariant(variantFromUrl);
40+
3741
const { headers: reqHeaders } = context.req;
3842

3943
const { data, toggles } = await getPageData({
4044
id,
4145
service,
4246
rendererEnv,
47+
variant,
4348
resolvedUrl: context.resolvedUrl,
4449
pageType: LIVE_TV_PAGE,
4550
});
@@ -85,3 +90,4 @@ export const getServerSideProps: GetServerSideProps = async context => {
8590
};
8691

8792
export default LiveTvLayout;
93+

0 commit comments

Comments
 (0)