fix: button for empty stays
This commit is contained in:
@@ -8,7 +8,6 @@ import Grids from "@/components/TempDesignSystem/Grids"
|
||||
import ListContainer from "../ListContainer"
|
||||
import ShowMoreButton from "../ShowMoreButton"
|
||||
import StayCard from "../StayCard"
|
||||
import EmptyUpcomingStaysBlock from "./EmptyUpcomingStays"
|
||||
|
||||
import type {
|
||||
UpcomingStaysClientProps,
|
||||
@@ -61,7 +60,5 @@ export default function ClientUpcomingStays({
|
||||
<ShowMoreButton disabled={isFetching} loadMoreData={loadMoreData} />
|
||||
) : null}
|
||||
</ListContainer>
|
||||
) : (
|
||||
<EmptyUpcomingStaysBlock />
|
||||
)
|
||||
) : null
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import { useIntl } from "react-intl"
|
||||
import { homeHrefs } from "@/constants/homeHrefs"
|
||||
import { env } from "@/env/server"
|
||||
|
||||
import Button from "@/components/TempDesignSystem/Button"
|
||||
import Link from "@/components/TempDesignSystem/Link"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import styles from "./emptyUpcomingStays.module.css"
|
||||
|
||||
export default function EmptyUpcomingStaysBlock() {
|
||||
const { formatMessage } = useIntl()
|
||||
import { LangParams } from "@/types/params"
|
||||
|
||||
export default async function EmptyUpcomingStaysBlock({ lang }: LangParams) {
|
||||
const { formatMessage } = await getIntl()
|
||||
return (
|
||||
<section className={styles.container}>
|
||||
<Title as="h5" level="h3">
|
||||
@@ -18,7 +22,9 @@ export default function EmptyUpcomingStaysBlock() {
|
||||
</span>
|
||||
</Title>
|
||||
<Button asChild intent="primary" type="button">
|
||||
<Link href="#">{formatMessage({ id: "Get inspired" })}</Link>
|
||||
<Link href={homeHrefs[env.NODE_ENV][lang]}>
|
||||
{formatMessage({ id: "Get inspired" })}
|
||||
</Link>
|
||||
</Button>
|
||||
</section>
|
||||
)
|
||||
|
||||
@@ -4,6 +4,7 @@ import SectionContainer from "@/components/Section/Container"
|
||||
import SectionHeader from "@/components/Section/Header"
|
||||
|
||||
import ClientUpcomingStays from "./Client"
|
||||
import EmptyUpcomingStaysBlock from "./EmptyUpcomingStays"
|
||||
|
||||
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
|
||||
|
||||
@@ -20,10 +21,14 @@ export default async function UpcomingStays({
|
||||
return (
|
||||
<SectionContainer>
|
||||
<SectionHeader title={title} subtitle={subtitle} link={link} />
|
||||
<ClientUpcomingStays
|
||||
initialUpcomingStays={initialUpcomingStays}
|
||||
lang={lang}
|
||||
/>
|
||||
{initialUpcomingStays.data.length ? (
|
||||
<ClientUpcomingStays
|
||||
initialUpcomingStays={initialUpcomingStays}
|
||||
lang={lang}
|
||||
/>
|
||||
) : (
|
||||
<EmptyUpcomingStaysBlock lang={lang} />
|
||||
)}
|
||||
</SectionContainer>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user