From 8a8c4634521355755201b0bbcde8b79fb68f2310 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Mon, 19 Feb 2024 14:24:30 +0100 Subject: [PATCH] chore: run prettier --write . --- app/[lang]/(preview)/layout.tsx | 20 +- .../Current/Aside/Contacts/contact.module.css | 1 - .../Current/Aside/Puffs/Puff/puff.module.css | 8 +- .../Aside/Puffs/Puff/renderOptions.tsx | 7 +- components/Current/Aside/Puffs/index.tsx | 2 +- components/Current/Aside/aside.module.css | 4 +- .../Current/Blocks/List/list.module.css | 70 +++---- components/Current/Blocks/Puffs.tsx | 6 +- components/Current/Blocks/Text.tsx | 2 +- components/Current/Blocks/blocks.module.css | 11 +- .../ContentPage/contentPage.module.css | 14 +- components/Current/Header/Da.tsx | 16 +- components/Current/Header/De.tsx | 165 +++++++++++++---- components/Current/Header/En.tsx | 19 +- components/Current/Header/Fi.tsx | 19 +- .../Header/LanguageSwitcher/Desktop.tsx | 4 +- .../Header/LanguageSwitcher/Mobile.tsx | 20 +- components/Current/Header/No.tsx | 158 +++++++++++++--- components/Current/Header/Sv.tsx | 16 +- components/Current/Header/index.tsx | 32 ++-- components/Current/LangPopup/index.tsx | 54 +++--- components/Current/LivePreview/index.tsx | 12 +- .../Current/LoadingSpinner/loading.module.css | 125 +++++++------ .../Breadcrumbs/breadcrumbs.module.css | 7 +- .../Current/Preamble/Breadcrumbs/index.tsx | 6 +- components/Current/Preamble/index.tsx | 14 +- .../Current/Preamble/preamble.module.css | 17 +- components/Current/Preamble/renderOptions.tsx | 7 +- components/Current/Section/index.tsx | 4 +- components/Current/Section/section.module.css | 3 +- components/Current/SubnavMobile.tsx | 8 +- components/Image/index.tsx | 7 +- components/JsonToHtml/index.tsx | 6 +- components/JsonToHtml/jsontohtml.module.css | 2 +- components/JsonToHtml/renderOptions.tsx | 174 +++++++++++++++--- components/JsonToHtml/utils.tsx | 20 +- components/SkipToMainContent/index.tsx | 26 +-- constants/locales.ts | 4 +- env/client.ts | 2 +- env/server.ts | 4 +- lib/graphql/Fragments/Aside/Contact.graphql | 2 +- lib/graphql/Fragments/Aside/Puff.graphql | 2 +- lib/graphql/Fragments/Blocks/Puff.graphql | 2 +- lib/graphql/Fragments/Contact.graphql | 2 +- lib/graphql/Fragments/Puff.graphql | 2 +- lib/previewRequest.ts | 16 +- lib/request.ts | 5 +- middleware.ts | 8 +- mockCms/de/scandic-entdecken/wlan/data.json | 2 +- mockCms/de/sponsoring/data.json | 2 +- mockCms/en/sponsoring/data.json | 2 +- .../tietoja-internetsivuista/data.json | 2 +- .../bruk-av-nettsiden/data.json | 2 +- mockCms/no/vi-sponser/data.json | 2 +- .../om-scandics-webbplats/data.json | 2 +- next.config.js | 18 +- package.json | 2 +- tsconfig.json | 23 +-- types/components/current/header.ts | 4 +- types/components/current/hero.ts | 2 +- types/components/jsontohtml.ts | 6 +- types/graphql.d.ts | 2 +- types/lang.ts | 4 +- types/params.ts | 22 +-- types/request.ts | 2 +- types/requests/blocks/list.ts | 1 - types/requests/puff.ts | 2 +- types/requests/utils/all.ts | 2 +- types/rte/attrs.ts | 14 +- types/rte/enums.ts | 10 +- types/rte/node.ts | 27 ++- 71 files changed, 846 insertions(+), 444 deletions(-) diff --git a/app/[lang]/(preview)/layout.tsx b/app/[lang]/(preview)/layout.tsx index 13c2a638f..e7d4ad7bd 100644 --- a/app/[lang]/(preview)/layout.tsx +++ b/app/[lang]/(preview)/layout.tsx @@ -1,19 +1,19 @@ -import "../../core.css"; -import "../../scandic.css"; +import "../../core.css" +import "../../scandic.css" -import Footer from "@/components/Current/Footer"; -import LangPopup from "@/components/Current/LangPopup"; -import Script from "next/script"; -import SkipToMainContent from "@/components/SkipToMainContent"; +import Footer from "@/components/Current/Footer" +import LangPopup from "@/components/Current/LangPopup" +import Script from "next/script" +import SkipToMainContent from "@/components/SkipToMainContent" -import type { Metadata } from "next"; -import type { LangParams, LayoutArgs } from "@/types/params"; -import InitLivePreview from "@/components/Current/LivePreview"; +import type { Metadata } from "next" +import type { LangParams, LayoutArgs } from "@/types/params" +import InitLivePreview from "@/components/Current/LivePreview" export const metadata: Metadata = { description: "New web", title: "Scandic Hotels New Web", -}; +} export default function RootLayout({ children, diff --git a/components/Current/Aside/Contacts/contact.module.css b/components/Current/Aside/Contacts/contact.module.css index 12019ed03..d308c3341 100644 --- a/components/Current/Aside/Contacts/contact.module.css +++ b/components/Current/Aside/Contacts/contact.module.css @@ -1,4 +1,3 @@ - .highlightBlock { padding: 10px 10px 15px; background: #fff; diff --git a/components/Current/Aside/Puffs/Puff/puff.module.css b/components/Current/Aside/Puffs/Puff/puff.module.css index 24d75861d..7cad16293 100644 --- a/components/Current/Aside/Puffs/Puff/puff.module.css +++ b/components/Current/Aside/Puffs/Puff/puff.module.css @@ -43,13 +43,13 @@ } @media screen and (min-width: 740px) { - .content { - padding: 20px 0px; - } + .content { + padding: 20px 0px; + } } @media screen and (min-width: 950px) { .heading { font-size: 1.375rem; } -} \ No newline at end of file +} diff --git a/components/Current/Aside/Puffs/Puff/renderOptions.tsx b/components/Current/Aside/Puffs/Puff/renderOptions.tsx index 488a17eac..06d0383d6 100644 --- a/components/Current/Aside/Puffs/Puff/renderOptions.tsx +++ b/components/Current/Aside/Puffs/Puff/renderOptions.tsx @@ -7,7 +7,12 @@ import type { RTENext, RTEDefaultNode } from "@/types/rte/node" import type { RenderOptions } from "@/types/rte/option" export const renderOptions: RenderOptions = { - [RTETypeEnum.p]: (node: RTEDefaultNode, embeds: EmbedByUid, next: RTENext, fullRenderOptions: RenderOptions) => { + [RTETypeEnum.p]: ( + node: RTEDefaultNode, + embeds: EmbedByUid, + next: RTENext, + fullRenderOptions: RenderOptions + ) => { return (

{next(node.children, embeds, fullRenderOptions)} diff --git a/components/Current/Aside/Puffs/index.tsx b/components/Current/Aside/Puffs/index.tsx index a071c3062..457e327d4 100644 --- a/components/Current/Aside/Puffs/index.tsx +++ b/components/Current/Aside/Puffs/index.tsx @@ -8,7 +8,7 @@ export default function Puffs({ puffs }: PuffsProps) { } return ( <> - {puffs.map(puff => ( + {puffs.map((puff) => ( ))} diff --git a/components/Current/Aside/aside.module.css b/components/Current/Aside/aside.module.css index e488a822a..84d1faf68 100644 --- a/components/Current/Aside/aside.module.css +++ b/components/Current/Aside/aside.module.css @@ -1,3 +1,3 @@ .wrapper { - padding: 20px 10px 5px; -} \ No newline at end of file + padding: 20px 10px 5px; +} diff --git a/components/Current/Blocks/List/list.module.css b/components/Current/Blocks/List/list.module.css index 535cde85b..924bae6dd 100644 --- a/components/Current/Blocks/List/list.module.css +++ b/components/Current/Blocks/List/list.module.css @@ -1,65 +1,67 @@ .title { - font-family: BrandonText-Bold,Arial,Helvetica,sans-serif; - font-size: 1.375rem; - line-height: 1.1em; - text-transform: uppercase; - font-weight: 400; - color: #483729; - margin-bottom: 1rem; + font-family: BrandonText-Bold, Arial, Helvetica, sans-serif; + font-size: 1.375rem; + line-height: 1.1em; + text-transform: uppercase; + font-weight: 400; + color: #483729; + margin-bottom: 1rem; } .ul { - margin-bottom: 15px; + margin-bottom: 15px; } .listItem { - margin-bottom: 8px; - padding-left: 1.3em; + margin-bottom: 8px; + padding-left: 1.3em; } .checkmark { - padding-left: 1.6em; + padding-left: 1.6em; } -.checkmark::before, .disc::before { - position:relative; - top: 4px; - display: inline-block; - height: 0px; - width: 0px; +.checkmark::before, +.disc::before { + position: relative; + top: 4px; + display: inline-block; + height: 0px; + width: 0px; } .checkmark::before { - content: url('/Static/img/bullet-list-tick-birch-v2.svg'); - transform: scale(.9); - left: -1.2em; + content: url("/Static/img/bullet-list-tick-birch-v2.svg"); + transform: scale(0.9); + left: -1.2em; } .disc::before { - content: "•"; - color: rgb(157, 160, 161); - font-size: 26px; - left: -0.7em; + content: "•"; + color: rgb(157, 160, 161); + font-size: 26px; + left: -0.7em; } .link { - border-bottom: 1px dotted #00838e; - color: #00838e; - text-decoration: none; - background-color: transparent; + border-bottom: 1px dotted #00838e; + color: #00838e; + text-decoration: none; + background-color: transparent; } -.link:active, .link:hover { - text-decoration: underline; - outline: 0; +.link:active, +.link:hover { + text-decoration: underline; + outline: 0; } .link:hover { - border-bottom: none; + border-bottom: none; } @media screen and (min-width: 950px) { -.title { + .title { font-size: 1.625rem; } -} \ No newline at end of file +} diff --git a/components/Current/Blocks/Puffs.tsx b/components/Current/Blocks/Puffs.tsx index 9aa70355c..023934264 100644 --- a/components/Current/Blocks/Puffs.tsx +++ b/components/Current/Blocks/Puffs.tsx @@ -1,7 +1,3 @@ export default function Puffs() { - return ( - <> - - - ) + return <> } diff --git a/components/Current/Blocks/Text.tsx b/components/Current/Blocks/Text.tsx index 58d9e3658..d79bf1518 100644 --- a/components/Current/Blocks/Text.tsx +++ b/components/Current/Blocks/Text.tsx @@ -1,4 +1,4 @@ -import JsonToHtml from "@/components/JsonToHtml"; +import JsonToHtml from "@/components/JsonToHtml" import type { TextProps } from "@/types/components/current/blocks/text" diff --git a/components/Current/Blocks/blocks.module.css b/components/Current/Blocks/blocks.module.css index aa48c8f2b..805b13aff 100644 --- a/components/Current/Blocks/blocks.module.css +++ b/components/Current/Blocks/blocks.module.css @@ -1,11 +1,10 @@ .wrapper { - background-color: #fff; - padding: 20px 10px 5px; + background-color: #fff; + padding: 20px 10px 5px; } @media screen and (min-width: 740px) { - .wrapper { - padding:20px 0 0; - } + .wrapper { + padding: 20px 0 0; } - +} diff --git a/components/Current/ContentPage/contentPage.module.css b/components/Current/ContentPage/contentPage.module.css index d64392b8e..129d1aeba 100644 --- a/components/Current/ContentPage/contentPage.module.css +++ b/components/Current/ContentPage/contentPage.module.css @@ -1,8 +1,8 @@ .wrapper { - width: 100%; - position: relative; - z-index: 10; - padding-bottom: 50px; - background: #f3f2f1; - display: block; -} \ No newline at end of file + width: 100%; + position: relative; + z-index: 10; + padding-bottom: 50px; + background: #f3f2f1; + display: block; +} diff --git a/components/Current/Header/Da.tsx b/components/Current/Header/Da.tsx index 0f8a85957..4bf8164ea 100644 --- a/components/Current/Header/Da.tsx +++ b/components/Current/Header/Da.tsx @@ -1,5 +1,9 @@ /* eslint-disable @next/next/no-img-element */ -import { currentAboutLinks, currentSponsoringLinks, currentWifiLinks } from "@/constants/current/links" +import { + currentAboutLinks, + currentSponsoringLinks, + currentWifiLinks, +} from "@/constants/current/links" import Desktop from "./LanguageSwitcher/Desktop" import Mobile from "./LanguageSwitcher/Mobile" @@ -40,7 +44,9 @@ export default function DaHeader({ pathname }: HeaderProps) {

@@ -186,5 +194,5 @@ export default function DaHeader({ pathname }: HeaderProps) { - ); + ) } diff --git a/components/Current/Header/De.tsx b/components/Current/Header/De.tsx index 85127de62..b8d3fb5a9 100644 --- a/components/Current/Header/De.tsx +++ b/components/Current/Header/De.tsx @@ -1,4 +1,8 @@ -import { currentAboutLinks, currentSponsoringLinks, currentWifiLinks } from "@/constants/current/links" +import { + currentAboutLinks, + currentSponsoringLinks, + currentWifiLinks, +} from "@/constants/current/links" import Desktop from "./LanguageSwitcher/Desktop" import Mobile from "./LanguageSwitcher/Mobile" @@ -7,7 +11,8 @@ import type { HeaderProps } from "@/types/components/current/header" import type { LanguageSwitcherLink } from "@/types/components/current/languageSwitcher" const paths: Record = { - "/kundenbetreuung/haufig-gestellte-fragen/nutzung-der-internetseite": currentAboutLinks, + "/kundenbetreuung/haufig-gestellte-fragen/nutzung-der-internetseite": + currentAboutLinks, "/scandic-entdecken/wlan": currentWifiLinks, "/sponsoring": currentSponsoringLinks, } @@ -21,80 +26,178 @@ export default function DeHeader({ pathname }: HeaderProps) {
Sie sind offline. Manche Inhalte könnten nicht aktuell sein. - +
-
+
-
+
- - -
- ); + ) } diff --git a/components/Current/Header/Fi.tsx b/components/Current/Header/Fi.tsx index fe045942f..87ec99599 100644 --- a/components/Current/Header/Fi.tsx +++ b/components/Current/Header/Fi.tsx @@ -1,5 +1,9 @@ /* eslint-disable @next/next/no-img-element */ -import { currentAboutLinks, currentSponsoringLinks, currentWifiLinks } from "@/constants/current/links" +import { + currentAboutLinks, + currentSponsoringLinks, + currentWifiLinks, +} from "@/constants/current/links" import Desktop from "./LanguageSwitcher/Desktop" import Mobile from "./LanguageSwitcher/Mobile" @@ -8,7 +12,8 @@ import type { LanguageSwitcherLink } from "@/types/components/current/languageSw import type { HeaderProps } from "@/types/components/current/header" const paths: Record = { - "/asiakaspalvelu/usein-kysytyt-kysymykset/tietoja-internetsivuista": currentAboutLinks, + "/asiakaspalvelu/usein-kysytyt-kysymykset/tietoja-internetsivuista": + currentAboutLinks, "/koe-scandic/maksuton-internetyhteys": currentSponsoringLinks, "/scandic-entdecken/wlan": currentWifiLinks, } @@ -40,7 +45,9 @@ export default function FiHeader({ pathname }: HeaderProps) { @@ -185,5 +194,5 @@ export default function FiHeader({ pathname }: HeaderProps) { - ); + ) } diff --git a/components/Current/Header/LanguageSwitcher/Desktop.tsx b/components/Current/Header/LanguageSwitcher/Desktop.tsx index 1635dffe1..dbdd288a7 100644 --- a/components/Current/Header/LanguageSwitcher/Desktop.tsx +++ b/components/Current/Header/LanguageSwitcher/Desktop.tsx @@ -1,4 +1,4 @@ -import type { LanguageSwitcherProps } from "@/types/components/current/languageSwitcher"; +import type { LanguageSwitcherProps } from "@/types/components/current/languageSwitcher" export default function Desktop({ currentLanguage, @@ -33,5 +33,5 @@ export default function Desktop({ ))} - ); + ) } diff --git a/components/Current/Header/LanguageSwitcher/Mobile.tsx b/components/Current/Header/LanguageSwitcher/Mobile.tsx index 1a3135a8b..7344b1d76 100644 --- a/components/Current/Header/LanguageSwitcher/Mobile.tsx +++ b/components/Current/Header/LanguageSwitcher/Mobile.tsx @@ -1,15 +1,25 @@ import type { LanguageSwitcherProps } from "@/types/components/current/languageSwitcher" -export default function Mobile({ currentLanguage, links }: LanguageSwitcherProps) { +export default function Mobile({ + currentLanguage, + links, +}: LanguageSwitcherProps) { return (
-
- ); + ) } diff --git a/components/Current/LivePreview/index.tsx b/components/Current/LivePreview/index.tsx index 19d35eb39..68ae23535 100644 --- a/components/Current/LivePreview/index.tsx +++ b/components/Current/LivePreview/index.tsx @@ -1,14 +1,14 @@ -"use client"; +"use client" import { useEffect } from "react" import ContentstackLivePreview from "@contentstack/live-preview-utils" export default function InitLivePreview() { useEffect(() => { - if (!ContentstackLivePreview.livePreview) { - ContentstackLivePreview.init() - } - }, []); + if (!ContentstackLivePreview.livePreview) { + ContentstackLivePreview.init() + } + }, []) - return null; + return null } diff --git a/components/Current/LoadingSpinner/loading.module.css b/components/Current/LoadingSpinner/loading.module.css index 50e63067c..aa7878933 100644 --- a/components/Current/LoadingSpinner/loading.module.css +++ b/components/Current/LoadingSpinner/loading.module.css @@ -1,31 +1,31 @@ .container { - display: flex; - justify-content: center; - align-items: center; - height: 200px; + display: flex; + justify-content: center; + align-items: center; + height: 200px; } .spinner { display: inline-block; position: relative; - width: 80px; - height: 80px; + width: 80px; + height: 80px; } .spinner div { - transform-origin: 40px 40px; - animation: spinnerAnimation 1.2s linear infinite; + transform-origin: 40px 40px; + animation: spinnerAnimation 1.2s linear infinite; } .spinner div::after { content: " "; display: block; position: absolute; - top: 3px; - left: 37px; - width: 6px; - height: 18px; - border-radius: 20%; + top: 3px; + left: 37px; + width: 6px; + height: 18px; + border-radius: 20%; background: red; } @@ -34,57 +34,56 @@ animation-delay: -1.1s; } - .spinner div:nth-child(2) { - transform: rotate(30deg); - animation-delay: -1s; - } - .spinner div:nth-child(3) { - transform: rotate(60deg); - animation-delay: -0.9s; - } - .spinner div:nth-child(4) { - transform: rotate(90deg); - animation-delay: -0.8s; - } - .spinner div:nth-child(5) { - transform: rotate(120deg); - animation-delay: -0.7s; - } - .spinner div:nth-child(6) { - transform: rotate(150deg); - animation-delay: -0.6s; - } - .spinner div:nth-child(7) { - transform: rotate(180deg); - animation-delay: -0.5s; - } - .spinner div:nth-child(8) { - transform: rotate(210deg); - animation-delay: -0.4s; - } - .spinner div:nth-child(9) { - transform: rotate(240deg); - animation-delay: -0.3s; - } - .spinner div:nth-child(10) { - transform: rotate(270deg); - animation-delay: -0.2s; - } - .spinner div:nth-child(11) { - transform: rotate(300deg); - animation-delay: -0.1s; - } - .spinner div:nth-child(12) { - transform: rotate(330deg); - animation-delay: 0s; - } - +.spinner div:nth-child(2) { + transform: rotate(30deg); + animation-delay: -1s; +} +.spinner div:nth-child(3) { + transform: rotate(60deg); + animation-delay: -0.9s; +} +.spinner div:nth-child(4) { + transform: rotate(90deg); + animation-delay: -0.8s; +} +.spinner div:nth-child(5) { + transform: rotate(120deg); + animation-delay: -0.7s; +} +.spinner div:nth-child(6) { + transform: rotate(150deg); + animation-delay: -0.6s; +} +.spinner div:nth-child(7) { + transform: rotate(180deg); + animation-delay: -0.5s; +} +.spinner div:nth-child(8) { + transform: rotate(210deg); + animation-delay: -0.4s; +} +.spinner div:nth-child(9) { + transform: rotate(240deg); + animation-delay: -0.3s; +} +.spinner div:nth-child(10) { + transform: rotate(270deg); + animation-delay: -0.2s; +} +.spinner div:nth-child(11) { + transform: rotate(300deg); + animation-delay: -0.1s; +} +.spinner div:nth-child(12) { + transform: rotate(330deg); + animation-delay: 0s; +} @keyframes spinnerAnimation { 0% { - opacity: 1; - } + opacity: 1; + } 100% { - opacity: 0; - } -} \ No newline at end of file + opacity: 0; + } +} diff --git a/components/Current/Preamble/Breadcrumbs/breadcrumbs.module.css b/components/Current/Preamble/Breadcrumbs/breadcrumbs.module.css index efac4ac61..30a0b1b3a 100644 --- a/components/Current/Preamble/Breadcrumbs/breadcrumbs.module.css +++ b/components/Current/Preamble/Breadcrumbs/breadcrumbs.module.css @@ -26,7 +26,7 @@ .currentPage, .li { - font-size: .875rem; + font-size: 0.875rem; line-height: 1.4em; } @@ -36,9 +36,8 @@ margin-right: 4px; } - -@media (min-width: 740px){ +@media (min-width: 740px) { .nav { display: block; } -} \ No newline at end of file +} diff --git a/components/Current/Preamble/Breadcrumbs/index.tsx b/components/Current/Preamble/Breadcrumbs/index.tsx index 5014645a0..631482046 100644 --- a/components/Current/Preamble/Breadcrumbs/index.tsx +++ b/components/Current/Preamble/Breadcrumbs/index.tsx @@ -4,7 +4,11 @@ import styles from "./breadcrumbs.module.css" import type { BreadcrumbsProps } from "@/types/components/current/breadcrumbs" -export default function Breadcrumbs({ breadcrumbs, parent, title }: BreadcrumbsProps) { +export default function Breadcrumbs({ + breadcrumbs, + parent, + title, +}: BreadcrumbsProps) { return (