From 7c4b8401e9128c050758369697d86be105aca21f Mon Sep 17 00:00:00 2001 From: Simon Emanuelsson Date: Fri, 7 Jun 2024 10:36:23 +0200 Subject: [PATCH] feat(WEB-304): remaning UI from design system primitives --- .../my-pages/[...path]/page.module.css | 2 +- .../(protected)/my-pages/layout.module.css | 12 +- .../[uid]/@breadcrumbs/[...paths]/page.tsx | 1 + .../[contentType]/[uid]/@breadcrumbs/page.tsx | 5 + .../[contentType]/[uid]/layout.module.css | 5 +- .../(public)/[contentType]/[uid]/layout.tsx | 12 +- .../(public)/[contentType]/[uid]/page.tsx | 2 +- .../@languageSwitcher/[...paths]/page.tsx | 14 + .../[...uri]/page.module.css | 17 - .../@languageSwitcher/[...uri]/page.tsx | 25 -- .../(live)/@languageSwitcher/default.tsx | 2 +- app/[lang]/(live)/error.module.css | 4 +- .../current-content-page/page.tsx | 15 +- .../@languageSwitcher/default.tsx | 3 + .../@languageSwitcher/page.module.css | 17 - .../(live-current)/@languageSwitcher/page.tsx | 30 -- app/api/web/revalidate/route.ts | 2 +- app/globals.css | 5 +- components/ContentType/LoyaltyPage.tsx | 25 +- .../ContentType/Webviews/LoyaltyPage.tsx | 2 +- components/ContentType/loyaltyPage.module.css | 34 +- components/Current/Footer/index.tsx | 2 +- .../Desktop/desktop.module.css | 11 + .../Header/LanguageSwitcher/Desktop/index.tsx | 76 ++--- .../Header/LanguageSwitcher/Mobile/index.tsx | 54 +-- .../LanguageSwitcher/Mobile/mobile.module.css | 12 +- components/Current/Header/index.tsx | 2 +- components/Current/LangPopup/index.tsx | 2 +- components/Icons/AccountCircle.tsx | 27 ++ components/Icons/ArrowRight.tsx | 36 ++ components/Icons/Calendar.tsx | 42 ++- components/Icons/Check.tsx | 36 ++ components/Icons/CheckCircle.tsx | 41 ++- components/Icons/ChevronDown.tsx | 41 ++- components/Icons/ChevronRight.tsx | 43 +++ components/Icons/Email.tsx | 38 ++- components/Icons/House.tsx | 43 ++- components/Icons/Phone.tsx | 38 ++- components/Icons/icon.module.css | 29 ++ components/Icons/index.tsx | 5 + components/Icons/variants.ts | 21 ++ components/{Image/index.tsx => Image.tsx} | 0 components/JsonToHtml/jsontohtml.module.css | 2 +- components/Levels/Level/BestFriend.tsx | 291 ++++++++-------- components/Levels/Level/CloseFriend.tsx | 311 +++++++++--------- components/Levels/Level/DearFriend.tsx | 283 ++++++++-------- components/Levels/Level/GoodFriend.tsx | 303 ++++++++--------- components/Levels/Level/LoyalFriend.tsx | 287 ++++++++-------- components/Levels/Level/NewFriend.tsx | 267 +++++++-------- components/Levels/Level/TrueFriend.tsx | 275 ++++++++-------- components/Levels/levels.module.css | 5 + components/Levels/variants.ts | 1 + .../Blocks/CardsGrid/cardsGrid.module.css | 2 +- components/Loyalty/Blocks/CardsGrid/index.tsx | 6 +- .../HowItWorks/howItWorks.module.css | 12 +- .../DynamicContent/LoyaltyLevels/index.tsx | 68 +++- .../LoyaltyLevels/loyaltyLevels.module.css | 77 ++--- .../BenefitCard/benefitCard.module.css | 2 +- .../LevelSummary/levelSummary.module.css | 6 +- .../DynamicContent/dynamicContent.module.css | 30 +- .../Loyalty/Blocks/DynamicContent/index.tsx | 26 +- components/Loyalty/Blocks/WebView/index.tsx | 11 +- components/Loyalty/Blocks/index.tsx | 11 +- .../Contact/ContactRow/contactRow.module.css | 24 +- .../JoinLoyalty/Contact/ContactRow/index.tsx | 22 +- .../JoinLoyalty/Contact/contact.module.css | 13 +- .../Sidebar/JoinLoyalty/Contact/index.tsx | 12 +- .../Loyalty/Sidebar/JoinLoyalty/index.tsx | 45 +-- .../JoinLoyalty/joinLoyalty.module.css | 53 +-- components/Loyalty/Sidebar/index.tsx | 11 +- components/Loyalty/Sidebar/sidebar.module.css | 8 +- components/MaxWidth/maxWidth.module.css | 2 +- .../Benefits/CurrentLevel/current.module.css | 46 +-- .../Blocks/Benefits/CurrentLevel/index.tsx | 51 ++- .../Blocks/Benefits/NextLevel/index.tsx | 50 +-- .../Blocks/Benefits/NextLevel/next.module.css | 97 +----- .../Blocks/Challenges/challenges.module.css | 2 + components/MyPages/Blocks/Header/index.tsx | 6 +- .../Blocks/Overview/Buttons/btn.module.css | 5 - .../Blocks/Overview/Stats/Label/index.tsx | 5 - .../Overview/Stats/Label/label.module.css | 9 - .../Blocks/Overview/Stats/NextLevel/index.tsx | 5 +- .../Blocks/Overview/Stats/Points/index.tsx | 13 +- .../Blocks/Overview/overview.module.css | 2 +- components/MyPages/Blocks/Shortcuts/index.tsx | 19 +- .../Blocks/Shortcuts/shortcuts.module.css | 35 +- .../Stays/Container/container.module.css | 4 +- .../Stays/ListContainer/container.module.css | 2 +- .../emptyPreviousStays.module.css | 4 +- .../MyPages/Blocks/Stays/Previous/index.tsx | 6 +- .../emptyUpcomingStays.module.css | 32 +- .../Soonest/EmptyUpcomingStays/index.tsx | 4 +- .../MyPages/Blocks/Stays/Soonest/index.tsx | 6 +- .../Blocks/Stays/Soonest/soonest.module.css | 2 +- .../MyPages/Blocks/Stays/StayCard/index.tsx | 6 +- .../Blocks/Stays/StayCard/stay.module.css | 38 +-- .../emptyUpcomingStays.module.css | 32 +- .../Upcoming/EmptyUpcomingStays/index.tsx | 4 +- .../MyPages/Blocks/Stays/Upcoming/index.tsx | 6 +- components/MyPages/Breadcrumbs/Breadcrumb.tsx | 9 - .../Breadcrumbs/BreadcrumbWithLink.tsx | 17 - .../Breadcrumbs/breadcrumbs.module.css | 20 +- components/MyPages/Breadcrumbs/index.tsx | 39 ++- components/MyPages/Sidebar/index.tsx | 61 ++-- components/MyPages/Sidebar/sidebar.module.css | 18 +- components/MyProfile/Card/card.module.css | 10 +- components/MyProfile/Field/field.module.css | 47 --- components/MyProfile/Field/index.tsx | 26 -- components/MyProfile/Profile/Container.tsx | 9 +- .../MyProfile/Profile/Edit/Form/Content.tsx | 137 +------- .../Profile/Edit/Form/form.module.css | 2 +- components/MyProfile/Profile/index.tsx | 74 +---- .../MyProfile/Profile/profile.module.css | 10 +- .../index.tsx => SkipToMainContent.tsx} | 0 .../TempDesignSystem/Button/button.module.css | 57 ++-- components/TempDesignSystem/Button/index.tsx | 2 +- .../TempDesignSystem/Button/variants.ts | 20 +- .../TempDesignSystem/Card/card.module.css | 52 ++- .../CardGrid/cardGrid.module.css | 58 ---- .../TempDesignSystem/CardGrid/cardGrid.ts | 7 - .../TempDesignSystem/CardGrid/index.tsx | 23 -- .../TempDesignSystem/CardGrid/variants.ts | 19 -- .../TempDesignSystem/Chip/chip.module.css | 14 + components/TempDesignSystem/Chip/chip.ts | 7 + components/TempDesignSystem/Chip/index.tsx | 23 ++ components/TempDesignSystem/Chip/variants.ts | 18 + .../Divider/divider.module.css | 11 +- .../TempDesignSystem/Divider/divider.ts | 2 +- components/TempDesignSystem/Divider/index.tsx | 5 +- .../TempDesignSystem/Divider/variants.ts | 5 + .../Form/Country/country.module.css | 40 +-- .../Form/Date/date.module.css | 1 + .../Form/ErrorMessage/error.module.css | 10 +- .../Form/Input/input.module.css | 20 +- .../Form/Phone/phone.module.css | 21 +- .../Form/Select/select.module.css | 31 +- .../{Grid => Grids/Dynamic}/Item/index.tsx | 0 .../Dynamic}/Item/item.module.css | 0 .../{Grid => Grids/Dynamic}/Item/item.ts | 0 .../{Grid => Grids/Dynamic}/Item/variants.ts | 0 .../Dynamic/dynamic.module.css} | 0 .../grid.ts => Grids/Dynamic/dynamic.ts} | 0 .../{Grid => Grids/Dynamic}/index.tsx | 4 +- .../Grids/Scrollable/index.tsx | 5 + .../Scrollable/scrollableGrid.module.css | 38 +++ .../Grids/Stackable/index.tsx | 5 + .../Grids/Stackable/stackable.module.css | 42 +++ components/TempDesignSystem/Grids/index.tsx | 11 + components/TempDesignSystem/Link/index.tsx | 2 + .../TempDesignSystem/Link/link.module.css | 101 ++++-- components/TempDesignSystem/Link/link.ts | 2 +- components/TempDesignSystem/Link/variants.ts | 23 +- .../ProgressBar/progressbar.module.css | 12 +- .../Text/BiroScript/biroScript.module.css | 13 + .../Text/BiroScript/biroScript.ts | 4 +- .../Text/BiroScript/index.tsx | 10 +- .../Text/BiroScript/variants.ts | 5 + .../Text/Body/body.module.css | 8 + components/TempDesignSystem/Text/Body/body.ts | 4 +- .../TempDesignSystem/Text/Body/index.tsx | 10 +- .../TempDesignSystem/Text/Body/variants.ts | 5 + .../TempDesignSystem/Text/Caption/caption.ts | 4 +- .../TempDesignSystem/Text/Caption/index.tsx | 8 +- .../Text/Footnote/footnote.module.css | 10 +- .../Text/Footnote/footnote.ts | 6 +- .../TempDesignSystem/Text/Footnote/index.tsx | 10 +- .../Text/Footnote/variants.ts | 5 +- .../TempDesignSystem/Text/Subtitle/index.tsx | 12 +- .../Text/Subtitle/subtitle.module.css | 12 +- .../Text/Subtitle/subtitle.ts | 1 + .../Text/Subtitle/variants.ts | 5 + .../TempDesignSystem/Text/Title/index.tsx | 2 + .../Text/Title/title.module.css | 8 + .../TempDesignSystem/Text/Title/variants.ts | 5 + .../LinkToOverview/linkToOverview.module.css | 8 +- i18n/dictionaries/da.json | 2 + i18n/dictionaries/de.json | 2 + i18n/dictionaries/en.json | 4 +- i18n/dictionaries/fi.json | 2 + i18n/dictionaries/no.json | 2 + i18n/dictionaries/sv.json | 2 + lib/graphql/Query/NavigationMyPages.graphql | 76 +---- middlewares/currentWebLogout.ts | 2 +- public/_static/BestFriend.svg | 39 +++ public/_static/CloseFriend.svg | 41 +++ public/_static/DearFriend.svg | 38 +++ public/_static/GoodFriend.svg | 40 +++ public/_static/LoyalFriend.svg | 38 +++ public/_static/NewFriend.svg | 36 ++ public/_static/TrueFriend.svg | 37 +++ public/_static/icons/arrow_right.svg | 8 + public/_static/icons/check.svg | 9 +- public/_static/icons/check_circle.svg | 10 +- public/_static/icons/chevron_right.svg | 10 + public/_static/icons/home.svg | 10 +- server/index.ts | 2 - .../contentstack/accountPage/output.ts | 21 -- .../routers/contentstack/accountPage/query.ts | 4 +- server/routers/contentstack/base/index.ts | 5 + .../contentstack/{config => base}/output.ts | 9 - server/routers/contentstack/base/query.ts | 123 +++++++ .../contentstack/breadcrumbs/output.ts | 16 + .../routers/contentstack/breadcrumbs/query.ts | 14 +- .../routers/contentstack/breadcrumbs/utils.ts | 5 +- server/routers/contentstack/config/index.ts | 5 - server/routers/contentstack/config/query.ts | 258 --------------- server/routers/contentstack/index.ts | 8 +- .../contentstack/languageSwitcher/index.ts | 5 + .../contentstack/languageSwitcher/output.ts | 14 + .../contentstack/languageSwitcher/query.ts | 127 +++++++ .../{config => languageSwitcher}/utils.ts | 0 .../contentstack/loyaltyPage/output.ts | 3 +- .../routers/contentstack/loyaltyPage/query.ts | 128 +++---- .../contentstack/myPages/navigation/output.ts | 166 +++++----- .../contentstack/myPages/navigation/query.ts | 54 +-- .../contentstack/myPages/navigation/utils.ts | 10 +- server/routers/loyalty/index.ts | 5 - server/routers/loyalty/query.ts | 28 -- server/routers/loyalty/temp.ts | 86 ----- server/trpc.ts | 22 +- types/components/current/footer.ts | 2 +- types/components/icon.ts | 11 +- types/components/loyalty/blocks.ts | 1 + types/components/loyalty/sidebar.ts | 8 +- .../myPages/{stays/title.ts => header.ts} | 5 +- types/components/myPages/myPage/shortcuts.ts | 1 + types/requests/myPages/navigation.ts | 82 ----- utils/contactConfig.ts | 2 +- 228 files changed, 3516 insertions(+), 3237 deletions(-) create mode 100644 app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/[...paths]/page.tsx create mode 100644 app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx create mode 100644 app/[lang]/(live)/@languageSwitcher/[...paths]/page.tsx delete mode 100644 app/[lang]/(live)/@languageSwitcher/[...uri]/page.module.css delete mode 100644 app/[lang]/(live)/@languageSwitcher/[...uri]/page.tsx create mode 100644 app/[lang]/(live-current)/@languageSwitcher/default.tsx delete mode 100644 app/[lang]/(live-current)/@languageSwitcher/page.module.css delete mode 100644 app/[lang]/(live-current)/@languageSwitcher/page.tsx create mode 100644 components/Icons/AccountCircle.tsx create mode 100644 components/Icons/ArrowRight.tsx create mode 100644 components/Icons/Check.tsx create mode 100644 components/Icons/ChevronRight.tsx create mode 100644 components/Icons/icon.module.css create mode 100644 components/Icons/variants.ts rename components/{Image/index.tsx => Image.tsx} (100%) delete mode 100644 components/MyPages/Blocks/Overview/Buttons/btn.module.css delete mode 100644 components/MyPages/Blocks/Overview/Stats/Label/index.tsx delete mode 100644 components/MyPages/Blocks/Overview/Stats/Label/label.module.css delete mode 100644 components/MyPages/Breadcrumbs/Breadcrumb.tsx delete mode 100644 components/MyPages/Breadcrumbs/BreadcrumbWithLink.tsx delete mode 100644 components/MyProfile/Field/field.module.css delete mode 100644 components/MyProfile/Field/index.tsx rename components/{SkipToMainContent/index.tsx => SkipToMainContent.tsx} (100%) delete mode 100644 components/TempDesignSystem/CardGrid/cardGrid.module.css delete mode 100644 components/TempDesignSystem/CardGrid/cardGrid.ts delete mode 100644 components/TempDesignSystem/CardGrid/index.tsx delete mode 100644 components/TempDesignSystem/CardGrid/variants.ts create mode 100644 components/TempDesignSystem/Chip/chip.module.css create mode 100644 components/TempDesignSystem/Chip/chip.ts create mode 100644 components/TempDesignSystem/Chip/index.tsx create mode 100644 components/TempDesignSystem/Chip/variants.ts rename components/TempDesignSystem/{Grid => Grids/Dynamic}/Item/index.tsx (100%) rename components/TempDesignSystem/{Grid => Grids/Dynamic}/Item/item.module.css (100%) rename components/TempDesignSystem/{Grid => Grids/Dynamic}/Item/item.ts (100%) rename components/TempDesignSystem/{Grid => Grids/Dynamic}/Item/variants.ts (100%) rename components/TempDesignSystem/{Grid/grid.module.css => Grids/Dynamic/dynamic.module.css} (100%) rename components/TempDesignSystem/{Grid/grid.ts => Grids/Dynamic/dynamic.ts} (100%) rename components/TempDesignSystem/{Grid => Grids/Dynamic}/index.tsx (94%) create mode 100644 components/TempDesignSystem/Grids/Scrollable/index.tsx create mode 100644 components/TempDesignSystem/Grids/Scrollable/scrollableGrid.module.css create mode 100644 components/TempDesignSystem/Grids/Stackable/index.tsx create mode 100644 components/TempDesignSystem/Grids/Stackable/stackable.module.css create mode 100644 components/TempDesignSystem/Grids/index.tsx create mode 100644 public/_static/BestFriend.svg create mode 100644 public/_static/CloseFriend.svg create mode 100644 public/_static/DearFriend.svg create mode 100644 public/_static/GoodFriend.svg create mode 100644 public/_static/LoyalFriend.svg create mode 100644 public/_static/NewFriend.svg create mode 100644 public/_static/TrueFriend.svg create mode 100644 public/_static/icons/arrow_right.svg create mode 100644 public/_static/icons/chevron_right.svg create mode 100644 server/routers/contentstack/base/index.ts rename server/routers/contentstack/{config => base}/output.ts (93%) create mode 100644 server/routers/contentstack/base/query.ts delete mode 100644 server/routers/contentstack/config/index.ts delete mode 100644 server/routers/contentstack/config/query.ts create mode 100644 server/routers/contentstack/languageSwitcher/index.ts create mode 100644 server/routers/contentstack/languageSwitcher/output.ts create mode 100644 server/routers/contentstack/languageSwitcher/query.ts rename server/routers/contentstack/{config => languageSwitcher}/utils.ts (100%) delete mode 100644 server/routers/loyalty/index.ts delete mode 100644 server/routers/loyalty/query.ts delete mode 100644 server/routers/loyalty/temp.ts rename types/components/myPages/{stays/title.ts => header.ts} (67%) delete mode 100644 types/requests/myPages/navigation.ts diff --git a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css index 704726fc9..e8bcab1ba 100644 --- a/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/[...path]/page.module.css @@ -11,4 +11,4 @@ padding-left: var(--Spacing-x0); padding-right: var(--Spacing-x0); } -} +} \ No newline at end of file diff --git a/app/[lang]/(live)/(protected)/my-pages/layout.module.css b/app/[lang]/(live)/(protected)/my-pages/layout.module.css index e94ad3a39..7c1ee448d 100644 --- a/app/[lang]/(live)/(protected)/my-pages/layout.module.css +++ b/app/[lang]/(live)/(protected)/my-pages/layout.module.css @@ -1,7 +1,5 @@ .layout { - --header-height: 4.5rem; - - background-color: var(--Scandic-Brand-Warm-White); + background-color: var(--Scandic-Brand-Pale-Peach); display: grid; font-family: var(--typography-Body-Regular-fontFamily); gap: var(--Spacing-x3); @@ -19,9 +17,9 @@ @media screen and (min-width: 1367px) { .content { - gap: var(--Spacing-x9); - grid-template-columns: 25rem 1fr; - padding-left: var(--Spacing-x3); - padding-right: var(--Spacing-x3); + gap: var(--Spacing-x5); + grid-template-columns: max(360px) 1fr; + padding-left: var(--Spacing-x5); + padding-right: var(--Spacing-x5); } } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/[...paths]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/[...paths]/page.tsx new file mode 100644 index 000000000..03a82e5f5 --- /dev/null +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/[...paths]/page.tsx @@ -0,0 +1 @@ +export { default } from "../page" diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx new file mode 100644 index 000000000..b1237b8cb --- /dev/null +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/@breadcrumbs/page.tsx @@ -0,0 +1,5 @@ +import Breadcrumbs from "@/components/MyPages/Breadcrumbs" + +export default function PageBreadcrumbs() { + return +} diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css index 5343823c1..8effc5412 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.module.css @@ -1,8 +1,7 @@ .layout { - --header-height: 4.5rem; - background-color: var(--Scandic-Brand-Warm-White); display: grid; font-family: var(--typography-Body-Regular-fontFamily); - grid-template-rows: var(--header-height) auto 1fr; + gap: var(--Spacing-x5); + grid-template-rows: auto 1fr; } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx index 0b2690e6c..15fe17b28 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/layout.tsx @@ -8,9 +8,17 @@ import { } from "@/types/params" export default function ContentTypeLayout({ + breadcrumbs, children, }: React.PropsWithChildren< - LayoutArgs + LayoutArgs & { + breadcrumbs: React.ReactNode + } >) { - return
{children}
+ return ( +
+ {breadcrumbs} + {children} +
+ ) } diff --git a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx index 93803a8d9..20d8b784a 100644 --- a/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx +++ b/app/[lang]/(live)/(public)/[contentType]/[uid]/page.tsx @@ -17,7 +17,7 @@ export default async function ContentTypePage({ case "content-page": return case "loyalty-page": - return + return default: const type: never = params.contentType console.error(`Unsupported content type given: ${type}`) diff --git a/app/[lang]/(live)/@languageSwitcher/[...paths]/page.tsx b/app/[lang]/(live)/@languageSwitcher/[...paths]/page.tsx new file mode 100644 index 000000000..9f0deda43 --- /dev/null +++ b/app/[lang]/(live)/@languageSwitcher/[...paths]/page.tsx @@ -0,0 +1,14 @@ +import { serverClient } from "@/lib/trpc/server" + +import Desktop from "@/components/Current/Header/LanguageSwitcher/Desktop" +import Mobile from "@/components/Current/Header/LanguageSwitcher/Mobile" + +export default async function LanguageSwitcher() { + const data = await serverClient().contentstack.languageSwitcher.get() + return ( + <> + + + + ) +} diff --git a/app/[lang]/(live)/@languageSwitcher/[...uri]/page.module.css b/app/[lang]/(live)/@languageSwitcher/[...uri]/page.module.css deleted file mode 100644 index c0e8a497d..000000000 --- a/app/[lang]/(live)/@languageSwitcher/[...uri]/page.module.css +++ /dev/null @@ -1,17 +0,0 @@ -.desktop { - display: none; -} - -.mobile { - display: block; -} - -@media (min-width: 950px) { - .desktop { - display: block; - } - - .mobile { - display: none; - } -} diff --git a/app/[lang]/(live)/@languageSwitcher/[...uri]/page.tsx b/app/[lang]/(live)/@languageSwitcher/[...uri]/page.tsx deleted file mode 100644 index 50f322ad4..000000000 --- a/app/[lang]/(live)/@languageSwitcher/[...uri]/page.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import { serverClient } from "@/lib/trpc/server" - -import Desktop from "@/components/Current/Header/LanguageSwitcher/Desktop" -import Mobile from "@/components/Current/Header/LanguageSwitcher/Mobile" - -import styles from "./page.module.css" - -import { LangParams, PageArgs, UriParams } from "@/types/params" - -export default async function LanguageSwitcher({ - params, -}: PageArgs) { - const { urls } = await serverClient().contentstack.config.languageSwitcher() - - return ( - <> -
- -
-
- -
- - ) -} diff --git a/app/[lang]/(live)/@languageSwitcher/default.tsx b/app/[lang]/(live)/@languageSwitcher/default.tsx index ec32fd52f..e8020af9c 100644 --- a/app/[lang]/(live)/@languageSwitcher/default.tsx +++ b/app/[lang]/(live)/@languageSwitcher/default.tsx @@ -1,3 +1,3 @@ -export default async function LanguageSwitcher() { +export default async function DefaultLanguageSwitcher() { return null } diff --git a/app/[lang]/(live)/error.module.css b/app/[lang]/(live)/error.module.css index ed84d6e82..ee2e64cc5 100644 --- a/app/[lang]/(live)/error.module.css +++ b/app/[lang]/(live)/error.module.css @@ -1,9 +1,7 @@ .layout { - --header-height: 4.5rem; - display: grid; font-family: var(--typography-Body-Regular-fontFamily); - grid-template-rows: var(--header-height) auto 1fr; + grid-template-rows: auto 1fr; min-height: 100dvh; } diff --git a/app/[lang]/(live-current)/@languageSwitcher/current-content-page/page.tsx b/app/[lang]/(live-current)/@languageSwitcher/current-content-page/page.tsx index 03a82e5f5..9f0deda43 100644 --- a/app/[lang]/(live-current)/@languageSwitcher/current-content-page/page.tsx +++ b/app/[lang]/(live-current)/@languageSwitcher/current-content-page/page.tsx @@ -1 +1,14 @@ -export { default } from "../page" +import { serverClient } from "@/lib/trpc/server" + +import Desktop from "@/components/Current/Header/LanguageSwitcher/Desktop" +import Mobile from "@/components/Current/Header/LanguageSwitcher/Mobile" + +export default async function LanguageSwitcher() { + const data = await serverClient().contentstack.languageSwitcher.get() + return ( + <> + + + + ) +} diff --git a/app/[lang]/(live-current)/@languageSwitcher/default.tsx b/app/[lang]/(live-current)/@languageSwitcher/default.tsx new file mode 100644 index 000000000..f41067bc5 --- /dev/null +++ b/app/[lang]/(live-current)/@languageSwitcher/default.tsx @@ -0,0 +1,3 @@ +export default function DefaultLanguageSwitcher() { + return null +} diff --git a/app/[lang]/(live-current)/@languageSwitcher/page.module.css b/app/[lang]/(live-current)/@languageSwitcher/page.module.css deleted file mode 100644 index c0e8a497d..000000000 --- a/app/[lang]/(live-current)/@languageSwitcher/page.module.css +++ /dev/null @@ -1,17 +0,0 @@ -.desktop { - display: none; -} - -.mobile { - display: block; -} - -@media (min-width: 950px) { - .desktop { - display: block; - } - - .mobile { - display: none; - } -} diff --git a/app/[lang]/(live-current)/@languageSwitcher/page.tsx b/app/[lang]/(live-current)/@languageSwitcher/page.tsx deleted file mode 100644 index cf9e9c3f7..000000000 --- a/app/[lang]/(live-current)/@languageSwitcher/page.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { serverClient } from "@/lib/trpc/server" - -import Desktop from "@/components/Current/Header/LanguageSwitcher/Desktop" -import Mobile from "@/components/Current/Header/LanguageSwitcher/Mobile" - -import styles from "./page.module.css" - -import { LangParams, PageArgs, UIDParams, UriParams } from "@/types/params" - -export default async function LanguageSwitcher({ - params, - searchParams, -}: PageArgs) { - if (!searchParams.uid) { - return null - } - - const { urls } = await serverClient().contentstack.config.languageSwitcher() - - return ( - <> -
- -
-
- -
- - ) -} diff --git a/app/api/web/revalidate/route.ts b/app/api/web/revalidate/route.ts index ca2b529a9..292de8822 100644 --- a/app/api/web/revalidate/route.ts +++ b/app/api/web/revalidate/route.ts @@ -7,7 +7,7 @@ import { Lang } from "@/constants/languages" import { env } from "@/env/server" import { internalServerError } from "@/server/errors/next" import { affix as breadcrumbsAffix } from "@/server/routers/contentstack/breadcrumbs/utils" -import { languageSwitcherAffix } from "@/server/routers/contentstack/config/utils" +import { languageSwitcherAffix } from "@/server/routers/contentstack/languageSwitcher/utils" import { generateRefsResponseTag, diff --git a/app/globals.css b/app/globals.css index 93492eae1..99216e464 100644 --- a/app/globals.css +++ b/app/globals.css @@ -104,16 +104,15 @@ box-sizing: border-box; } -html { +html, +body { margin: 0; padding: 0; } body { - margin: 0; min-height: 100dvh; overflow-x: hidden; - padding: 0; } ul { diff --git a/components/ContentType/LoyaltyPage.tsx b/components/ContentType/LoyaltyPage.tsx index bd5073e87..c90b03a33 100644 --- a/components/ContentType/LoyaltyPage.tsx +++ b/components/ContentType/LoyaltyPage.tsx @@ -4,24 +4,21 @@ import { Blocks } from "@/components/Loyalty/Blocks" import Sidebar from "@/components/Loyalty/Sidebar" import MaxWidth from "@/components/MaxWidth" -import Breadcrumbs from "../MyPages/Breadcrumbs" - import styles from "./loyaltyPage.module.css" -export default async function LoyaltyPage() { +import type { LangParams } from "@/types/params" + +export default async function LoyaltyPage({ lang }: LangParams) { const loyaltyPage = await serverClient().contentstack.loyaltyPage.get() return ( - <> - -
- {loyaltyPage.sidebar.length ? ( - - ) : null} +
+ {loyaltyPage.sidebar.length ? ( + + ) : null} - - {loyaltyPage.blocks ? : null} - -
- + + {loyaltyPage.blocks ? : null} + +
) } diff --git a/components/ContentType/Webviews/LoyaltyPage.tsx b/components/ContentType/Webviews/LoyaltyPage.tsx index 12c3e0eb3..1548e8a2d 100644 --- a/components/ContentType/Webviews/LoyaltyPage.tsx +++ b/components/ContentType/Webviews/LoyaltyPage.tsx @@ -17,7 +17,7 @@ export default async function AboutScandicFriends({ lang }: LangParams) { {loyaltyPage.sidebar ? (
- +
) : null} diff --git a/components/ContentType/loyaltyPage.module.css b/components/ContentType/loyaltyPage.module.css index 026f46d90..11d33bce4 100644 --- a/components/ContentType/loyaltyPage.module.css +++ b/components/ContentType/loyaltyPage.module.css @@ -1,37 +1,39 @@ .content { display: grid; - padding-bottom: 7.7rem; - padding-left: 0; - padding-right: 0; + padding-bottom: var(--Spacing-x9); + padding-left: var(--Spacing-x0); + padding-right: var(--Spacing-x0); position: relative; } .blocks { display: grid; - gap: 4.2rem; - padding: 1.6rem; + gap: var(--Spacing-x5); + padding-left: var(--Spacing-x2); + padding-right: var(--Spacing-x2); } @media screen and (min-width: 1367px) { .content { - gap: 2.7rem; - padding-bottom: 17.5rem; - padding-left: 2.4rem; - padding-right: 2.4rem; - padding-top: 5.8rem; + gap: var(--Spacing-x3); + padding-left: var(--Spacing-x3); + padding-right: var(--Spacing-x3); } .content:has(> aside) { - grid-template-columns: 30rem 1fr; + grid-template-columns: 360px 1fr; + } + + .content:has(> aside) .blocks { + grid-column: 2 / -1; } .blocks { - gap: 6.4rem; - padding-left: 0; - padding-right: 0; + padding-left: var(--Spacing-x0); + padding-right: var(--Spacing-x0); } - .hasLeftSidebar .blocks { - grid-column: 2 / -1; + .blocks > section:first-of-type > header { + gap: var(--Spacing-x2); } } diff --git a/components/Current/Footer/index.tsx b/components/Current/Footer/index.tsx index d69439583..633218d18 100644 --- a/components/Current/Footer/index.tsx +++ b/components/Current/Footer/index.tsx @@ -7,7 +7,7 @@ import Navigation from "./Navigation" import styles from "./footer.module.css" export default async function Footer() { - const footerData = await serverClient().contentstack.config.footer() + const footerData = await serverClient().contentstack.base.footer() return (