@newskit-render/core 0.0.0-d55b7d88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ci/trigger-circleci-workflow.sh +37 -0
- package/.eslintignore +23 -0
- package/.eslintrc +74 -0
- package/.prettierignore +19 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +7638 -0
- package/Dockerfile +14 -0
- package/Dockerfile.withNewRelic +15 -0
- package/README.md +274 -0
- package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +20 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +1195 -0
- package/__tests__/pages/brightcove.test.tsx +34 -0
- package/__tests__/pages/empty.test.tsx +10 -0
- package/__tests__/pages/home.test.tsx +16 -0
- package/app-context/InstrumentationContextProvider.tsx +36 -0
- package/assets/fontFamily.ts +416 -0
- package/assets/fonts/Graphik-Black-App.ttf +0 -0
- package/assets/fonts/Graphik-BlackItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Bold-App.ttf +0 -0
- package/assets/fonts/Graphik-BoldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Extralight-App.ttf +0 -0
- package/assets/fonts/Graphik-ExtralightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Light-App.ttf +0 -0
- package/assets/fonts/Graphik-LightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-Web.woff2 +0 -0
- package/assets/fonts/Graphik-MediumItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-Web.woff2 +0 -0
- package/assets/fonts/Graphik-RegularItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-Web.woff2 +0 -0
- package/assets/fonts/Graphik-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Super-App.ttf +0 -0
- package/assets/fonts/Graphik-SuperItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Thin-App.ttf +0 -0
- package/assets/fonts/Graphik-ThinItalic-App.ttf +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Black-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-BlackItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-Web.woff2 +0 -0
- package/assets/fonts/PublicoHeadline-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Extrabold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-ExtraboldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Light-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-LightItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Medium-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-MediumItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoText-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoText-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Semibold-App.ttf +0 -0
- package/assets/fonts/PublicoText-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Roboto-Bold.ttf +0 -0
- package/assets/fonts/Roboto-Light.ttf +0 -0
- package/assets/fonts/Roboto-Medium.ttf +0 -0
- package/assets/fonts/Roboto-Regular.ttf +0 -0
- package/assets/fonts/TheSun-Bold.ttf +0 -0
- package/assets/fonts/TheSun-BoldItalic.ttf +0 -0
- package/assets/fonts/TheSun-HeavyCondensed.ttf +0 -0
- package/assets/fonts/TheSun-HeavyNarrow.ttf +0 -0
- package/assets/fonts/TheSun-Italic.ttf +0 -0
- package/assets/fonts/TheSun-Medium.ttf +0 -0
- package/assets/fonts/TheSun-MediumItalic.ttf +0 -0
- package/assets/fonts/TheSun-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-Bold.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigital-Italic.ttf +0 -0
- package/assets/fonts/TimesDigital-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-RegularSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Bold.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Italic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Regular.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
- package/assets/fonts/TimesModern-Regular.otf +0 -0
- package/assets/fonts/attribuitions.mdx +35 -0
- package/assets/fonts/bitter-medium.woff +0 -0
- package/assets/fonts/bitter-medium.woff2 +0 -0
- package/assets/fonts/bitter-mediumitalic.woff +0 -0
- package/assets/fonts/bitter-mediumitalic.woff2 +0 -0
- package/assets/fonts/bitter-regular.woff +0 -0
- package/assets/fonts/bitter-regular.woff2 +0 -0
- package/assets/fonts/bitter-semibold.woff +0 -0
- package/assets/fonts/bitter-semibold.woff2 +0 -0
- package/assets/fonts/dmmono-medium.woff +0 -0
- package/assets/fonts/dmmono-medium.woff2 +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff2 +0 -0
- package/assets/fonts/notosans-bold-webfont.woff +0 -0
- package/assets/fonts/notosans-bold-webfont.woff2 +0 -0
- package/assets/fonts/notosans-italic-webfont.woff +0 -0
- package/assets/fonts/notosans-italic-webfont.woff2 +0 -0
- package/assets/fonts/notosans-medium-webfont.woff +0 -0
- package/assets/fonts/notosans-medium-webfont.woff2 +0 -0
- package/assets/fonts/notosans-regular-webfont.woff +0 -0
- package/assets/fonts/notosans-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bold-webfont.woff +0 -0
- package/assets/fonts/poppins-bold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-italic-webfont.woff +0 -0
- package/assets/fonts/poppins-italic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-light-webfont.woff +0 -0
- package/assets/fonts/poppins-light-webfont.woff2 +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-medium-webfont.woff +0 -0
- package/assets/fonts/poppins-medium-webfont.woff2 +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-regular-webfont.woff +0 -0
- package/assets/fonts/poppins-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600.woff +0 -0
- package/assets/fonts/source-serif-pro-600.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700.woff +0 -0
- package/assets/fonts/source-serif-pro-700.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-italic.woff +0 -0
- package/assets/fonts/source-serif-pro-italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-regular.woff +0 -0
- package/assets/fonts/source-serif-pro-regular.woff2 +0 -0
- package/components/AccountDropdown/AccountDropdown.tsx +65 -0
- package/components/AccountDropdown/__tests__/AcountDropdown.test.tsx +83 -0
- package/components/AccountDropdown/accounts.ts +47 -0
- package/components/AccountDropdown/index.tsx +2 -0
- package/components/AccountDropdown/utils.ts +21 -0
- package/components/ErrorPage/ErrorPage.tsx +135 -0
- package/components/ad/index.tsx +35 -0
- package/components/article/Highlights.tsx +77 -0
- package/components/article/MetaBox.tsx +50 -0
- package/components/article/RelatedArticles.tsx +53 -0
- package/components/article/RelatedTopics.tsx +59 -0
- package/components/article/ShareBarComponent.tsx +53 -0
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1568 -0
- package/components/article/__tests__/index.test.tsx +171 -0
- package/components/article/__tests__/mocks.ts +105 -0
- package/components/article/index.tsx +320 -0
- package/components/common/BackToHomepage.tsx +37 -0
- package/components/common/NavLink.tsx +26 -0
- package/components/common/NewskitLogo.tsx +52 -0
- package/components/common/NewskitLogoShort.tsx +48 -0
- package/components/common/SectionTitleBar.tsx +57 -0
- package/components/common/ShareButton.tsx +18 -0
- package/components/common/ViewMoreButton.tsx +20 -0
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/common/icons/IconFilledTwitter.tsx +14 -0
- package/components/common/icons/StyledIconFilledChevronRight.tsx +12 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +192 -0
- package/components/footer/index.test.tsx +13 -0
- package/components/footer/index.tsx +151 -0
- package/components/header/banner-messages.ts +39 -0
- package/components/header/index.tsx +52 -0
- package/components/header/navigation-links.ts +20 -0
- package/components/layout/Gutter.tsx +11 -0
- package/components/layout/LayoutTemplate.tsx +26 -0
- package/components/layout/MainGrid.tsx +66 -0
- package/components/layout/index.tsx +3 -0
- package/components/layout/layoutTypes.ts +13 -0
- package/components/section/ArticleSlice.tsx +35 -0
- package/components/section/CollectionBlock.tsx +54 -0
- package/components/section/SectionContext.tsx +9 -0
- package/components/section/__tests__/ArticleSlice.test.tsx +128 -0
- package/components/section/__tests__/CollectionBlock.test.tsx +83 -0
- package/components/section/__tests__/pageBlock.test.tsx +24 -0
- package/components/section/__tests__/sectionUtils.test.ts +94 -0
- package/components/section/index.tsx +39 -0
- package/components/section/layouts/Block.tsx +79 -0
- package/components/section/layouts/FallBack.tsx +24 -0
- package/components/section/layouts/Lead.tsx +43 -0
- package/components/section/layouts/Rows.tsx +82 -0
- package/components/section/layouts/SectionTitle.tsx +57 -0
- package/components/section/layouts/__tests__/Lead.test.tsx +37 -0
- package/components/section/layouts/__tests__/Rows.test.tsx +40 -0
- package/components/section/layouts/__tests__/SectionTitle.test.tsx +37 -0
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +180 -0
- package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +354 -0
- package/components/section/layouts/gridUtils.ts +21 -0
- package/components/section/layouts/index.tsx +4 -0
- package/components/section/layouts/types.ts +13 -0
- package/components/section/pageBlock.tsx +23 -0
- package/components/section/sectionUtils.ts +61 -0
- package/components/teaser/index.test.tsx +50 -0
- package/components/teaser/index.tsx +64 -0
- package/components/teaser/teaserVariants.ts +33 -0
- package/components/teaser/variant-types.ts +49 -0
- package/components/teaser/variants/featureVariant.ts +42 -0
- package/components/teaser/variants/horizontal.ts +14 -0
- package/components/teaser/variants/titleTeaserVariant.ts +32 -0
- package/components/teaser/variants/titleVertical.ts +24 -0
- package/components/utils/index.test.ts +12 -0
- package/components/utils/index.ts +6 -0
- package/config/__tests__/index.test.ts +54 -0
- package/config/environment.ts +80 -0
- package/config/index.ts +2 -0
- package/config/multiTenancy.ts +11 -0
- package/constants/index.ts +2 -0
- package/context/app-context/AppContext.test.tsx +56 -0
- package/context/app-context/holidayStopListContextOverrides.ts +18 -0
- package/context/app-context/index.tsx +34 -0
- package/context/app-context/paymentMethodContext.tsx +70 -0
- package/context/index.tsx +2 -0
- package/context/multi-tenancy/MultiTenancy.test.tsx +48 -0
- package/context/multi-tenancy/index.tsx +32 -0
- package/css/index.ts +15 -0
- package/cypress/axe/terminal-log.js +19 -0
- package/cypress/config/visual.config.ts +11 -0
- package/cypress/config/visual.skip.config.ts +10 -0
- package/cypress/e2e/account/accessibility.cy.js +88 -0
- package/cypress/e2e/account/banners.cy.js +169 -0
- package/cypress/e2e/account/cancellation.cy.js +219 -0
- package/cypress/e2e/account/holiday-stops.cy.js +109 -0
- package/cypress/e2e/account/main-api.cy.js +102 -0
- package/cypress/e2e/account/newsletters-and-alerts.cy.js +149 -0
- package/cypress/e2e/account/newsletters-page.cy.js +69 -0
- package/cypress/e2e/account/payment-page.cy.js +98 -0
- package/cypress/e2e/account/personal-details.cy.js +1161 -0
- package/cypress/e2e/account/subscription-and-billing.cy.js +434 -0
- package/cypress/e2e/checkout/account-creation.cy.js +8 -0
- package/cypress/e2e/checkout/payment-details.cy.js +19 -0
- package/cypress/e2e/core/home-page.cy.js +6 -0
- package/cypress/e2e/help-hub/accessibility.cy.js +35 -0
- package/cypress/e2e/help-hub/article-page.cy.js +115 -0
- package/cypress/e2e/help-hub/landing-page.cy.js +94 -0
- package/cypress/e2e/help-hub/result-page.cy.js +117 -0
- package/cypress/fixtures/empty.html +10 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/fixtures/holiday-stops.json +40 -0
- package/cypress/fixtures/paymentFailure.js +24 -0
- package/cypress/fixtures/testDates.js +26 -0
- package/cypress/support/commands.js +125 -0
- package/cypress/support/consentValues.js +5839 -0
- package/cypress/support/e2e.js +22 -0
- package/cypress/support/users.js +58 -0
- package/cypress/visual/account/print-visual-regression.cy.js +9 -0
- package/cypress/visual/account/visual-regression.cy.js +40 -0
- package/cypress/visual/empty/empty.cy.js +5 -0
- package/cypress.config.ts +38 -0
- package/helpers/__tests__/getUser.test.ts +45 -0
- package/helpers/__tests__/logger.test.ts +62 -0
- package/helpers/__tests__/useThemeDropdownObject.test.ts +49 -0
- package/helpers/a11y.ts +7 -0
- package/helpers/addCacheHeaders.ts +8 -0
- package/helpers/getUser.ts +37 -0
- package/helpers/getYear.ts +1 -0
- package/helpers/global-types.ts +186 -0
- package/helpers/logger/getWinstonLogger.ts +19 -0
- package/helpers/logger/index.ts +20 -0
- package/helpers/logger/replaceConsoleWithLogger.ts +14 -0
- package/helpers/mocks/articleMock.ts +50 -0
- package/helpers/mocks/getPageMock.ts +369 -0
- package/helpers/mocks/getRadioPostMock.ts +71 -0
- package/helpers/mocks/getRadioPostsMock.ts +26 -0
- package/helpers/mocks/getRecommendationsMock.ts +20 -0
- package/helpers/mocks/index.ts +7 -0
- package/helpers/multiTenancy.ts +19 -0
- package/helpers/setupTests.ts +5 -0
- package/helpers/test-utils.tsx +33 -0
- package/helpers/useThemeDropdownObject.tsx +73 -0
- package/infrastructure/.circleci/config.yml +1187 -0
- package/infrastructure/INFRASTRUCTURE.md +142 -0
- package/infrastructure/build_and_deploy.png +0 -0
- package/infrastructure/helm/Chart.yaml +21 -0
- package/infrastructure/helm/templates/_helpers.tpl +87 -0
- package/infrastructure/helm/templates/deployment.yaml +45 -0
- package/infrastructure/helm/templates/horizontalpodautoscaler.yaml +21 -0
- package/infrastructure/helm/templates/ingress.yaml +31 -0
- package/infrastructure/helm/templates/networkpolicy.yaml +26 -0
- package/infrastructure/helm/templates/secret.yaml +12 -0
- package/infrastructure/helm/templates/service.yaml +15 -0
- package/infrastructure/helm/values-dev.yaml +39 -0
- package/infrastructure/helm/values-local.yaml +30 -0
- package/infrastructure/helm/values-pr.yaml +40 -0
- package/infrastructure/helm/values-prod.yaml +39 -0
- package/infrastructure/helm/values-staging.yaml +39 -0
- package/infrastructure/helm/values.yaml +44 -0
- package/infrastructure/pull_request.png +0 -0
- package/infrastructure/release-documentation-cli.config.json +18 -0
- package/infrastructure/remove_pr.png +0 -0
- package/infrastructure/terraform-ecr/dev.tfvars +3 -0
- package/infrastructure/terraform-ecr/ecr.tf +69 -0
- package/infrastructure/terraform-ecr/main.tf +3 -0
- package/infrastructure/terraform-ecr/variables.tf +19 -0
- package/infrastructure/terraform-ecr/versions.tf +12 -0
- package/infrastructure/terraform-newrelic/alerts.tf +290 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +347 -0
- package/infrastructure/terraform-newrelic/dev.tfvars +3 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +54 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
- package/infrastructure/terraform-newrelic/main.tf +11 -0
- package/infrastructure/terraform-newrelic/monitors.tf +11 -0
- package/infrastructure/terraform-newrelic/prod.tfvars +3 -0
- package/infrastructure/terraform-newrelic/staging.tfvars +3 -0
- package/infrastructure/terraform-newrelic/variables.tf +33 -0
- package/infrastructure/terraform-newrelic/versions.tf +18 -0
- package/jest.config.js +40 -0
- package/jest.config.pact.js +18 -0
- package/newrelic.js +86 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +95 -0
- package/package.json +127 -0
- package/pages/_app.tsx +117 -0
- package/pages/_document.tsx +112 -0
- package/pages/_error.tsx +68 -0
- package/pages/account/add/[field].tsx +34 -0
- package/pages/account/cancellation/index.tsx +22 -0
- package/pages/account/delete/confirm/index.tsx +16 -0
- package/pages/account/delete/error/index.tsx +16 -0
- package/pages/account/delete/index.tsx +16 -0
- package/pages/account/delete/success/index.tsx +16 -0
- package/pages/account/dream-team/index.tsx +19 -0
- package/pages/account/edit/[field].tsx +45 -0
- package/pages/account/family/index.tsx +19 -0
- package/pages/account/holiday-stop/index.tsx +19 -0
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +19 -0
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +19 -0
- package/pages/account/index.tsx +33 -0
- package/pages/account/newsletters/index.tsx +19 -0
- package/pages/account/newsletters-and-alerts/index.tsx +24 -0
- package/pages/account/payment/[paymentMethod].tsx +37 -0
- package/pages/account/payment/index.tsx +23 -0
- package/pages/account/payment-methods/index.tsx +21 -0
- package/pages/account/subscription-and-billing/index.tsx +29 -0
- package/pages/api/account/get-session/index.ts +33 -0
- package/pages/api/account/invoice/index.ts +35 -0
- package/pages/api/account/mutate/index.ts +8 -0
- package/pages/api/account/query/index.ts +7 -0
- package/pages/api/auth/[...nextauth].ts +11 -0
- package/pages/api/competitions-sitemap.ts +19 -0
- package/pages/api/feed.ts +23 -0
- package/pages/api/health-check.ts +7 -0
- package/pages/api/news-sitemap.ts +18 -0
- package/pages/api/pages-sitemap.ts +27 -0
- package/pages/api/robots.ts +19 -0
- package/pages/api/sitemap.ts +24 -0
- package/pages/checkout/account-creation/index.tsx +13 -0
- package/pages/checkout/payment-details/index.tsx +10 -0
- package/pages/empty.tsx +6 -0
- package/pages/help-hub/article/[title]/index.tsx +25 -0
- package/pages/help-hub/error.tsx +23 -0
- package/pages/help-hub/index.tsx +51 -0
- package/pages/help-hub/results.tsx +25 -0
- package/pages/index.tsx +19 -0
- package/pages/player/brightcove.tsx +19 -0
- package/pages/rss/create/index.tsx +18 -0
- package/pages/rss/feed/[feedId]/index.tsx +21 -0
- package/pages/rss/index.tsx +18 -0
- package/public/ads.min.js +8175 -0
- package/public/assets/display-base-header.svg +25 -0
- package/public/assets/display-personalDetails-header-sun.svg +55 -0
- package/public/assets/display-personalDetails-header-times.svg +90 -0
- package/public/assets/display-personalDetails-header-vr.svg +46 -0
- package/public/assets/dream-team.svg +10 -0
- package/public/assets/navigationPrimary-brandMark-sun.svg +9 -0
- package/public/assets/navigationPrimary-brandMark-times.svg +18 -0
- package/public/assets/navigationPrimary-brandMark-vr.svg +10 -0
- package/public/assets/newsletters/bestoftimes-101.png +0 -0
- package/public/assets/newsletters/books-115.png +0 -0
- package/public/assets/newsletters/environment-140.png +0 -0
- package/public/assets/newsletters/fashion-108.png +0 -0
- package/public/assets/newsletters/food-106.png +0 -0
- package/public/assets/newsletters/football-111.png +0 -0
- package/public/assets/newsletters/ireland-152.png +0 -0
- package/public/assets/newsletters/law-121.png +0 -0
- package/public/assets/newsletters/money-107.png +0 -0
- package/public/assets/newsletters/moneymentor-150.png +0 -0
- package/public/assets/newsletters/placeholder.png +0 -0
- package/public/assets/newsletters/politics-119.png +0 -0
- package/public/assets/newsletters/property-113.png +0 -0
- package/public/assets/newsletters/puzzles-125.png +0 -0
- package/public/assets/newsletters/scotland-134.png +0 -0
- package/public/assets/newsletters/theatre-127.png +0 -0
- package/public/assets/newsletters/travel-149.png +0 -0
- package/public/assets/newsletters/tv-133.png +0 -0
- package/public/assets/newsletters/us-153.png +0 -0
- package/public/assets/no-subscription.svg +15 -0
- package/public/assets/pending-activation.svg +16 -0
- package/public/assets/personal-details-header.svg +91 -0
- package/public/assets/plchldr150x100.png +0 -0
- package/public/assets/previous-subscription.svg +15 -0
- package/public/assets/primary-navigation-logo-white.svg +6 -0
- package/public/assets/primary-navigation-logo.svg +6 -0
- package/public/assets/tls-logo-white.svg +3 -0
- package/public/favicon.ico +0 -0
- package/public/icon.png +0 -0
- package/public/prebid.min.js +1 -0
- package/queries/getPage.ts +100 -0
- package/queries/getRadioPost.ts +61 -0
- package/queries/getRadioPosts.ts +16 -0
- package/queries/getUserSubscription.ts +9 -0
- package/queries/index.ts +3 -0
- package/scripts/k8s-local.sh +137 -0
- package/scripts/nr-exports.sh +7 -0
- package/temp/_app.tsx +15 -0
- package/temp/_document.tsx +61 -0
- package/temp/app-context-test.tsx +51 -0
- package/temp/app-context.tsx +25 -0
- package/temp/config-index.ts +1 -0
- package/temp/context-index.tsx +1 -0
- package/temp/header.tsx +45 -0
- package/temp/next.config.js +56 -0
- package/tsconfig.json +51 -0
- package/tsconfig.test.json +6 -0
- package/validation/index.tsx +24 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
const data = {
|
|
2
|
+
page: {
|
|
3
|
+
id: '123',
|
|
4
|
+
title: 'test homepage title',
|
|
5
|
+
slug: 'homepage',
|
|
6
|
+
body: [
|
|
7
|
+
{
|
|
8
|
+
id: '123a',
|
|
9
|
+
name: 'name',
|
|
10
|
+
type: 'collection',
|
|
11
|
+
title: 'Section 1',
|
|
12
|
+
link: {
|
|
13
|
+
url: '/section-one',
|
|
14
|
+
},
|
|
15
|
+
children: [
|
|
16
|
+
{
|
|
17
|
+
name: 'SUPPLEMENT_LEAD_AND_4_STACK',
|
|
18
|
+
type: 'slice',
|
|
19
|
+
children: [
|
|
20
|
+
{
|
|
21
|
+
type: 'article-block',
|
|
22
|
+
article: {
|
|
23
|
+
id: 'demo-1',
|
|
24
|
+
slug: 'some-location',
|
|
25
|
+
headline: 'test headline',
|
|
26
|
+
categories: [
|
|
27
|
+
{
|
|
28
|
+
slug: 'catagory-one',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: 'article-block',
|
|
35
|
+
article: {
|
|
36
|
+
id: 'demo-2',
|
|
37
|
+
slug: 'some-location',
|
|
38
|
+
headline: 'test headline 2',
|
|
39
|
+
categories: [
|
|
40
|
+
{
|
|
41
|
+
slug: 'catagory-two',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: 'article-block',
|
|
48
|
+
article: {
|
|
49
|
+
id: 'demo-3',
|
|
50
|
+
slug: 'some-location',
|
|
51
|
+
headline: 'test headline 3',
|
|
52
|
+
categories: [
|
|
53
|
+
{
|
|
54
|
+
slug: 'catagory-three',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'SECONDARY_4',
|
|
63
|
+
type: 'slice',
|
|
64
|
+
children: [
|
|
65
|
+
{
|
|
66
|
+
type: 'article-block',
|
|
67
|
+
article: {
|
|
68
|
+
id: 'demo-1',
|
|
69
|
+
slug: 'some-location',
|
|
70
|
+
headline: 'test headline',
|
|
71
|
+
categories: [
|
|
72
|
+
{
|
|
73
|
+
slug: 'catagory-one',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
summary: {
|
|
77
|
+
children: [
|
|
78
|
+
{
|
|
79
|
+
text: 'teaser test text',
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
media: {
|
|
84
|
+
crops: [
|
|
85
|
+
{
|
|
86
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
87
|
+
alt: 'image alt',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
type: 'article-block',
|
|
95
|
+
article: {
|
|
96
|
+
id: 'demo-2',
|
|
97
|
+
slug: 'some-location',
|
|
98
|
+
headline: 'test headline 2',
|
|
99
|
+
categories: [
|
|
100
|
+
{
|
|
101
|
+
slug: 'catagory-two',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
summary: {
|
|
105
|
+
children: [
|
|
106
|
+
{
|
|
107
|
+
text: 'teaser test text 2',
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
media: {
|
|
112
|
+
crops: [
|
|
113
|
+
{
|
|
114
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
115
|
+
alt: 'image alt 2',
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'article-block',
|
|
123
|
+
article: {
|
|
124
|
+
id: 'demo-3',
|
|
125
|
+
slug: 'some-location',
|
|
126
|
+
headline: 'test headline 3',
|
|
127
|
+
categories: [
|
|
128
|
+
{
|
|
129
|
+
slug: 'catagory-three',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
summary: {
|
|
133
|
+
children: [
|
|
134
|
+
{
|
|
135
|
+
text: 'teaser test text 3',
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
media: [
|
|
140
|
+
{
|
|
141
|
+
crops: {
|
|
142
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
143
|
+
alt: 'image alt 3',
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: 'article-block',
|
|
151
|
+
article: {
|
|
152
|
+
id: 'demo-4',
|
|
153
|
+
slug: 'some-location',
|
|
154
|
+
headline: 'test headline 4',
|
|
155
|
+
categories: [
|
|
156
|
+
{
|
|
157
|
+
slug: 'catagory-four',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
summary: {
|
|
161
|
+
children: [
|
|
162
|
+
{
|
|
163
|
+
text: 'teaser test text 4',
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
},
|
|
167
|
+
media: {
|
|
168
|
+
crops: [
|
|
169
|
+
{
|
|
170
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
171
|
+
alt: 'image alt 3',
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'LEAD_1_AND_1',
|
|
181
|
+
type: 'slice',
|
|
182
|
+
children: [
|
|
183
|
+
{
|
|
184
|
+
type: 'article-block',
|
|
185
|
+
article: {
|
|
186
|
+
id: 'demo-1',
|
|
187
|
+
slug: 'some-location',
|
|
188
|
+
headline: 'test headline',
|
|
189
|
+
categories: [
|
|
190
|
+
{
|
|
191
|
+
slug: 'catagory-one',
|
|
192
|
+
},
|
|
193
|
+
],
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: 'article-block',
|
|
198
|
+
article: {
|
|
199
|
+
id: 'demo-2',
|
|
200
|
+
slug: 'some-location',
|
|
201
|
+
headline: 'test headline 2',
|
|
202
|
+
categories: [
|
|
203
|
+
{
|
|
204
|
+
slug: 'catagory-two',
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: 'LEAD_1_AND_1',
|
|
213
|
+
type: 'slice',
|
|
214
|
+
children: [
|
|
215
|
+
{
|
|
216
|
+
type: 'external-reference',
|
|
217
|
+
article: {
|
|
218
|
+
id: 'demo-1',
|
|
219
|
+
slug: 'some-location',
|
|
220
|
+
headline: 'test headline',
|
|
221
|
+
categories: [
|
|
222
|
+
{
|
|
223
|
+
slug: 'catagory-one',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
type: 'video-brightcove',
|
|
230
|
+
article: {
|
|
231
|
+
id: 'demo-2',
|
|
232
|
+
slug: 'some-location',
|
|
233
|
+
headline: 'test headline 2',
|
|
234
|
+
categories: [
|
|
235
|
+
{
|
|
236
|
+
slug: 'catagory-two',
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
type: 'something',
|
|
243
|
+
article: {
|
|
244
|
+
id: 'demo-2',
|
|
245
|
+
slug: 'some-location',
|
|
246
|
+
headline: 'test headline 2',
|
|
247
|
+
categories: [
|
|
248
|
+
{
|
|
249
|
+
slug: 'catagory-two',
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: 'SUPPLEMENT_LEAD_AND_4_STACK',
|
|
258
|
+
type: 'slice',
|
|
259
|
+
children: [
|
|
260
|
+
{
|
|
261
|
+
type: 'external-reference',
|
|
262
|
+
article: {
|
|
263
|
+
id: 'demo-1',
|
|
264
|
+
slug: 'some-location',
|
|
265
|
+
headline: 'test headline',
|
|
266
|
+
categories: [
|
|
267
|
+
{
|
|
268
|
+
slug: 'catagory-one',
|
|
269
|
+
},
|
|
270
|
+
],
|
|
271
|
+
},
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
type: 'video-brightcove',
|
|
275
|
+
article: {
|
|
276
|
+
id: 'demo-2',
|
|
277
|
+
slug: 'some-location',
|
|
278
|
+
headline: 'test headline 2',
|
|
279
|
+
categories: [
|
|
280
|
+
{
|
|
281
|
+
slug: 'catagory-one',
|
|
282
|
+
},
|
|
283
|
+
],
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
type: 'something',
|
|
288
|
+
article: {
|
|
289
|
+
id: 'demo-2',
|
|
290
|
+
slug: 'some-location',
|
|
291
|
+
headline: 'test headline 2',
|
|
292
|
+
categories: [
|
|
293
|
+
{
|
|
294
|
+
slug: 'catagory-three',
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
name: 'SECONDARY_2_AND_2',
|
|
303
|
+
type: 'slice',
|
|
304
|
+
children: [
|
|
305
|
+
{
|
|
306
|
+
type: 'article-block',
|
|
307
|
+
article: {
|
|
308
|
+
id: 'demo-1',
|
|
309
|
+
slug: 'some-location',
|
|
310
|
+
headline: 'test headline',
|
|
311
|
+
categories: [
|
|
312
|
+
{
|
|
313
|
+
slug: 'catagory-one',
|
|
314
|
+
},
|
|
315
|
+
],
|
|
316
|
+
summary: {
|
|
317
|
+
children: [
|
|
318
|
+
{
|
|
319
|
+
text: 'teaser test text',
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
},
|
|
323
|
+
media: {
|
|
324
|
+
crops: [
|
|
325
|
+
{
|
|
326
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
327
|
+
alt: 'image alt',
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
type: 'article-block',
|
|
335
|
+
article: {
|
|
336
|
+
id: 'demo-2',
|
|
337
|
+
slug: 'some-location',
|
|
338
|
+
headline: 'test headline 2',
|
|
339
|
+
categories: [
|
|
340
|
+
{
|
|
341
|
+
slug: 'catagory-one',
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
summary: {
|
|
345
|
+
children: [
|
|
346
|
+
{
|
|
347
|
+
text: 'teaser test text 2',
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
},
|
|
351
|
+
media: {
|
|
352
|
+
crops: [
|
|
353
|
+
{
|
|
354
|
+
url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
|
|
355
|
+
alt: 'image alt 2',
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
},
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export default data
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* eslint-disable import/no-anonymous-default-export */
|
|
2
|
+
import { GET_RADIO_POST } from '../../queries'
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
request: {
|
|
7
|
+
query: GET_RADIO_POST,
|
|
8
|
+
variables: {
|
|
9
|
+
id: '123',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
result: {
|
|
13
|
+
data: {
|
|
14
|
+
radioPost: {
|
|
15
|
+
data: {
|
|
16
|
+
id: '123',
|
|
17
|
+
type: 'post',
|
|
18
|
+
dateCreated: '2020-08-12T06:25:16Z',
|
|
19
|
+
datePublished: '2020-08-12T06:25:16Z',
|
|
20
|
+
dateUpdated: '2020-08-12T06:28:48Z',
|
|
21
|
+
headline: 'Demo post',
|
|
22
|
+
body: [
|
|
23
|
+
{
|
|
24
|
+
type: 'paragraph',
|
|
25
|
+
dropCap: true,
|
|
26
|
+
children: [
|
|
27
|
+
{
|
|
28
|
+
type: 'text',
|
|
29
|
+
bold: false,
|
|
30
|
+
italic: false,
|
|
31
|
+
underline: false,
|
|
32
|
+
monospace: false,
|
|
33
|
+
text: 'Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; ',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: 'text',
|
|
37
|
+
bold: true,
|
|
38
|
+
italic: false,
|
|
39
|
+
underline: false,
|
|
40
|
+
monospace: false,
|
|
41
|
+
text: 'Donec velit neque',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
bold: false,
|
|
46
|
+
italic: false,
|
|
47
|
+
underline: false,
|
|
48
|
+
monospace: false,
|
|
49
|
+
text: ', auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Proin eget tortor risus. Sed porttitor lectus nibh. Donec sollicitudin molestie malesuada.',
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: 'video-brightcove',
|
|
55
|
+
id: '6180118349001',
|
|
56
|
+
accountId: '5436121856001',
|
|
57
|
+
playerId: 'default',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: 'image',
|
|
61
|
+
url: '//some-image-url',
|
|
62
|
+
caption: null,
|
|
63
|
+
alt: 'lovely image',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ContentType } from '../global-types'
|
|
2
|
+
|
|
3
|
+
const data = {
|
|
4
|
+
radioPosts: [
|
|
5
|
+
{
|
|
6
|
+
id: 123,
|
|
7
|
+
headline: 'Test post',
|
|
8
|
+
body: [],
|
|
9
|
+
dateCreated: '2020-06-29T08:52:32Z',
|
|
10
|
+
datePublished: '2020-06-29T08:52:32Z',
|
|
11
|
+
dateUpdated: '2020-06-29T08:52:32Z',
|
|
12
|
+
type: ContentType.article,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
id: 124,
|
|
16
|
+
headline: 'Test post two',
|
|
17
|
+
body: [],
|
|
18
|
+
dateCreated: '2020-06-29T08:52:32Z',
|
|
19
|
+
datePublished: '2020-06-29T08:52:32Z',
|
|
20
|
+
dateUpdated: '2020-06-29T08:52:32Z',
|
|
21
|
+
type: ContentType.article,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default data
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const recomendationsMock = [
|
|
2
|
+
{
|
|
3
|
+
href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
|
|
4
|
+
tag: 'FOOT ON THE GAZ',
|
|
5
|
+
text: 'Bale considering short deal with new club before RETIRING after World Cup',
|
|
6
|
+
title: 'FOOT ON THE GAZ',
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
|
|
10
|
+
tag: 'TOUGH TIMES',
|
|
11
|
+
text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
|
|
12
|
+
title: 'TOUGH TIMES',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
href: '',
|
|
16
|
+
tag: 'TOUGH TIMES',
|
|
17
|
+
text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
|
|
18
|
+
title: 'TOUGH TIMES',
|
|
19
|
+
},
|
|
20
|
+
]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import getRadioPosts from './getRadioPostsMock'
|
|
2
|
+
import getRadioPost from './getRadioPostMock'
|
|
3
|
+
import getPage from './getPageMock'
|
|
4
|
+
|
|
5
|
+
export const getRadioPostsMock = getRadioPosts
|
|
6
|
+
export const getRadioPostMock = getRadioPost
|
|
7
|
+
export const getPageMock = getPage
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Publisher } from '@newskit-render/api'
|
|
2
|
+
|
|
3
|
+
const demoTenantRegex = /(newskit-render|localhost)/
|
|
4
|
+
const timesTenantRegex = /times/
|
|
5
|
+
|
|
6
|
+
const isDemoTenant = (host: string) => demoTenantRegex.test(host)
|
|
7
|
+
const isTimesTenant = (host: string) => timesTenantRegex.test(host)
|
|
8
|
+
|
|
9
|
+
export const getTenant = (host: string): Publisher => {
|
|
10
|
+
switch (true) {
|
|
11
|
+
case isTimesTenant(host):
|
|
12
|
+
return Publisher.TIMES
|
|
13
|
+
case isDemoTenant(host):
|
|
14
|
+
return Publisher.DEMO
|
|
15
|
+
|
|
16
|
+
default:
|
|
17
|
+
return Publisher.DEMO
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { render as renderer, RenderOptions } from '@testing-library/react'
|
|
3
|
+
import { UncompiledTheme, ThemeProvider, newskitLightTheme } from 'newskit'
|
|
4
|
+
import { MockedProvider, MockedResponse } from '@apollo/react-testing'
|
|
5
|
+
|
|
6
|
+
export const renderWithTheme = <T extends {}>(
|
|
7
|
+
Component: React.ComponentType<T>,
|
|
8
|
+
props?: T & { children?: React.ReactNode },
|
|
9
|
+
theme: UncompiledTheme = newskitLightTheme,
|
|
10
|
+
options?: Omit<RenderOptions, 'wrapper'>
|
|
11
|
+
) =>
|
|
12
|
+
renderer(<Component {...(props as T)} />, {
|
|
13
|
+
...options,
|
|
14
|
+
wrapper: ({ children }) => (
|
|
15
|
+
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
16
|
+
),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export const renderWithQuery = <T extends {}>(
|
|
20
|
+
Component: React.ComponentType<T>,
|
|
21
|
+
mockedQuery: ReadonlyArray<MockedResponse>,
|
|
22
|
+
props?: T & { children?: React.ReactNode },
|
|
23
|
+
theme: UncompiledTheme = newskitLightTheme,
|
|
24
|
+
options?: Omit<RenderOptions, 'wrapper'>
|
|
25
|
+
) =>
|
|
26
|
+
renderer(<Component {...(props as T)} />, {
|
|
27
|
+
...options,
|
|
28
|
+
wrapper: ({ children }) => (
|
|
29
|
+
<MockedProvider mocks={mockedQuery} addTypename={false}>
|
|
30
|
+
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
31
|
+
</MockedProvider>
|
|
32
|
+
),
|
|
33
|
+
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { UncompiledTheme } from 'newskit'
|
|
3
|
+
import {
|
|
4
|
+
sharedTheme,
|
|
5
|
+
sharedThemeDark,
|
|
6
|
+
timesTheme,
|
|
7
|
+
virginRadioTheme,
|
|
8
|
+
theSunTheme,
|
|
9
|
+
tlsTheme,
|
|
10
|
+
ThemeDropdownObject,
|
|
11
|
+
ThemeDropdown,
|
|
12
|
+
} from '@newskit-render/shared-components'
|
|
13
|
+
|
|
14
|
+
const clientHeaderImages = {
|
|
15
|
+
'The-Sun': 'display-personalDetails-header-sun.svg',
|
|
16
|
+
'Virgin-Radio': 'display-personalDetails-header-vr.svg',
|
|
17
|
+
'The-Times': 'display-personalDetails-header-times.svg',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const clientNavigationLogos = {
|
|
21
|
+
'The-Sun': {
|
|
22
|
+
src: '/assets/navigationPrimary-brandMark-sun.svg',
|
|
23
|
+
width: '140px',
|
|
24
|
+
height: '48px',
|
|
25
|
+
top: '0',
|
|
26
|
+
},
|
|
27
|
+
'Virgin-Radio': {
|
|
28
|
+
src: '/assets/navigationPrimary-brandMark-vr.svg',
|
|
29
|
+
width: '150px',
|
|
30
|
+
height: '41px',
|
|
31
|
+
top: '0',
|
|
32
|
+
},
|
|
33
|
+
'The-Times': {
|
|
34
|
+
src: '/assets/navigationPrimary-brandMark-times.svg',
|
|
35
|
+
width: '150px',
|
|
36
|
+
height: '40px',
|
|
37
|
+
top: '0',
|
|
38
|
+
},
|
|
39
|
+
TLS: {
|
|
40
|
+
src: '/assets/tls-logo-white.svg',
|
|
41
|
+
width: '150px',
|
|
42
|
+
height: '40px',
|
|
43
|
+
top: '0',
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const useThemeDropdownObject = (
|
|
48
|
+
setTheme: (T: UncompiledTheme) => void
|
|
49
|
+
): ThemeDropdownObject => {
|
|
50
|
+
const [themeDropdownOpen, setThemeDropdownOpen] = useState(false)
|
|
51
|
+
const themeDropdownObject = {
|
|
52
|
+
clientHeaderImages,
|
|
53
|
+
clientNavigationLogos,
|
|
54
|
+
themeDropdownOpen,
|
|
55
|
+
options: {
|
|
56
|
+
sharedTheme,
|
|
57
|
+
sharedThemeDark,
|
|
58
|
+
timesTheme,
|
|
59
|
+
tlsTheme,
|
|
60
|
+
virginRadioTheme,
|
|
61
|
+
theSunTheme,
|
|
62
|
+
},
|
|
63
|
+
dropdown: (opts, customTheme) => (
|
|
64
|
+
<ThemeDropdown
|
|
65
|
+
options={opts}
|
|
66
|
+
theme={customTheme}
|
|
67
|
+
setTheme={setTheme}
|
|
68
|
+
setThemeDropdownVisibility={setThemeDropdownOpen}
|
|
69
|
+
/>
|
|
70
|
+
),
|
|
71
|
+
}
|
|
72
|
+
return themeDropdownObject
|
|
73
|
+
}
|