From b0b9ac15cc55051a54ef1155c04938ed6b674a44 Mon Sep 17 00:00:00 2001 From: Christel Westerberg Date: Wed, 19 Jun 2024 14:36:30 +0200 Subject: [PATCH] fix: button for empty stays --- .../MyPages/Blocks/Stays/Upcoming/Client.tsx | 5 +---- .../Stays/Upcoming/EmptyUpcomingStays/index.tsx | 14 ++++++++++---- components/MyPages/Blocks/Stays/Upcoming/index.tsx | 13 +++++++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/components/MyPages/Blocks/Stays/Upcoming/Client.tsx b/components/MyPages/Blocks/Stays/Upcoming/Client.tsx index 536495cfb..105289c6c 100644 --- a/components/MyPages/Blocks/Stays/Upcoming/Client.tsx +++ b/components/MyPages/Blocks/Stays/Upcoming/Client.tsx @@ -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({ ) : null} - ) : ( - - ) + ) : null } diff --git a/components/MyPages/Blocks/Stays/Upcoming/EmptyUpcomingStays/index.tsx b/components/MyPages/Blocks/Stays/Upcoming/EmptyUpcomingStays/index.tsx index 1c239fbfa..27ed484b0 100644 --- a/components/MyPages/Blocks/Stays/Upcoming/EmptyUpcomingStays/index.tsx +++ b/components/MyPages/Blocks/Stays/Upcoming/EmptyUpcomingStays/index.tsx @@ -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 (
@@ -18,7 +22,9 @@ export default function EmptyUpcomingStaysBlock() { </span>
) diff --git a/components/MyPages/Blocks/Stays/Upcoming/index.tsx b/components/MyPages/Blocks/Stays/Upcoming/index.tsx index 7e44e76ca..736251cfa 100644 --- a/components/MyPages/Blocks/Stays/Upcoming/index.tsx +++ b/components/MyPages/Blocks/Stays/Upcoming/index.tsx @@ -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 ( - + {initialUpcomingStays.data.length ? ( + + ) : ( + + )} ) }