From ad2a807c78eec29213bb814e2bedc24bf3ad6a22 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Mon, 26 Aug 2024 13:20:54 +0200 Subject: [PATCH 01/92] feat(SW-187): moved footer fragments to CurrentFooter folder --- .../{Footer => CurrentFooter}/AppDownloads.graphql | 0 .../Fragments/{Footer => CurrentFooter}/Logo.graphql | 0 .../{Footer => CurrentFooter}/Navigation.graphql | 0 .../{Footer => CurrentFooter}/SocialMedia.graphql | 0 .../{Footer => CurrentFooter}/TripAdvisor.graphql | 0 lib/graphql/Query/CurrentFooter.graphql | 10 +++++----- 6 files changed, 5 insertions(+), 5 deletions(-) rename lib/graphql/Fragments/{Footer => CurrentFooter}/AppDownloads.graphql (100%) rename lib/graphql/Fragments/{Footer => CurrentFooter}/Logo.graphql (100%) rename lib/graphql/Fragments/{Footer => CurrentFooter}/Navigation.graphql (100%) rename lib/graphql/Fragments/{Footer => CurrentFooter}/SocialMedia.graphql (100%) rename lib/graphql/Fragments/{Footer => CurrentFooter}/TripAdvisor.graphql (100%) diff --git a/lib/graphql/Fragments/Footer/AppDownloads.graphql b/lib/graphql/Fragments/CurrentFooter/AppDownloads.graphql similarity index 100% rename from lib/graphql/Fragments/Footer/AppDownloads.graphql rename to lib/graphql/Fragments/CurrentFooter/AppDownloads.graphql diff --git a/lib/graphql/Fragments/Footer/Logo.graphql b/lib/graphql/Fragments/CurrentFooter/Logo.graphql similarity index 100% rename from lib/graphql/Fragments/Footer/Logo.graphql rename to lib/graphql/Fragments/CurrentFooter/Logo.graphql diff --git a/lib/graphql/Fragments/Footer/Navigation.graphql b/lib/graphql/Fragments/CurrentFooter/Navigation.graphql similarity index 100% rename from lib/graphql/Fragments/Footer/Navigation.graphql rename to lib/graphql/Fragments/CurrentFooter/Navigation.graphql diff --git a/lib/graphql/Fragments/Footer/SocialMedia.graphql b/lib/graphql/Fragments/CurrentFooter/SocialMedia.graphql similarity index 100% rename from lib/graphql/Fragments/Footer/SocialMedia.graphql rename to lib/graphql/Fragments/CurrentFooter/SocialMedia.graphql diff --git a/lib/graphql/Fragments/Footer/TripAdvisor.graphql b/lib/graphql/Fragments/CurrentFooter/TripAdvisor.graphql similarity index 100% rename from lib/graphql/Fragments/Footer/TripAdvisor.graphql rename to lib/graphql/Fragments/CurrentFooter/TripAdvisor.graphql diff --git a/lib/graphql/Query/CurrentFooter.graphql b/lib/graphql/Query/CurrentFooter.graphql index 5ec7f6bc9..325f7c04e 100644 --- a/lib/graphql/Query/CurrentFooter.graphql +++ b/lib/graphql/Query/CurrentFooter.graphql @@ -1,8 +1,8 @@ -#import "../Fragments/Footer/AppDownloads.graphql" -#import "../Fragments/Footer/Logo.graphql" -#import "../Fragments/Footer/Navigation.graphql" -#import "../Fragments/Footer/SocialMedia.graphql" -#import "../Fragments/Footer/TripAdvisor.graphql" +#import "../Fragments/CurrentFooter/AppDownloads.graphql" +#import "../Fragments/CurrentFooter/Logo.graphql" +#import "../Fragments/CurrentFooter/Navigation.graphql" +#import "../Fragments/CurrentFooter/SocialMedia.graphql" +#import "../Fragments/CurrentFooter/TripAdvisor.graphql" #import "../Fragments/Refs/System.graphql" query GetCurrentFooter($locale: String!) { From 5888937ffdb670c18d87168f7707ebc80e04f898 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Wed, 28 Aug 2024 08:30:45 +0200 Subject: [PATCH 02/92] feat(SW-187): Footer data from contentstack --- components/Current/Footer/index.tsx | 2 +- .../Footer/Navigation/MainNav/index.tsx | 4 +- components/Footer/Navigation/index.tsx | 5 +- components/Footer/index.tsx | 15 ++- .../Fragments/Footer/AppDownloads.graphql | 12 ++ .../Fragments/Footer/MainLinks.graphql | 29 +++++ .../Fragments/Footer/Refs/MainLinks.graphql | 18 +++ .../Footer/Refs/SecondaryLinks.graphql | 20 +++ .../Fragments/Footer/SecondaryLinks.graphql | 24 ++++ lib/graphql/Query/Footer.graphql | 28 +++++ server/routers/contentstack/base/output.ts | 115 +++++++++++++++++- server/routers/contentstack/base/query.ts | 106 +++++++++++++++- server/routers/contentstack/base/utils.ts | 10 ++ types/components/footer/navigation.ts | 5 +- 14 files changed, 373 insertions(+), 20 deletions(-) create mode 100644 lib/graphql/Fragments/Footer/AppDownloads.graphql create mode 100644 lib/graphql/Fragments/Footer/MainLinks.graphql create mode 100644 lib/graphql/Fragments/Footer/Refs/MainLinks.graphql create mode 100644 lib/graphql/Fragments/Footer/Refs/SecondaryLinks.graphql create mode 100644 lib/graphql/Fragments/Footer/SecondaryLinks.graphql create mode 100644 lib/graphql/Query/Footer.graphql create mode 100644 server/routers/contentstack/base/utils.ts diff --git a/components/Current/Footer/index.tsx b/components/Current/Footer/index.tsx index e21afaeb4..83860cae7 100644 --- a/components/Current/Footer/index.tsx +++ b/components/Current/Footer/index.tsx @@ -8,7 +8,7 @@ import Navigation from "./Navigation" import styles from "./footer.module.css" export default async function Footer() { - const footerData = await serverClient().contentstack.base.footer({ + const footerData = await serverClient().contentstack.base.currentFooter({ lang: getLang(), }) if (!footerData) { diff --git a/components/Footer/Navigation/MainNav/index.tsx b/components/Footer/Navigation/MainNav/index.tsx index 353f1a045..91d674d60 100644 --- a/components/Footer/Navigation/MainNav/index.tsx +++ b/components/Footer/Navigation/MainNav/index.tsx @@ -11,11 +11,11 @@ export default function FooterMainNav({ mainLinks }: FooterMainNavProps) { + { + // This will be changed to the new LangueSwitcher that is done in the header branch, when implementing contentstack + } From 4db97c43f87151b946045e252a45b7624c818bf3 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Wed, 21 Aug 2024 14:51:33 +0200 Subject: [PATCH 07/92] feat(SW-185): Added images for app stores --- .../Footer/Navigation/SecondaryNav/index.tsx | 22 ++++++++++++++-- components/Footer/mockedData.ts | 7 ++++++ public/_static/img/app-store-badge.svg | 25 +++++++++++++++++++ public/_static/img/google-play-badge.svg | 24 ++++++++++++++++++ 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 public/_static/img/app-store-badge.svg create mode 100644 public/_static/img/google-play-badge.svg diff --git a/components/Footer/Navigation/SecondaryNav/index.tsx b/components/Footer/Navigation/SecondaryNav/index.tsx index 914dcf123..a6df1ddee 100644 --- a/components/Footer/Navigation/SecondaryNav/index.tsx +++ b/components/Footer/Navigation/SecondaryNav/index.tsx @@ -1,3 +1,4 @@ +import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" import styles from "./secondarynav.module.css" @@ -7,7 +8,15 @@ export default async function FooterSecondaryNav({ }: { secondaryLinks: Record< string, - { title: string; links: Array<{ id: string; href: string; title: string }> } + { + title: string + links: Array<{ + id: string + href: string + title: string + image?: { src: string } + }> + } > }) { return ( @@ -23,7 +32,16 @@ export default async function FooterSecondaryNav({ href={link.href} className={styles.secondaryNavigationLink} > - {link.title} + {link.image ? ( + {link.title} + ) : ( + link.title + )} ))} diff --git a/components/Footer/mockedData.ts b/components/Footer/mockedData.ts index 8ae41a2df..a9ba3f248 100644 --- a/components/Footer/mockedData.ts +++ b/components/Footer/mockedData.ts @@ -29,11 +29,18 @@ export const navigationData = { title: "App Store", href: "https://apps.apple.com/se/app/scandic-hotels/id1020208712", id: "app-store", + image: { + src: "/_static/img/app-store-badge.svg", + alt: "Download on the App Store", + }, }, { title: "Google Play", href: "https://play.google.com/store/apps/details?id=com.scandichotels.scandichotels", id: "google-play", + image: { + src: "/_static/img/google-play-badge.svg", + }, }, ], }, diff --git a/public/_static/img/app-store-badge.svg b/public/_static/img/app-store-badge.svg new file mode 100644 index 000000000..fe8aeaa23 --- /dev/null +++ b/public/_static/img/app-store-badge.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/_static/img/google-play-badge.svg b/public/_static/img/google-play-badge.svg new file mode 100644 index 000000000..90936a6a4 --- /dev/null +++ b/public/_static/img/google-play-badge.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 4ae1c390f26916ae87b2f34a5bc9e194aaead5e1 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 22 Aug 2024 11:01:31 +0200 Subject: [PATCH 08/92] feat(SW-185): Fixing comments --- components/Footer/Details/details.module.css | 33 ++++++++++---- components/Footer/Details/index.tsx | 45 +++++++++++-------- .../Footer/Navigation/MainNav/index.tsx | 27 +++++------ .../Navigation/MainNav/mainnav.module.css | 2 - .../Footer/Navigation/SecondaryNav/index.tsx | 29 ++++++------ .../SecondaryNav/secondarynav.module.css | 1 - components/Footer/Navigation/index.tsx | 2 +- .../Footer/Navigation/navigation.module.css | 4 +- components/Footer/index.tsx | 2 +- components/Footer/mockedData.ts | 2 +- .../TempDesignSystem/Link/link.module.css | 4 ++ components/TempDesignSystem/Link/variants.ts | 1 + .../Text/Body/body.module.css | 14 ++++++ .../TempDesignSystem/Text/Body/index.tsx | 18 ++++---- .../TempDesignSystem/Text/Body/variants.ts | 3 ++ .../Text/Footnote/footnote.module.css | 14 ++++++ .../Text/Footnote/variants.ts | 3 ++ types/components/footer/navigation.ts | 26 +++++++++++ 18 files changed, 158 insertions(+), 72 deletions(-) create mode 100644 types/components/footer/navigation.ts diff --git a/components/Footer/Details/details.module.css b/components/Footer/Details/details.module.css index a6b184ea2..d8bd17d93 100644 --- a/components/Footer/Details/details.module.css +++ b/components/Footer/Details/details.module.css @@ -1,13 +1,13 @@ .details { - background: var(--Main-Grey-100); - color: var(--Main-Grey-White); - padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x7); + background: var(--Main-Red-100); + color: var(--Main-Brand-PalePeach); + padding: var(--Spacing-x3) var(--Spacing-x2) var(--Spacing-x6); } .topContainer { display: flex; justify-content: space-between; - padding: 0 0 var(--Spacing-x2) 0; + padding-bottom: var(--Spacing-x2); margin-bottom: var(--Spacing-x2); } @@ -27,21 +27,38 @@ justify-content: space-between; margin-bottom: var(--Spacing-x2); padding-bottom: var(--Spacing-x2); - border-bottom: 1px solid #e3d9d120; + border-bottom: 1px solid var(--Scandic-Peach-80); } .navigation { display: flex; - gap: var(--Spacing-x2); + gap: var(--Spacing-x1); +} + +.link { + &::after { + content: "·"; + margin-left: var(--Spacing-x1); + } + &:last-child { + &::after { + content: ""; + } + } +} + +.copyrightContainer { + display: flex; + gap: var(--Spacing-x1); } @media screen and (min-width: 1367px) { .details { - background: var(--Main-Grey-100); color: var(--Main-Grey-White); - padding: var(--Spacing-x5) var(--Spacing-x5) var(--Spacing-x9); + padding: var(--Spacing-x6) var(--Spacing-x5) var(--Spacing-x4); } .bottomContainer { + border-top: 1px solid var(--Scandic-Peach-80); flex-direction: row; } .navigationContainer { diff --git a/components/Footer/Details/index.tsx b/components/Footer/Details/index.tsx index ac43a04d0..3768005d6 100644 --- a/components/Footer/Details/index.tsx +++ b/components/Footer/Details/index.tsx @@ -3,6 +3,8 @@ import { getIconByIconName } from "@/components/Icons/get-icon-by-icon-name" import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" +import Footnote from "@/components/TempDesignSystem/Text/Footnote" +import { getLang } from "@/i18n/serverContext" import { detailsData } from "../mockedData" @@ -15,11 +17,13 @@ function socialIcon(iconName: string): JSX.Element | null { return SocialIcon ? : {iconName} } -export default async function FooterDetails() { +export default function FooterDetails() { + const lang = getLang() + const currentYear = new Date().getFullYear() return (
- + Scandic Hotels logo
- - {detailsData.copyrightCompany}{" "} - {detailsData.copyrightInfo} - +
+ + © {currentYear} {detailsData.copyrightCompany} + + + {detailsData.copyrightInfo} + +
{ diff --git a/components/Footer/Navigation/MainNav/index.tsx b/components/Footer/Navigation/MainNav/index.tsx index f3158ba4f..31fa31338 100644 --- a/components/Footer/Navigation/MainNav/index.tsx +++ b/components/Footer/Navigation/MainNav/index.tsx @@ -1,27 +1,28 @@ import { ArrowRightIcon } from "@/components/Icons" import Link from "@/components/TempDesignSystem/Link" +import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./mainnav.module.css" -export default async function FooterMainNav({ - mainLinks, -}: { - mainLinks: Array<{ id: string; href: string; title: string }> -}) { +import { FooterMainNavProps } from "@/types/components/footer/navigation" + +export default function FooterMainNav({ mainLinks }: FooterMainNavProps) { return (