From 9d106713a0d3df75490fcc9d80e01bb82afbd4c9 Mon Sep 17 00:00:00 2001 From: Pontus Dreij Date: Thu, 10 Oct 2024 13:38:05 +0200 Subject: [PATCH] feat(SW-415): Update typings --- .../FlexibilityOption/Popover/index.tsx | 12 ++------- .../{PriceTable => PriceList}/index.tsx | 18 ++++++------- .../priceList.module.css} | 0 .../RoomSelection/FlexibilityOption/index.tsx | 12 +++------ .../RoomSelection/RoomCard/index.tsx | 6 ++--- .../RoomSelection/roomSelection.module.css | 7 ++--- server/routers/hotels/output.ts | 26 +++++++------------ .../selectRate/flexibilityOption.ts | 12 ++++++--- .../selectRate/pricePopover.ts | 5 ++++ 9 files changed, 42 insertions(+), 56 deletions(-) rename components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/{PriceTable => PriceList}/index.tsx (89%) rename components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/{PriceTable/priceTable.module.css => PriceList/priceList.module.css} (100%) create mode 100644 types/components/hotelReservation/selectRate/pricePopover.ts diff --git a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/Popover/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/Popover/index.tsx index 60efe49b2..62979d2c7 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/Popover/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/Popover/index.tsx @@ -1,18 +1,10 @@ -import { - Button, - Dialog, - OverlayArrow, - Popover, - type PopoverProps, -} from "react-aria-components" +import { Button, Dialog, OverlayArrow, Popover } from "react-aria-components" import { CloseIcon } from "@/components/Icons" import styles from "./popover.module.css" -interface PricePopoverProps extends Omit { - children: React.ReactNode -} +import { PricePopoverProps } from "@/types/components/hotelReservation/selectRate/pricePopover" export default function PricePopover({ children, diff --git a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceTable/index.tsx b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx similarity index 89% rename from components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceTable/index.tsx rename to components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx index 07e618b7c..952d8add3 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceTable/index.tsx +++ b/components/HotelReservation/SelectRate/RoomSelection/FlexibilityOption/PriceList/index.tsx @@ -4,25 +4,25 @@ import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import styles from "./priceTable.module.css" +import styles from "./priceList.module.css" -import { PriceTableProps } from "@/types/components/hotelReservation/selectRate/flexibilityOption" +import { PriceListProps } from "@/types/components/hotelReservation/selectRate/flexibilityOption" -export default function PriceTable({ - publicPrice, - memberPrice, -}: PriceTableProps) { +export default function PriceList({ + publicPrice = {}, + memberPrice = {}, +}: PriceListProps) { const intl = useIntl() const { localPrice: publicLocalPrice, requestedPrice: publicRequestedPrice } = - publicPrice || {} + publicPrice const { localPrice: memberLocalPrice, requestedPrice: memberRequestedPrice } = - memberPrice || {} + memberPrice const showRequestedPrice = publicRequestedPrice && memberRequestedPrice return ( -
+
-
setRef(node)} - > +