fix: empty previous stays design
This commit is contained in:
@@ -8,7 +8,6 @@ import Grids from "@/components/TempDesignSystem/Grids"
|
|||||||
import ListContainer from "../ListContainer"
|
import ListContainer from "../ListContainer"
|
||||||
import ShowMoreButton from "../ShowMoreButton"
|
import ShowMoreButton from "../ShowMoreButton"
|
||||||
import StayCard from "../StayCard"
|
import StayCard from "../StayCard"
|
||||||
import EmptyPreviousStaysBlock from "./EmptyPreviousStays"
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
PreviousStaysClientProps,
|
PreviousStaysClientProps,
|
||||||
@@ -46,7 +45,7 @@ export default function ClientPreviousStays({
|
|||||||
|
|
||||||
return isLoading ? (
|
return isLoading ? (
|
||||||
<LoadingSpinner />
|
<LoadingSpinner />
|
||||||
) : stays.length ? (
|
) : (
|
||||||
<ListContainer>
|
<ListContainer>
|
||||||
<Grids.Stackable>
|
<Grids.Stackable>
|
||||||
{stays.map((stay) => (
|
{stays.map((stay) => (
|
||||||
@@ -61,7 +60,5 @@ export default function ClientPreviousStays({
|
|||||||
<ShowMoreButton disabled={isFetching} loadMoreData={loadMoreData} />
|
<ShowMoreButton disabled={isFetching} loadMoreData={loadMoreData} />
|
||||||
) : null}
|
) : null}
|
||||||
</ListContainer>
|
</ListContainer>
|
||||||
) : (
|
|
||||||
<EmptyPreviousStaysBlock />
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
.container {
|
.container {
|
||||||
align-items: center;
|
|
||||||
background-color: var(--some-grey-color, #f2f2f2);
|
|
||||||
border-radius: var(--Corner-radius-Medium);
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-height: 25rem;
|
align-items: center;
|
||||||
|
background-color: var(--Scandic-Brand-Pale-Peach);
|
||||||
|
border-radius: var(--Corner-radius-Medium);
|
||||||
|
margin-bottom: var(--Spacing-x-half);
|
||||||
|
height: 200px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import { useIntl } from "react-intl"
|
|
||||||
|
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import styles from "./emptyPreviousStays.module.css"
|
import styles from "./emptyPreviousStays.module.css"
|
||||||
|
|
||||||
export default function EmptyPreviousStaysBlock() {
|
export default async function EmptyPreviousStaysBlock() {
|
||||||
const { formatMessage } = useIntl()
|
const { formatMessage } = await getIntl()
|
||||||
return (
|
return (
|
||||||
<section className={styles.container}>
|
<section className={styles.container}>
|
||||||
<Title as="h5" level="h3">
|
<Title as="h5" level="h3" color="red" textAlign="center">
|
||||||
{formatMessage({ id: "You have no previous stays." })}
|
{formatMessage({
|
||||||
|
id: "You have no previous stays.",
|
||||||
|
})}
|
||||||
</Title>
|
</Title>
|
||||||
</section>
|
</section>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import SectionHeader from "@/components/Section/Header"
|
|||||||
import SectionLink from "@/components/Section/Link"
|
import SectionLink from "@/components/Section/Link"
|
||||||
|
|
||||||
import ClientPreviousStays from "./Client"
|
import ClientPreviousStays from "./Client"
|
||||||
|
import EmptyPreviousStaysBlock from "./EmptyPreviousStays"
|
||||||
|
|
||||||
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
||||||
|
|
||||||
@@ -21,10 +22,14 @@ export default async function PreviousStays({
|
|||||||
return (
|
return (
|
||||||
<SectionContainer>
|
<SectionContainer>
|
||||||
<SectionHeader title={title} subtitle={subtitle} link={link} />
|
<SectionHeader title={title} subtitle={subtitle} link={link} />
|
||||||
<ClientPreviousStays
|
{initialPreviousStays.data.length ? (
|
||||||
initialPreviousStays={initialPreviousStays}
|
<ClientPreviousStays
|
||||||
lang={lang}
|
initialPreviousStays={initialPreviousStays}
|
||||||
/>
|
lang={lang}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<EmptyPreviousStaysBlock />
|
||||||
|
)}
|
||||||
<SectionLink link={link} variant="mobile" />
|
<SectionLink link={link} variant="mobile" />
|
||||||
</SectionContainer>
|
</SectionContainer>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default async function EmptyUpcomingStaysBlock({ lang }: LangParams) {
|
|||||||
<Title as="h5" level="h3" color="red" className={styles.title}>
|
<Title as="h5" level="h3" color="red" className={styles.title}>
|
||||||
{formatMessage({ id: "You have no upcoming stays." })}
|
{formatMessage({ id: "You have no upcoming stays." })}
|
||||||
<span className={styles.burgundyTitle}>
|
<span className={styles.burgundyTitle}>
|
||||||
{formatMessage({ id: "Where will you go next?" })}
|
{formatMessage({ id: "Where should you go next?" })}
|
||||||
</span>
|
</span>
|
||||||
</Title>
|
</Title>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user