feat: static my stays
This commit is contained in:
@@ -1,71 +0,0 @@
|
||||
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/myPage/stays"
|
||||
|
||||
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="/_static/icons/flower-image.svg"
|
||||
width={73}
|
||||
/>
|
||||
</div>
|
||||
<footer className={styles.footer}>
|
||||
<Title as="h5" level="h3" uppercase>
|
||||
{hotel}
|
||||
</Title>
|
||||
<section className={styles.container}>
|
||||
<div className={styles.date}>
|
||||
<Image
|
||||
alt="Calendar Icon"
|
||||
height={20}
|
||||
src="/_static/icons/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="/_static/icons/person.svg"
|
||||
width={20}
|
||||
/>
|
||||
<span>
|
||||
{guests} guest{guests > 1 ? "s" : ""}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</footer>
|
||||
</article>
|
||||
)
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
.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;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
import Link from "next/link"
|
||||
import Stay from "./Stay"
|
||||
import Title from "@/components/MyPages/Title"
|
||||
|
||||
import styles from "./upcoming.module.css"
|
||||
|
||||
import type { LangParams } from "@/types/params"
|
||||
import type { StaysProps } from "@/types/components/myPages/myPage/stays"
|
||||
|
||||
export default function UpcomingStays({
|
||||
lang,
|
||||
stays,
|
||||
}: StaysProps & LangParams) {
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<header className={styles.header}>
|
||||
<Title level="h2" as="h4" uppercase>
|
||||
Your upcoming stays
|
||||
</Title>
|
||||
<Link className={styles.link} href="#">
|
||||
See all
|
||||
</Link>
|
||||
</header>
|
||||
<section className={styles.stays}>
|
||||
{stays.map((stay) => (
|
||||
<Stay key={stay.hotel} {...stay} lang={lang} />
|
||||
))}
|
||||
</section>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
.container {
|
||||
display: grid;
|
||||
gap: 2.2rem;
|
||||
margin-right: -2rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.header {
|
||||
align-items: baseline;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.link {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.stays {
|
||||
display: flex;
|
||||
gap: 2rem;
|
||||
overflow-x: auto;
|
||||
|
||||
/* 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 (max-width: 950px) {
|
||||
.stays {
|
||||
padding-right: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 950px) {
|
||||
.container {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.link {
|
||||
color: var(--some-black-color, #111);
|
||||
display: inline-block;
|
||||
font-family: var(--ff-fira-sans);
|
||||
font-size: 1.4rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1.2%;
|
||||
line-height: 140%;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user