feat(WEB-128): desktop and mobile initial wireframe implemented
This commit is contained in:
13
components/MyPages/Blocks/Overview/Mobile.tsx
Normal file
13
components/MyPages/Blocks/Overview/Mobile.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import Breadcrumbs from "@/components/MyPages/Header/Breadcrumbs"
|
||||
import Title from "@/components/MyPages/Title"
|
||||
|
||||
import styles from "./overview.module.css"
|
||||
|
||||
export default function OverviewMobile() {
|
||||
return (
|
||||
<section className={styles.overviewMobile}>
|
||||
<Breadcrumbs />
|
||||
<Title uppercase>Good Morning [NAME]</Title>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
5
components/MyPages/Blocks/Overview/index.tsx
Normal file
5
components/MyPages/Blocks/Overview/index.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import styles from "./overview.module.css"
|
||||
|
||||
export default function Overview() {
|
||||
return <section className={styles.overview}></section>
|
||||
}
|
||||
34
components/MyPages/Blocks/Overview/overview.module.css
Normal file
34
components/MyPages/Blocks/Overview/overview.module.css
Normal file
@@ -0,0 +1,34 @@
|
||||
.overview {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.overviewMobile {
|
||||
background-color: var(--some-grey-color, #f2f2f2);
|
||||
left: 50%;
|
||||
margin-left: -50vw;
|
||||
margin-right: -50vw;
|
||||
padding: 3.5rem 2rem 2rem;
|
||||
position: relative;
|
||||
right: 50%;
|
||||
width: 100dvw;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.overview {
|
||||
background-color: var(--some-grey-color, #f2f2f2);
|
||||
border-radius: 0.8rem;
|
||||
display: block;
|
||||
height: 35rem;
|
||||
left: unset;
|
||||
margin-left: unset;
|
||||
margin-right: unset;
|
||||
max-width: var(--max-width);
|
||||
position: static;
|
||||
right: unset;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.overviewMobile {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
66
components/MyPages/Blocks/UpcomingStays/Stay/index.tsx
Normal file
66
components/MyPages/Blocks/UpcomingStays/Stay/index.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import { dt } from "@/lib/dt"
|
||||
|
||||
import Image from "@/components/Image"
|
||||
import Title from "@/components/MyPages/Title"
|
||||
|
||||
import styles from "./stay.module.css"
|
||||
|
||||
import type { LangParams } from "@/types/params"
|
||||
import type { StayProps } from "@/types/components/myPages/stay"
|
||||
|
||||
export default function Stay({
|
||||
dateArrive,
|
||||
dateDepart,
|
||||
guests,
|
||||
hotel,
|
||||
lang,
|
||||
}: StayProps & LangParams) {
|
||||
const daysUntilArrival = dt(dateArrive).diff(dt(), "days")
|
||||
const arrival = dt(dateArrive).locale(lang)
|
||||
const arrivalDate = arrival.format("DD MMM")
|
||||
const arrivalDateTime = arrival.format("YYYY-MM-DD")
|
||||
const depart = dt(dateDepart).locale(lang)
|
||||
const departDate = depart.format("DD MMM YYYY")
|
||||
const departDateTime = depart.format("YYYY-MM-DD")
|
||||
return (
|
||||
<article className={styles.stay}>
|
||||
<div className={styles.imageContainer}>
|
||||
<div className={styles.badge}>
|
||||
<time className={styles.time}>In {daysUntilArrival} days</time>
|
||||
</div>
|
||||
<Image
|
||||
alt="Placeholder image flower"
|
||||
height={73}
|
||||
src="/flower-image.svg"
|
||||
width={73}
|
||||
/>
|
||||
</div>
|
||||
<footer className={styles.footer}>
|
||||
<Title level="h3" uppercase>
|
||||
{hotel}
|
||||
</Title>
|
||||
<section className={styles.container}>
|
||||
<div className={styles.date}>
|
||||
<Image
|
||||
alt="Calendar Icon"
|
||||
height={20}
|
||||
src="/calendar_month.svg"
|
||||
width={20}
|
||||
/>
|
||||
<p>
|
||||
<time dateTime={arrivalDateTime}>{arrivalDate}</time>
|
||||
{" - "}
|
||||
<time dateTime={departDateTime}>{departDate}</time>
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.guests}>
|
||||
<Image alt="Guests Icon" height={20} src="/person.svg" width={20} />
|
||||
<span>
|
||||
{guests} guest{guests > 1 ? "s" : ""}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</footer>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
61
components/MyPages/Blocks/UpcomingStays/Stay/stay.module.css
Normal file
61
components/MyPages/Blocks/UpcomingStays/Stay/stay.module.css
Normal file
@@ -0,0 +1,61 @@
|
||||
.stay {
|
||||
background-color: var(--some-grey-color, #ababab);
|
||||
border-radius: 0.8rem;
|
||||
display: grid;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 0;
|
||||
flex-basis: 32rem;
|
||||
grid-template-rows: 1fr 9rem;
|
||||
height: 28rem;
|
||||
}
|
||||
|
||||
.imageContainer {
|
||||
align-items: center;
|
||||
display: grid;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.badge {
|
||||
background-color: var(--some-white-color, #fff);
|
||||
border-radius: 4rem;
|
||||
left: 1.5rem;
|
||||
padding: 0.6rem 1.4rem;
|
||||
position: absolute;
|
||||
top: 1.5rem;
|
||||
}
|
||||
|
||||
.time {
|
||||
color: var(--some-black-color, #000);
|
||||
font-family: var(--ff-fira-sans);
|
||||
font-size: 1.2rem;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.footer {
|
||||
background-color: var(--some-white-color, #fff);
|
||||
border-bottom: 0.1rem solid var(--some-grey-color, #d9d9d9);
|
||||
border-left: 0.1rem solid var(--some-grey-color, #d9d9d9);
|
||||
border-right: 0.1rem solid var(--some-grey-color, #d9d9d9);
|
||||
border-radius: 0 0 0.8rem 0.8rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.8rem;
|
||||
height: 9rem;
|
||||
padding: 1.5rem 2rem;
|
||||
}
|
||||
|
||||
.container {
|
||||
align-items: center;
|
||||
display: grid;
|
||||
gap: 2rem;
|
||||
grid-template-columns: auto 1fr;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.date,
|
||||
.guests {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
42
components/MyPages/Blocks/UpcomingStays/index.tsx
Normal file
42
components/MyPages/Blocks/UpcomingStays/index.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import Stay from "./Stay"
|
||||
import Title from "@/components/MyPages/Title"
|
||||
|
||||
import styles from "./upcoming.module.css"
|
||||
|
||||
import type { LangParams } from "@/types/params"
|
||||
|
||||
const stays = [
|
||||
{
|
||||
dateArrive: new Date("04 27 2024"),
|
||||
dateDepart: new Date("04 28 2024"),
|
||||
guests: 2,
|
||||
hotel: "Scandic Helsinki Hub",
|
||||
},
|
||||
{
|
||||
dateArrive: new Date("05 27 2024"),
|
||||
dateDepart: new Date("05 28 2024"),
|
||||
guests: 2,
|
||||
hotel: "Scandic Örebro Central",
|
||||
},
|
||||
{
|
||||
dateArrive: new Date("06 27 2024"),
|
||||
dateDepart: new Date("06 28 2024"),
|
||||
guests: 2,
|
||||
hotel: "Scandic Oslo City",
|
||||
},
|
||||
]
|
||||
|
||||
export default function UpcomingStays({ lang }: LangParams) {
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<Title level="h2" uppercase>
|
||||
Your upcoming stays
|
||||
</Title>
|
||||
<section className={styles.stays}>
|
||||
{stays.map((stay) => (
|
||||
<Stay key={stay.hotel} {...stay} lang={lang} />
|
||||
))}
|
||||
</section>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
30
components/MyPages/Blocks/UpcomingStays/upcoming.module.css
Normal file
30
components/MyPages/Blocks/UpcomingStays/upcoming.module.css
Normal file
@@ -0,0 +1,30 @@
|
||||
.container {
|
||||
display: grid;
|
||||
gap: 2.2rem;
|
||||
margin-right: -2rem;
|
||||
max-width: var(--max-width);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stays {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
overflow-x: auto;
|
||||
padding-right: 2rem;
|
||||
|
||||
/* Hide scrollbar IE and Edge */
|
||||
-ms-overflow-style: none;
|
||||
/* Hide Scrollbar Firefox */
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
/* Hide Scrollbar Chrome, Safari and Opera */
|
||||
.stays::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.container {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user