From 9f3c5f6040aa76f987c1a926a154887d0fff6ec0 Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Tue, 10 Dec 2024 13:55:16 +0100 Subject: [PATCH] feat(SW-1012): remove duplicate icon --- .../AccordionAmenities/Parking/index.tsx | 4 +-- components/Icons/ExternalLink.tsx | 27 ------------------- components/Icons/get-icon-by-icon-name.ts | 3 --- components/Icons/index.tsx | 1 - lib/trpc/memoizedRequests/index.ts | 4 --- server/routers/booking/query.ts | 5 +++- types/trpc/routers/booking/confirmation.ts | 4 ++- 7 files changed, 9 insertions(+), 39 deletions(-) delete mode 100644 components/Icons/ExternalLink.tsx diff --git a/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Parking/index.tsx b/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Parking/index.tsx index a2ef9680c..8f38b0ded 100644 --- a/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Parking/index.tsx +++ b/components/ContentType/HotelPage/SidePeeks/Amenities/AccordionAmenities/Parking/index.tsx @@ -1,4 +1,4 @@ -import { ExternalLinkIcon } from "@/components/Icons" +import { OpenInNewIcon } from "@/components/Icons" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" import Button from "@/components/TempDesignSystem/Button" import Divider from "@/components/TempDesignSystem/Divider" @@ -76,7 +76,7 @@ export default async function ParkingAmenity({ target="_blank" > {intl.formatMessage({ id: "Book parking" })} - + )} diff --git a/components/Icons/ExternalLink.tsx b/components/Icons/ExternalLink.tsx deleted file mode 100644 index b58260209..000000000 --- a/components/Icons/ExternalLink.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import { iconVariants } from "./variants" - -import type { IconProps } from "@/types/components/icon" - -export default function ExternalLinkIcon({ - className, - color, - ...props -}: IconProps) { - const classNames = iconVariants({ className, color }) - return ( - - - - ) -} diff --git a/components/Icons/get-icon-by-icon-name.ts b/components/Icons/get-icon-by-icon-name.ts index 172a16e20..68d6864a7 100644 --- a/components/Icons/get-icon-by-icon-name.ts +++ b/components/Icons/get-icon-by-icon-name.ts @@ -39,7 +39,6 @@ import { ElectricBikeIcon, ElectricCarIcon, EmailIcon, - ExternalLinkIcon, EyeHideIcon, EyeShowIcon, FacebookIcon, @@ -202,8 +201,6 @@ export function getIconByIconName( return ElectricCarIcon case IconName.Email: return EmailIcon - case IconName.ExternalLink: - return ExternalLinkIcon case IconName.EyeHide: return EyeHideIcon case IconName.EyeShow: diff --git a/components/Icons/index.tsx b/components/Icons/index.tsx index d1c61fc22..e5fe75235 100644 --- a/components/Icons/index.tsx +++ b/components/Icons/index.tsx @@ -66,7 +66,6 @@ export { default as ElectricBikeIcon } from "./ElectricBike" export { default as ElectricCarIcon } from "./ElectricCar" export { default as EmailIcon } from "./Email" export { default as ErrorCircleIcon } from "./ErrorCircle" -export { default as ExternalLinkIcon } from "./ExternalLink" export { default as EyeHideIcon } from "./EyeHide" export { default as EyeShowIcon } from "./EyeShow" export { default as FacebookIcon } from "./Facebook" diff --git a/lib/trpc/memoizedRequests/index.ts b/lib/trpc/memoizedRequests/index.ts index 006c5f626..22d1ac385 100644 --- a/lib/trpc/memoizedRequests/index.ts +++ b/lib/trpc/memoizedRequests/index.ts @@ -13,10 +13,6 @@ import type { HotelDataInput, } from "@/server/routers/hotels/input" import type { GetSavedPaymentCardsInput } from "@/server/routers/user/input" -import type { - BreackfastPackagesInput, - PackagesInput, -} from "@/types/requests/packages" export const getLocations = cache(async function getMemoizedLocations() { return serverClient().hotel.locations.get() diff --git a/server/routers/booking/query.ts b/server/routers/booking/query.ts index 3e7d1f216..08279eff9 100644 --- a/server/routers/booking/query.ts +++ b/server/routers/booking/query.ts @@ -145,7 +145,10 @@ export const bookingQueryRouter = router({ ...hotelData.data.attributes, included: hotelData.included, }, - room: getBookedHotelRoom(hotelData.included, booking.data.roomTypeCode), + room: getBookedHotelRoom( + hotelData.included?.rooms, + booking.data.roomTypeCode + ), } }), status: serviceProcedure.input(getBookingStatusInput).query(async function ({ diff --git a/types/trpc/routers/booking/confirmation.ts b/types/trpc/routers/booking/confirmation.ts index 7e0b580ce..c9a607a08 100644 --- a/types/trpc/routers/booking/confirmation.ts +++ b/types/trpc/routers/booking/confirmation.ts @@ -9,7 +9,9 @@ export interface BookingConfirmationSchema export interface BookingConfirmation { booking: BookingConfirmationSchema hotel: Hotel & { - included?: RoomData[] + included?: { + rooms: RoomData[] + } } room: | (RoomData & {