From 5d15e5605f2af3554cb8b8e344360b919c6b02ef Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Mon, 13 May 2024 15:12:06 +0200 Subject: [PATCH] feat: add two and three column grid variants --- components/LoadingSpinner/index.tsx | 22 +++++ components/LoadingSpinner/loading.module.css | 89 +++++++++++++++++++ .../Benefits/CurrentLevel/current.module.css | 23 ++--- .../Blocks/Benefits/CurrentLevel/index.tsx | 7 +- .../Blocks/Benefits/NextLevel/index.tsx | 2 +- .../MyPages/Blocks/Stays/Previous/index.tsx | 6 +- .../MyPages/Blocks/Stays/Upcoming/index.tsx | 7 +- .../TempDesignSystem/CardGrid/index.tsx | 11 +-- .../TempDesignSystem/CardGrid/variants.ts | 3 + server/routers/user/output.ts | 4 +- types/components/myPages/stays/stayList.ts | 7 -- 11 files changed, 138 insertions(+), 43 deletions(-) create mode 100644 components/LoadingSpinner/index.tsx create mode 100644 components/LoadingSpinner/loading.module.css delete mode 100644 types/components/myPages/stays/stayList.ts diff --git a/components/LoadingSpinner/index.tsx b/components/LoadingSpinner/index.tsx new file mode 100644 index 000000000..efcd4d5a9 --- /dev/null +++ b/components/LoadingSpinner/index.tsx @@ -0,0 +1,22 @@ +import styles from "./loading.module.css" + +export default function LoadingSpinner() { + return ( +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) +} diff --git a/components/LoadingSpinner/loading.module.css b/components/LoadingSpinner/loading.module.css new file mode 100644 index 000000000..0c2a7da70 --- /dev/null +++ b/components/LoadingSpinner/loading.module.css @@ -0,0 +1,89 @@ +.container { + display: flex; + justify-content: center; + align-items: center; + height: 200px; +} + +.spinner { + display: inline-block; + position: relative; + width: 80px; + height: 80px; +} + +.spinner div { + 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%; + background: var(--Brand-Main-Strong); +} + +.spinner div:nth-child(1) { + transform: rotate(0deg); + 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; +} + +@keyframes spinnerAnimation { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} diff --git a/components/MyPages/Blocks/Benefits/CurrentLevel/current.module.css b/components/MyPages/Blocks/Benefits/CurrentLevel/current.module.css index 5d0ec9909..e22e5eb66 100644 --- a/components/MyPages/Blocks/Benefits/CurrentLevel/current.module.css +++ b/components/MyPages/Blocks/Benefits/CurrentLevel/current.module.css @@ -24,20 +24,21 @@ font-size: 2rem; } .value { - color: var(--some-brown-color, #4d001b); + color: var(--Theme-Primary-Light-On-Surface-Text); } .cardContainer { display: flex; gap: 16px; } + .cardSubtitle { font-family: var(--ff-fira-sans); font-size: 16px; font-weight: 400; line-height: 14.4px; text-align: center; - color: #b05b65; + color: var(--Theme-Primary-Light-On-Surface-Accent); margin: 0; } @@ -47,12 +48,16 @@ display: flex; flex-direction: column; gap: 10px; + min-height: 280px; + background-color: var(--Base-Fill-Normal); justify-content: center; align-items: center; padding: 30px; border-radius: 4px; - background-color: var(--Base-Fill-Normal); + text-decoration: none; + text-align: center; + color: var(--Theme-Primary-Light-On-Surface-Text); aspect-ratio: 1/1; } @@ -60,16 +65,4 @@ .card:nth-child(2) { grid-area: card2; } - - .card:last-of-type { - grid-area: card3; - } - - .card:nth-child(2) { - grid-area: card2; - } - - .card:last-of-type { - grid-area: card3; - } } diff --git a/components/MyPages/Blocks/Benefits/CurrentLevel/index.tsx b/components/MyPages/Blocks/Benefits/CurrentLevel/index.tsx index 22adfdacc..1308b81e4 100644 --- a/components/MyPages/Blocks/Benefits/CurrentLevel/index.tsx +++ b/components/MyPages/Blocks/Benefits/CurrentLevel/index.tsx @@ -3,6 +3,7 @@ import Link from "next/link" import { Lang } from "@/constants/languages" import { serverClient } from "@/lib/trpc/server" +import CardGrid from "@/components/TempDesignSystem/CardGrid" import Title from "@/components/Title" import levelsData from "../data" @@ -53,8 +54,8 @@ export default async function CurrentBenefitsBlock({ {subtitle &&

{subtitle}

} -
- {currentLevel.benefits.map((benefit, idx) => ( + + {currentLevel.benefits.map((benefit, idx) => ( {benefit.description}

))} -
+ ) } diff --git a/components/MyPages/Blocks/Benefits/NextLevel/index.tsx b/components/MyPages/Blocks/Benefits/NextLevel/index.tsx index 2806e9ba0..9471ec79e 100644 --- a/components/MyPages/Blocks/Benefits/NextLevel/index.tsx +++ b/components/MyPages/Blocks/Benefits/NextLevel/index.tsx @@ -39,7 +39,7 @@ export default async function NextLevelBenefitsBlock({ )} {subtitle &&

{subtitle}

} - + {perks.map((perk) => (