From a355b384dc2929c875b014f8a0cc028b71603252 Mon Sep 17 00:00:00 2001 From: bcho892 Date: Tue, 12 Nov 2024 14:10:24 +1300 Subject: [PATCH] refactor and add docs --- client/src/app/Home.story.tsx | 10 +++++++++- client/src/app/HomeComponent.tsx | 13 +++++++------ client/src/app/bookings/page.tsx | 2 +- client/src/app/sections/utils/Pricing.ts | 9 +++------ .../BookingInformationAndCreation.tsx | 11 +++++++---- client/src/components/utils/types.tsx | 2 +- 6 files changed, 28 insertions(+), 19 deletions(-) diff --git a/client/src/app/Home.story.tsx b/client/src/app/Home.story.tsx index 9a74836d8..fe40ddcaf 100644 --- a/client/src/app/Home.story.tsx +++ b/client/src/app/Home.story.tsx @@ -9,5 +9,13 @@ const meta: Meta = { export default meta export const DefaultHomePage = () => { - return + return ( + + ) } diff --git a/client/src/app/HomeComponent.tsx b/client/src/app/HomeComponent.tsx index 498cef2da..1e7ef640b 100644 --- a/client/src/app/HomeComponent.tsx +++ b/client/src/app/HomeComponent.tsx @@ -9,7 +9,7 @@ import BenefitSection from "./sections/BenefitSection" import LandingSection from "./sections/LandingSection" import PricingSection from "./sections/PricingSection" import { benefits } from "./sections/utils/Benefits" -import { pricingBannerMessages } from "./sections/utils/Pricing" +import { lodgeBookingPricingBannerMessages } from "./sections/utils/Pricing" export type HomeProps = { /** @@ -51,11 +51,12 @@ const HomeComponent = ({ note={content?.pricing?.discount} pricings={membershipPricingData} bannerContent={{ - headline: pricingBannerMessages.headline, - priceInformation: pricingBannerMessages.priceInformation( - lodgePricing.normal - ), - disclaimer: pricingBannerMessages.priceInformation( + headline: lodgeBookingPricingBannerMessages.headline, + priceInformation: + lodgeBookingPricingBannerMessages.priceInformation( + lodgePricing.normal + ), + disclaimer: lodgeBookingPricingBannerMessages.priceInformation( lodgePricing.moreExpensive ) }} diff --git a/client/src/app/bookings/page.tsx b/client/src/app/bookings/page.tsx index 76319f521..b584be5bc 100644 --- a/client/src/app/bookings/page.tsx +++ b/client/src/app/bookings/page.tsx @@ -57,7 +57,7 @@ const BookingPage = async () => { <> , imageSrcs: processedImages diff --git a/client/src/app/sections/utils/Pricing.ts b/client/src/app/sections/utils/Pricing.ts index 982f69014..bea5c0bfa 100644 --- a/client/src/app/sections/utils/Pricing.ts +++ b/client/src/app/sections/utils/Pricing.ts @@ -1,12 +1,9 @@ -import { Pricing } from "@/components/utils/types" - -export const pricingNote = - "*We have a discounted membership price on offer until Sunday 17th March so lock in now for a year of awesome memories!" +import { MembershipPricing } from "@/components/utils/types" /** * An object containing messages for the pricing banner. */ -export const pricingBannerMessages = { +export const lodgeBookingPricingBannerMessages = { /** * The headline message for the pricing banner. */ @@ -31,7 +28,7 @@ export const pricingBannerMessages = { `*$${moreExpensivePrice} when booking a single Friday or Saturday` as const } as const -export const Pricings: Pricing[] = [ +export const MembershipPricings: MembershipPricing[] = [ { title: "UoA Student", discountedPrice: "$45", diff --git a/client/src/components/composite/Booking/BookingInformationAndCreation/BookingInformationAndCreation.tsx b/client/src/components/composite/Booking/BookingInformationAndCreation/BookingInformationAndCreation.tsx index 9ab48d6c1..8932c1704 100644 --- a/client/src/components/composite/Booking/BookingInformationAndCreation/BookingInformationAndCreation.tsx +++ b/client/src/components/composite/Booking/BookingInformationAndCreation/BookingInformationAndCreation.tsx @@ -36,7 +36,10 @@ interface IBookingInformationAndCreation { */ enableNetworkRequests?: boolean - lodgePrices: LodgePricingProps + /** + * How much each the different types of bookings cost, based on {@link LodgePricingProps} + */ + lodgePricing: LodgePricingProps } /** @@ -47,7 +50,7 @@ const BookingInformationAndCreation = ({ bookingCreationProps, lodgeInfoProps, enableNetworkRequests, - lodgePrices + lodgePricing }: IBookingInformationAndCreation) => { const params = useSearchParams() @@ -70,12 +73,12 @@ const BookingInformationAndCreation = ({ ) case "booking-creation": if (enableNetworkRequests) { - return + return } else { return ( ) } diff --git a/client/src/components/utils/types.tsx b/client/src/components/utils/types.tsx index c882503e8..2221fe212 100644 --- a/client/src/components/utils/types.tsx +++ b/client/src/components/utils/types.tsx @@ -17,7 +17,7 @@ export type Benefit = { /** * For use with the pricing cards that have the `home` variant */ -export type Pricing = { +export type MembershipPricing = { title: string originalPrice?: string discountedPrice: string