feat: sync design of header with current web

This commit is contained in:
Christel Westerberg
2024-05-29 15:36:19 +02:00
parent 88dde3def4
commit 0ec6d58d6a
22 changed files with 122 additions and 225 deletions
@@ -0,0 +1,42 @@
.button {
background-color: #02838e;
color: #fff;
padding: 5px 15px;
display: inline-block;
line-height: 20px;
border: 1px solid transparent;
border-radius: 50px;
height: 32px;
line-height: 20px;
font-size: 14px;
font-family: Helvetica, Arial, sans-serif;
font-weight: 400;
font-size: 16px;
cursor: pointer;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
.button:hover {
text-decoration: underline;
}
.button:focus,
.button:active {
box-shadow: 0 0 1px 2px #b4defa;
outline: none;
border: 1px solid hsl(0, 0%, 80%);
text-decoration: underline;
}
@media screen and (min-width: 950px) {
.button {
font-weight: 600;
font-size: 16px;
line-height: 24px;
height: auto;
padding: 12px 32px;
}
}
@@ -0,0 +1,11 @@
import "@scandic-hotels/design-system/current/style.css"
import styles from "./bookingButton.module.css"
export default function BookingButton() {
return (
<a className={styles.button} href="/">
Book
</a>
)
}
+5 -4
View File
@@ -2,7 +2,8 @@
import { useState } from "react"
import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button"
import BookingButton from "../BookingButton"
import styles from "./mainMenu.module.css"
@@ -82,9 +83,9 @@ export function MainMenu({
<li className={styles.mobileLi}>{languageSwitcher}</li>
) : null}
</ul>
{/* <div className={styles.buttonContainer}>
<Button>Book</Button>
</div> */}
<div className={styles.buttonContainer}>
<BookingButton />
</div>
</nav>
</div>
</div>
@@ -25,7 +25,7 @@
.navBar {
display: grid;
grid-template-columns: 1fr 80px 1fr;
padding-bottom: 1.5px;
height: 52.39px;
}
.expanderBtn {
@@ -33,8 +33,7 @@
border: none;
cursor: pointer;
justify-self: flex-start;
left: 0;
padding: 12px 8px 16px;
padding: 11px 8px 16px;
transition: 0.3s;
user-select: none;
}
@@ -45,7 +44,7 @@
background: #757575;
border-radius: 2.3px;
display: inline-block;
height: 4.6px;
height: 5px;
position: relative;
transition: 0.3s;
width: 32px;
@@ -178,6 +177,8 @@
.buttonContainer {
display: flex;
justify-content: flex-end;
align-items: center;
margin-right: 8px;
}
@media screen and (min-width: 1367px) {
@@ -200,6 +201,7 @@
.navBar {
grid-template-columns: 132.18px 1fr auto;
align-content: center;
height: 85.09px;
}
.expanderBtn {
@@ -261,6 +263,7 @@
@media (min-width: 1200px) {
.navBar {
grid-template-columns: 140px auto 1fr;
height: 82.4px;
}
.logoLink {
+17 -1
View File
@@ -1,13 +1,18 @@
import { auth } from "@/auth"
import styles from "./topMenu.module.css"
import type { TopMenuProps } from "@/types/components/current/header/topMenu"
export default function TopMenu({
export default async function TopMenu({
frontpageLinkText,
homeHref,
links,
languageSwitcher,
lang,
}: TopMenuProps) {
const session = await auth()
return (
<div className={styles.topMenu}>
<div className={styles.container}>
@@ -25,6 +30,17 @@ export default function TopMenu({
</a>
</li>
))}
<li className={styles.loginContainer}>
{session ? (
<a href={`${lang}/logout`} className={styles.loginLink}>
Log out
</a>
) : (
<a href={`${lang}/login`} className={styles.loginLink}>
Log in
</a>
)}
</li>
</ul>
</div>
</div>
@@ -37,12 +37,15 @@
Arial,
sans-serif;
font-size: 13px;
font-weight: 400;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
.langSwitcher {
text-align: center;
position: relative;
display: block;
padding: 3px 15px;
}
@media screen and (min-width: 768px) {
@@ -63,6 +66,16 @@
.link {
padding-top: 4px;
padding-bottom: 4px;
font-weight: 300;
}
.loginContainer {
margin-left: 10px;
background-color: #f3f2f1;
}
.loginLink {
padding-left: 30px;
padding-right: 30px;
color: #000;
}
}
+2 -1
View File
@@ -14,7 +14,7 @@ export default async function Header({
lang,
languageSwitcher,
}: LangParams & { languageSwitcher: React.ReactNode }) {
const data = await serverClient().contentstack.config.header()
const data = await serverClient().contentstack.config.header({ lang })
const homeHref = homeHrefs[env.NODE_ENV][lang]
const { frontpage_link_text, logo, menu, top_menu } = data
@@ -31,6 +31,7 @@ export default async function Header({
homeHref={homeHref}
links={top_menu.links}
languageSwitcher={languageSwitcher}
lang={lang}
/>
<MainMenu
frontpageLinkText={frontpage_link_text}