@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.
Files changed (456) hide show
  1. package/.ci/trigger-circleci-workflow.sh +37 -0
  2. package/.eslintignore +23 -0
  3. package/.eslintrc +74 -0
  4. package/.prettierignore +19 -0
  5. package/.prettierrc +7 -0
  6. package/CHANGELOG.md +7638 -0
  7. package/Dockerfile +14 -0
  8. package/Dockerfile.withNewRelic +15 -0
  9. package/README.md +274 -0
  10. package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +20 -0
  11. package/__tests__/pages/__snapshots__/home.test.tsx.snap +1195 -0
  12. package/__tests__/pages/brightcove.test.tsx +34 -0
  13. package/__tests__/pages/empty.test.tsx +10 -0
  14. package/__tests__/pages/home.test.tsx +16 -0
  15. package/app-context/InstrumentationContextProvider.tsx +36 -0
  16. package/assets/fontFamily.ts +416 -0
  17. package/assets/fonts/Graphik-Black-App.ttf +0 -0
  18. package/assets/fonts/Graphik-BlackItalic-App.ttf +0 -0
  19. package/assets/fonts/Graphik-Bold-App.ttf +0 -0
  20. package/assets/fonts/Graphik-BoldItalic-App.ttf +0 -0
  21. package/assets/fonts/Graphik-Extralight-App.ttf +0 -0
  22. package/assets/fonts/Graphik-ExtralightItalic-App.ttf +0 -0
  23. package/assets/fonts/Graphik-Light-App.ttf +0 -0
  24. package/assets/fonts/Graphik-LightItalic-App.ttf +0 -0
  25. package/assets/fonts/Graphik-Medium-App.ttf +0 -0
  26. package/assets/fonts/Graphik-Medium-Web.woff2 +0 -0
  27. package/assets/fonts/Graphik-MediumItalic-App.ttf +0 -0
  28. package/assets/fonts/Graphik-Regular-App.ttf +0 -0
  29. package/assets/fonts/Graphik-Regular-Web.woff2 +0 -0
  30. package/assets/fonts/Graphik-RegularItalic-App.ttf +0 -0
  31. package/assets/fonts/Graphik-Semibold-App.ttf +0 -0
  32. package/assets/fonts/Graphik-Semibold-Web.woff2 +0 -0
  33. package/assets/fonts/Graphik-SemiboldItalic-App.ttf +0 -0
  34. package/assets/fonts/Graphik-Super-App.ttf +0 -0
  35. package/assets/fonts/Graphik-SuperItalic-App.ttf +0 -0
  36. package/assets/fonts/Graphik-Thin-App.ttf +0 -0
  37. package/assets/fonts/Graphik-ThinItalic-App.ttf +0 -0
  38. package/assets/fonts/Montserrat-Black.ttf +0 -0
  39. package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
  40. package/assets/fonts/Montserrat-Bold.ttf +0 -0
  41. package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
  42. package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
  43. package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
  44. package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
  45. package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
  46. package/assets/fonts/Montserrat-Italic.ttf +0 -0
  47. package/assets/fonts/Montserrat-Light.ttf +0 -0
  48. package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
  49. package/assets/fonts/Montserrat-Medium.ttf +0 -0
  50. package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
  51. package/assets/fonts/Montserrat-Regular.ttf +0 -0
  52. package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
  53. package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
  54. package/assets/fonts/Montserrat-Thin.ttf +0 -0
  55. package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
  56. package/assets/fonts/PublicoHeadline-Black-App.ttf +0 -0
  57. package/assets/fonts/PublicoHeadline-BlackItalic-App.ttf +0 -0
  58. package/assets/fonts/PublicoHeadline-Bold-App.ttf +0 -0
  59. package/assets/fonts/PublicoHeadline-Bold-Web.woff2 +0 -0
  60. package/assets/fonts/PublicoHeadline-BoldItalic-App.ttf +0 -0
  61. package/assets/fonts/PublicoHeadline-Extrabold-App.ttf +0 -0
  62. package/assets/fonts/PublicoHeadline-ExtraboldItalic-App.ttf +0 -0
  63. package/assets/fonts/PublicoHeadline-Italic-App.ttf +0 -0
  64. package/assets/fonts/PublicoHeadline-Light-App.ttf +0 -0
  65. package/assets/fonts/PublicoHeadline-LightItalic-App.ttf +0 -0
  66. package/assets/fonts/PublicoHeadline-Medium-App.ttf +0 -0
  67. package/assets/fonts/PublicoHeadline-MediumItalic-App.ttf +0 -0
  68. package/assets/fonts/PublicoHeadline-Roman-App.ttf +0 -0
  69. package/assets/fonts/PublicoHeadline-Roman-Web.woff2 +0 -0
  70. package/assets/fonts/PublicoText-Bold-App.ttf +0 -0
  71. package/assets/fonts/PublicoText-BoldItalic-App.ttf +0 -0
  72. package/assets/fonts/PublicoText-Italic-App.ttf +0 -0
  73. package/assets/fonts/PublicoText-Italic-Web.woff2 +0 -0
  74. package/assets/fonts/PublicoText-Roman-App.ttf +0 -0
  75. package/assets/fonts/PublicoText-Roman-Web.woff2 +0 -0
  76. package/assets/fonts/PublicoText-Semibold-App.ttf +0 -0
  77. package/assets/fonts/PublicoText-SemiboldItalic-App.ttf +0 -0
  78. package/assets/fonts/Roboto-Bold.ttf +0 -0
  79. package/assets/fonts/Roboto-Light.ttf +0 -0
  80. package/assets/fonts/Roboto-Medium.ttf +0 -0
  81. package/assets/fonts/Roboto-Regular.ttf +0 -0
  82. package/assets/fonts/TheSun-Bold.ttf +0 -0
  83. package/assets/fonts/TheSun-BoldItalic.ttf +0 -0
  84. package/assets/fonts/TheSun-HeavyCondensed.ttf +0 -0
  85. package/assets/fonts/TheSun-HeavyNarrow.ttf +0 -0
  86. package/assets/fonts/TheSun-Italic.ttf +0 -0
  87. package/assets/fonts/TheSun-Medium.ttf +0 -0
  88. package/assets/fonts/TheSun-MediumItalic.ttf +0 -0
  89. package/assets/fonts/TheSun-Regular.ttf +0 -0
  90. package/assets/fonts/TimesDigital-Bold.ttf +0 -0
  91. package/assets/fonts/TimesDigital-BoldItalic.ttf +0 -0
  92. package/assets/fonts/TimesDigital-BoldSC.ttf +0 -0
  93. package/assets/fonts/TimesDigital-Italic.ttf +0 -0
  94. package/assets/fonts/TimesDigital-Regular.ttf +0 -0
  95. package/assets/fonts/TimesDigital-RegularSC.ttf +0 -0
  96. package/assets/fonts/TimesDigitalW04-Bold.ttf +0 -0
  97. package/assets/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
  98. package/assets/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
  99. package/assets/fonts/TimesDigitalW04-Italic.ttf +0 -0
  100. package/assets/fonts/TimesDigitalW04-Regular.ttf +0 -0
  101. package/assets/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
  102. package/assets/fonts/TimesModern-Regular.otf +0 -0
  103. package/assets/fonts/attribuitions.mdx +35 -0
  104. package/assets/fonts/bitter-medium.woff +0 -0
  105. package/assets/fonts/bitter-medium.woff2 +0 -0
  106. package/assets/fonts/bitter-mediumitalic.woff +0 -0
  107. package/assets/fonts/bitter-mediumitalic.woff2 +0 -0
  108. package/assets/fonts/bitter-regular.woff +0 -0
  109. package/assets/fonts/bitter-regular.woff2 +0 -0
  110. package/assets/fonts/bitter-semibold.woff +0 -0
  111. package/assets/fonts/bitter-semibold.woff2 +0 -0
  112. package/assets/fonts/dmmono-medium.woff +0 -0
  113. package/assets/fonts/dmmono-medium.woff2 +0 -0
  114. package/assets/fonts/dmsans-bold-webfont.woff +0 -0
  115. package/assets/fonts/dmsans-bold-webfont.woff2 +0 -0
  116. package/assets/fonts/dmsans-bolditalic-webfont.woff +0 -0
  117. package/assets/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
  118. package/assets/fonts/dmsans-italic-webfont.woff +0 -0
  119. package/assets/fonts/dmsans-italic-webfont.woff2 +0 -0
  120. package/assets/fonts/dmsans-medium-webfont.woff +0 -0
  121. package/assets/fonts/dmsans-medium-webfont.woff2 +0 -0
  122. package/assets/fonts/dmsans-mediumitalic-webfont.woff +0 -0
  123. package/assets/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
  124. package/assets/fonts/dmsans-regular-webfont.woff +0 -0
  125. package/assets/fonts/dmsans-regular-webfont.woff2 +0 -0
  126. package/assets/fonts/notosans-bold-webfont.woff +0 -0
  127. package/assets/fonts/notosans-bold-webfont.woff2 +0 -0
  128. package/assets/fonts/notosans-italic-webfont.woff +0 -0
  129. package/assets/fonts/notosans-italic-webfont.woff2 +0 -0
  130. package/assets/fonts/notosans-medium-webfont.woff +0 -0
  131. package/assets/fonts/notosans-medium-webfont.woff2 +0 -0
  132. package/assets/fonts/notosans-regular-webfont.woff +0 -0
  133. package/assets/fonts/notosans-regular-webfont.woff2 +0 -0
  134. package/assets/fonts/poppins-bold-webfont.woff +0 -0
  135. package/assets/fonts/poppins-bold-webfont.woff2 +0 -0
  136. package/assets/fonts/poppins-bolditalic-webfont.woff +0 -0
  137. package/assets/fonts/poppins-bolditalic-webfont.woff2 +0 -0
  138. package/assets/fonts/poppins-extrabold-webfont.woff +0 -0
  139. package/assets/fonts/poppins-extrabold-webfont.woff2 +0 -0
  140. package/assets/fonts/poppins-extrabolditalic-webfont.woff +0 -0
  141. package/assets/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
  142. package/assets/fonts/poppins-italic-webfont.woff +0 -0
  143. package/assets/fonts/poppins-italic-webfont.woff2 +0 -0
  144. package/assets/fonts/poppins-light-webfont.woff +0 -0
  145. package/assets/fonts/poppins-light-webfont.woff2 +0 -0
  146. package/assets/fonts/poppins-lightitalic-webfont.woff +0 -0
  147. package/assets/fonts/poppins-lightitalic-webfont.woff2 +0 -0
  148. package/assets/fonts/poppins-medium-webfont.woff +0 -0
  149. package/assets/fonts/poppins-medium-webfont.woff2 +0 -0
  150. package/assets/fonts/poppins-mediumitalic-webfont.woff +0 -0
  151. package/assets/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
  152. package/assets/fonts/poppins-regular-webfont.woff +0 -0
  153. package/assets/fonts/poppins-regular-webfont.woff2 +0 -0
  154. package/assets/fonts/poppins-semibold-webfont.woff +0 -0
  155. package/assets/fonts/poppins-semibold-webfont.woff2 +0 -0
  156. package/assets/fonts/poppins-semibolditalic-webfont.woff +0 -0
  157. package/assets/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
  158. package/assets/fonts/source-serif-pro-600.woff +0 -0
  159. package/assets/fonts/source-serif-pro-600.woff2 +0 -0
  160. package/assets/fonts/source-serif-pro-600italic.woff +0 -0
  161. package/assets/fonts/source-serif-pro-600italic.woff2 +0 -0
  162. package/assets/fonts/source-serif-pro-700.woff +0 -0
  163. package/assets/fonts/source-serif-pro-700.woff2 +0 -0
  164. package/assets/fonts/source-serif-pro-700italic.woff +0 -0
  165. package/assets/fonts/source-serif-pro-700italic.woff2 +0 -0
  166. package/assets/fonts/source-serif-pro-italic.woff +0 -0
  167. package/assets/fonts/source-serif-pro-italic.woff2 +0 -0
  168. package/assets/fonts/source-serif-pro-regular.woff +0 -0
  169. package/assets/fonts/source-serif-pro-regular.woff2 +0 -0
  170. package/components/AccountDropdown/AccountDropdown.tsx +65 -0
  171. package/components/AccountDropdown/__tests__/AcountDropdown.test.tsx +83 -0
  172. package/components/AccountDropdown/accounts.ts +47 -0
  173. package/components/AccountDropdown/index.tsx +2 -0
  174. package/components/AccountDropdown/utils.ts +21 -0
  175. package/components/ErrorPage/ErrorPage.tsx +135 -0
  176. package/components/ad/index.tsx +35 -0
  177. package/components/article/Highlights.tsx +77 -0
  178. package/components/article/MetaBox.tsx +50 -0
  179. package/components/article/RelatedArticles.tsx +53 -0
  180. package/components/article/RelatedTopics.tsx +59 -0
  181. package/components/article/ShareBarComponent.tsx +53 -0
  182. package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1568 -0
  183. package/components/article/__tests__/index.test.tsx +171 -0
  184. package/components/article/__tests__/mocks.ts +105 -0
  185. package/components/article/index.tsx +320 -0
  186. package/components/common/BackToHomepage.tsx +37 -0
  187. package/components/common/NavLink.tsx +26 -0
  188. package/components/common/NewskitLogo.tsx +52 -0
  189. package/components/common/NewskitLogoShort.tsx +48 -0
  190. package/components/common/SectionTitleBar.tsx +57 -0
  191. package/components/common/ShareButton.tsx +18 -0
  192. package/components/common/ViewMoreButton.tsx +20 -0
  193. package/components/common/iconNavLink/IconNavLink.tsx +70 -0
  194. package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
  195. package/components/common/iconNavLink/index.ts +3 -0
  196. package/components/common/iconNavLink/types.ts +24 -0
  197. package/components/common/icons/IconAccount.tsx +13 -0
  198. package/components/common/icons/IconFilledTwitter.tsx +14 -0
  199. package/components/common/icons/StyledIconFilledChevronRight.tsx +12 -0
  200. package/components/footer/__snapshots__/index.test.tsx.snap +192 -0
  201. package/components/footer/index.test.tsx +13 -0
  202. package/components/footer/index.tsx +151 -0
  203. package/components/header/banner-messages.ts +39 -0
  204. package/components/header/index.tsx +52 -0
  205. package/components/header/navigation-links.ts +20 -0
  206. package/components/layout/Gutter.tsx +11 -0
  207. package/components/layout/LayoutTemplate.tsx +26 -0
  208. package/components/layout/MainGrid.tsx +66 -0
  209. package/components/layout/index.tsx +3 -0
  210. package/components/layout/layoutTypes.ts +13 -0
  211. package/components/section/ArticleSlice.tsx +35 -0
  212. package/components/section/CollectionBlock.tsx +54 -0
  213. package/components/section/SectionContext.tsx +9 -0
  214. package/components/section/__tests__/ArticleSlice.test.tsx +128 -0
  215. package/components/section/__tests__/CollectionBlock.test.tsx +83 -0
  216. package/components/section/__tests__/pageBlock.test.tsx +24 -0
  217. package/components/section/__tests__/sectionUtils.test.ts +94 -0
  218. package/components/section/index.tsx +39 -0
  219. package/components/section/layouts/Block.tsx +79 -0
  220. package/components/section/layouts/FallBack.tsx +24 -0
  221. package/components/section/layouts/Lead.tsx +43 -0
  222. package/components/section/layouts/Rows.tsx +82 -0
  223. package/components/section/layouts/SectionTitle.tsx +57 -0
  224. package/components/section/layouts/__tests__/Lead.test.tsx +37 -0
  225. package/components/section/layouts/__tests__/Rows.test.tsx +40 -0
  226. package/components/section/layouts/__tests__/SectionTitle.test.tsx +37 -0
  227. package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +180 -0
  228. package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +354 -0
  229. package/components/section/layouts/gridUtils.ts +21 -0
  230. package/components/section/layouts/index.tsx +4 -0
  231. package/components/section/layouts/types.ts +13 -0
  232. package/components/section/pageBlock.tsx +23 -0
  233. package/components/section/sectionUtils.ts +61 -0
  234. package/components/teaser/index.test.tsx +50 -0
  235. package/components/teaser/index.tsx +64 -0
  236. package/components/teaser/teaserVariants.ts +33 -0
  237. package/components/teaser/variant-types.ts +49 -0
  238. package/components/teaser/variants/featureVariant.ts +42 -0
  239. package/components/teaser/variants/horizontal.ts +14 -0
  240. package/components/teaser/variants/titleTeaserVariant.ts +32 -0
  241. package/components/teaser/variants/titleVertical.ts +24 -0
  242. package/components/utils/index.test.ts +12 -0
  243. package/components/utils/index.ts +6 -0
  244. package/config/__tests__/index.test.ts +54 -0
  245. package/config/environment.ts +80 -0
  246. package/config/index.ts +2 -0
  247. package/config/multiTenancy.ts +11 -0
  248. package/constants/index.ts +2 -0
  249. package/context/app-context/AppContext.test.tsx +56 -0
  250. package/context/app-context/holidayStopListContextOverrides.ts +18 -0
  251. package/context/app-context/index.tsx +34 -0
  252. package/context/app-context/paymentMethodContext.tsx +70 -0
  253. package/context/index.tsx +2 -0
  254. package/context/multi-tenancy/MultiTenancy.test.tsx +48 -0
  255. package/context/multi-tenancy/index.tsx +32 -0
  256. package/css/index.ts +15 -0
  257. package/cypress/axe/terminal-log.js +19 -0
  258. package/cypress/config/visual.config.ts +11 -0
  259. package/cypress/config/visual.skip.config.ts +10 -0
  260. package/cypress/e2e/account/accessibility.cy.js +88 -0
  261. package/cypress/e2e/account/banners.cy.js +169 -0
  262. package/cypress/e2e/account/cancellation.cy.js +219 -0
  263. package/cypress/e2e/account/holiday-stops.cy.js +109 -0
  264. package/cypress/e2e/account/main-api.cy.js +102 -0
  265. package/cypress/e2e/account/newsletters-and-alerts.cy.js +149 -0
  266. package/cypress/e2e/account/newsletters-page.cy.js +69 -0
  267. package/cypress/e2e/account/payment-page.cy.js +98 -0
  268. package/cypress/e2e/account/personal-details.cy.js +1161 -0
  269. package/cypress/e2e/account/subscription-and-billing.cy.js +434 -0
  270. package/cypress/e2e/checkout/account-creation.cy.js +8 -0
  271. package/cypress/e2e/checkout/payment-details.cy.js +19 -0
  272. package/cypress/e2e/core/home-page.cy.js +6 -0
  273. package/cypress/e2e/help-hub/accessibility.cy.js +35 -0
  274. package/cypress/e2e/help-hub/article-page.cy.js +115 -0
  275. package/cypress/e2e/help-hub/landing-page.cy.js +94 -0
  276. package/cypress/e2e/help-hub/result-page.cy.js +117 -0
  277. package/cypress/fixtures/empty.html +10 -0
  278. package/cypress/fixtures/example.json +5 -0
  279. package/cypress/fixtures/holiday-stops.json +40 -0
  280. package/cypress/fixtures/paymentFailure.js +24 -0
  281. package/cypress/fixtures/testDates.js +26 -0
  282. package/cypress/support/commands.js +125 -0
  283. package/cypress/support/consentValues.js +5839 -0
  284. package/cypress/support/e2e.js +22 -0
  285. package/cypress/support/users.js +58 -0
  286. package/cypress/visual/account/print-visual-regression.cy.js +9 -0
  287. package/cypress/visual/account/visual-regression.cy.js +40 -0
  288. package/cypress/visual/empty/empty.cy.js +5 -0
  289. package/cypress.config.ts +38 -0
  290. package/helpers/__tests__/getUser.test.ts +45 -0
  291. package/helpers/__tests__/logger.test.ts +62 -0
  292. package/helpers/__tests__/useThemeDropdownObject.test.ts +49 -0
  293. package/helpers/a11y.ts +7 -0
  294. package/helpers/addCacheHeaders.ts +8 -0
  295. package/helpers/getUser.ts +37 -0
  296. package/helpers/getYear.ts +1 -0
  297. package/helpers/global-types.ts +186 -0
  298. package/helpers/logger/getWinstonLogger.ts +19 -0
  299. package/helpers/logger/index.ts +20 -0
  300. package/helpers/logger/replaceConsoleWithLogger.ts +14 -0
  301. package/helpers/mocks/articleMock.ts +50 -0
  302. package/helpers/mocks/getPageMock.ts +369 -0
  303. package/helpers/mocks/getRadioPostMock.ts +71 -0
  304. package/helpers/mocks/getRadioPostsMock.ts +26 -0
  305. package/helpers/mocks/getRecommendationsMock.ts +20 -0
  306. package/helpers/mocks/index.ts +7 -0
  307. package/helpers/multiTenancy.ts +19 -0
  308. package/helpers/setupTests.ts +5 -0
  309. package/helpers/test-utils.tsx +33 -0
  310. package/helpers/useThemeDropdownObject.tsx +73 -0
  311. package/infrastructure/.circleci/config.yml +1187 -0
  312. package/infrastructure/INFRASTRUCTURE.md +142 -0
  313. package/infrastructure/build_and_deploy.png +0 -0
  314. package/infrastructure/helm/Chart.yaml +21 -0
  315. package/infrastructure/helm/templates/_helpers.tpl +87 -0
  316. package/infrastructure/helm/templates/deployment.yaml +45 -0
  317. package/infrastructure/helm/templates/horizontalpodautoscaler.yaml +21 -0
  318. package/infrastructure/helm/templates/ingress.yaml +31 -0
  319. package/infrastructure/helm/templates/networkpolicy.yaml +26 -0
  320. package/infrastructure/helm/templates/secret.yaml +12 -0
  321. package/infrastructure/helm/templates/service.yaml +15 -0
  322. package/infrastructure/helm/values-dev.yaml +39 -0
  323. package/infrastructure/helm/values-local.yaml +30 -0
  324. package/infrastructure/helm/values-pr.yaml +40 -0
  325. package/infrastructure/helm/values-prod.yaml +39 -0
  326. package/infrastructure/helm/values-staging.yaml +39 -0
  327. package/infrastructure/helm/values.yaml +44 -0
  328. package/infrastructure/pull_request.png +0 -0
  329. package/infrastructure/release-documentation-cli.config.json +18 -0
  330. package/infrastructure/remove_pr.png +0 -0
  331. package/infrastructure/terraform-ecr/dev.tfvars +3 -0
  332. package/infrastructure/terraform-ecr/ecr.tf +69 -0
  333. package/infrastructure/terraform-ecr/main.tf +3 -0
  334. package/infrastructure/terraform-ecr/variables.tf +19 -0
  335. package/infrastructure/terraform-ecr/versions.tf +12 -0
  336. package/infrastructure/terraform-newrelic/alerts.tf +290 -0
  337. package/infrastructure/terraform-newrelic/dashboards.tf +347 -0
  338. package/infrastructure/terraform-newrelic/dev.tfvars +3 -0
  339. package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
  340. package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +54 -0
  341. package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
  342. package/infrastructure/terraform-newrelic/main.tf +11 -0
  343. package/infrastructure/terraform-newrelic/monitors.tf +11 -0
  344. package/infrastructure/terraform-newrelic/prod.tfvars +3 -0
  345. package/infrastructure/terraform-newrelic/staging.tfvars +3 -0
  346. package/infrastructure/terraform-newrelic/variables.tf +33 -0
  347. package/infrastructure/terraform-newrelic/versions.tf +18 -0
  348. package/jest.config.js +40 -0
  349. package/jest.config.pact.js +18 -0
  350. package/newrelic.js +86 -0
  351. package/next-env.d.ts +5 -0
  352. package/next.config.js +95 -0
  353. package/package.json +127 -0
  354. package/pages/_app.tsx +117 -0
  355. package/pages/_document.tsx +112 -0
  356. package/pages/_error.tsx +68 -0
  357. package/pages/account/add/[field].tsx +34 -0
  358. package/pages/account/cancellation/index.tsx +22 -0
  359. package/pages/account/delete/confirm/index.tsx +16 -0
  360. package/pages/account/delete/error/index.tsx +16 -0
  361. package/pages/account/delete/index.tsx +16 -0
  362. package/pages/account/delete/success/index.tsx +16 -0
  363. package/pages/account/dream-team/index.tsx +19 -0
  364. package/pages/account/edit/[field].tsx +45 -0
  365. package/pages/account/family/index.tsx +19 -0
  366. package/pages/account/holiday-stop/index.tsx +19 -0
  367. package/pages/account/holiday-stop/previous-holiday-stops.tsx +19 -0
  368. package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +19 -0
  369. package/pages/account/index.tsx +33 -0
  370. package/pages/account/newsletters/index.tsx +19 -0
  371. package/pages/account/newsletters-and-alerts/index.tsx +24 -0
  372. package/pages/account/payment/[paymentMethod].tsx +37 -0
  373. package/pages/account/payment/index.tsx +23 -0
  374. package/pages/account/payment-methods/index.tsx +21 -0
  375. package/pages/account/subscription-and-billing/index.tsx +29 -0
  376. package/pages/api/account/get-session/index.ts +33 -0
  377. package/pages/api/account/invoice/index.ts +35 -0
  378. package/pages/api/account/mutate/index.ts +8 -0
  379. package/pages/api/account/query/index.ts +7 -0
  380. package/pages/api/auth/[...nextauth].ts +11 -0
  381. package/pages/api/competitions-sitemap.ts +19 -0
  382. package/pages/api/feed.ts +23 -0
  383. package/pages/api/health-check.ts +7 -0
  384. package/pages/api/news-sitemap.ts +18 -0
  385. package/pages/api/pages-sitemap.ts +27 -0
  386. package/pages/api/robots.ts +19 -0
  387. package/pages/api/sitemap.ts +24 -0
  388. package/pages/checkout/account-creation/index.tsx +13 -0
  389. package/pages/checkout/payment-details/index.tsx +10 -0
  390. package/pages/empty.tsx +6 -0
  391. package/pages/help-hub/article/[title]/index.tsx +25 -0
  392. package/pages/help-hub/error.tsx +23 -0
  393. package/pages/help-hub/index.tsx +51 -0
  394. package/pages/help-hub/results.tsx +25 -0
  395. package/pages/index.tsx +19 -0
  396. package/pages/player/brightcove.tsx +19 -0
  397. package/pages/rss/create/index.tsx +18 -0
  398. package/pages/rss/feed/[feedId]/index.tsx +21 -0
  399. package/pages/rss/index.tsx +18 -0
  400. package/public/ads.min.js +8175 -0
  401. package/public/assets/display-base-header.svg +25 -0
  402. package/public/assets/display-personalDetails-header-sun.svg +55 -0
  403. package/public/assets/display-personalDetails-header-times.svg +90 -0
  404. package/public/assets/display-personalDetails-header-vr.svg +46 -0
  405. package/public/assets/dream-team.svg +10 -0
  406. package/public/assets/navigationPrimary-brandMark-sun.svg +9 -0
  407. package/public/assets/navigationPrimary-brandMark-times.svg +18 -0
  408. package/public/assets/navigationPrimary-brandMark-vr.svg +10 -0
  409. package/public/assets/newsletters/bestoftimes-101.png +0 -0
  410. package/public/assets/newsletters/books-115.png +0 -0
  411. package/public/assets/newsletters/environment-140.png +0 -0
  412. package/public/assets/newsletters/fashion-108.png +0 -0
  413. package/public/assets/newsletters/food-106.png +0 -0
  414. package/public/assets/newsletters/football-111.png +0 -0
  415. package/public/assets/newsletters/ireland-152.png +0 -0
  416. package/public/assets/newsletters/law-121.png +0 -0
  417. package/public/assets/newsletters/money-107.png +0 -0
  418. package/public/assets/newsletters/moneymentor-150.png +0 -0
  419. package/public/assets/newsletters/placeholder.png +0 -0
  420. package/public/assets/newsletters/politics-119.png +0 -0
  421. package/public/assets/newsletters/property-113.png +0 -0
  422. package/public/assets/newsletters/puzzles-125.png +0 -0
  423. package/public/assets/newsletters/scotland-134.png +0 -0
  424. package/public/assets/newsletters/theatre-127.png +0 -0
  425. package/public/assets/newsletters/travel-149.png +0 -0
  426. package/public/assets/newsletters/tv-133.png +0 -0
  427. package/public/assets/newsletters/us-153.png +0 -0
  428. package/public/assets/no-subscription.svg +15 -0
  429. package/public/assets/pending-activation.svg +16 -0
  430. package/public/assets/personal-details-header.svg +91 -0
  431. package/public/assets/plchldr150x100.png +0 -0
  432. package/public/assets/previous-subscription.svg +15 -0
  433. package/public/assets/primary-navigation-logo-white.svg +6 -0
  434. package/public/assets/primary-navigation-logo.svg +6 -0
  435. package/public/assets/tls-logo-white.svg +3 -0
  436. package/public/favicon.ico +0 -0
  437. package/public/icon.png +0 -0
  438. package/public/prebid.min.js +1 -0
  439. package/queries/getPage.ts +100 -0
  440. package/queries/getRadioPost.ts +61 -0
  441. package/queries/getRadioPosts.ts +16 -0
  442. package/queries/getUserSubscription.ts +9 -0
  443. package/queries/index.ts +3 -0
  444. package/scripts/k8s-local.sh +137 -0
  445. package/scripts/nr-exports.sh +7 -0
  446. package/temp/_app.tsx +15 -0
  447. package/temp/_document.tsx +61 -0
  448. package/temp/app-context-test.tsx +51 -0
  449. package/temp/app-context.tsx +25 -0
  450. package/temp/config-index.ts +1 -0
  451. package/temp/context-index.tsx +1 -0
  452. package/temp/header.tsx +45 -0
  453. package/temp/next.config.js +56 -0
  454. package/tsconfig.json +51 -0
  455. package/tsconfig.test.json +6 -0
  456. 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,5 @@
1
+ // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
+ // allows you to do things like:
3
+ // expect(element).toHaveTextContent(/react/i)
4
+ // learn more: https://github.com/testing-library/jest-dom
5
+ import '@testing-library/jest-dom'
@@ -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
+ }