feat(sw-589): cleanups and PR comment fixes
This commit is contained in:
@@ -8,41 +8,33 @@ import styles from "./rateSummary.module.css"
|
||||
|
||||
import { RateSummaryProps } from "@/types/components/hotelReservation/selectRate/rateSummary"
|
||||
|
||||
export default function RateSummary({ rateSummary, user }: RateSummaryProps) {
|
||||
export default function RateSummary({
|
||||
rateSummary,
|
||||
isUserLoggedIn,
|
||||
}: RateSummaryProps) {
|
||||
const intl = useIntl()
|
||||
|
||||
const priceToShow = isUserLoggedIn ? rateSummary.member : rateSummary.public
|
||||
|
||||
return (
|
||||
<div className={styles.summary}>
|
||||
<div className={styles.summaryText}>
|
||||
<Subtitle>{rateSummary.roomType}</Subtitle>
|
||||
<Body>{rateSummary.priceName}</Body>
|
||||
<Subtitle color="uiTextHighContrast">{rateSummary.roomType}</Subtitle>
|
||||
<Body color="uiTextMediumContrast">{rateSummary.priceName}</Body>
|
||||
</div>
|
||||
<div className={styles.summaryPrice}>
|
||||
<div className={styles.summaryPriceText}>
|
||||
{user ? (
|
||||
<>
|
||||
<Subtitle color="red">
|
||||
{rateSummary.member?.localPrice.pricePerStay}{" "}
|
||||
{rateSummary.member?.localPrice.currency}
|
||||
</Subtitle>
|
||||
<Body>
|
||||
{intl.formatMessage({ id: "Approx." })}{" "}
|
||||
{rateSummary.member?.requestedPrice?.pricePerStay}{" "}
|
||||
{rateSummary.member?.requestedPrice?.currency}
|
||||
</Body>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Subtitle>
|
||||
{rateSummary.public?.localPrice.pricePerStay}{" "}
|
||||
{rateSummary.public?.localPrice.currency}
|
||||
</Subtitle>
|
||||
<Body>
|
||||
{intl.formatMessage({ id: "Approx." })}{" "}
|
||||
{rateSummary.public?.requestedPrice?.pricePerStay}{" "}
|
||||
{rateSummary.public?.requestedPrice?.currency}
|
||||
</Body>
|
||||
</>
|
||||
)}
|
||||
<>
|
||||
<Subtitle color={isUserLoggedIn ? "red" : "uiTextHighContrast"}>
|
||||
{priceToShow?.localPrice.pricePerStay}{" "}
|
||||
{priceToShow?.localPrice.currency}
|
||||
</Subtitle>
|
||||
<Body color="uiTextMediumContrast">
|
||||
{intl.formatMessage({ id: "Approx." })}{" "}
|
||||
{priceToShow?.requestedPrice?.pricePerStay}{" "}
|
||||
{priceToShow?.requestedPrice?.currency}
|
||||
</Body>
|
||||
</>
|
||||
</div>
|
||||
<Button type="submit" theme="base">
|
||||
{intl.formatMessage({ id: "Continue" })}
|
||||
|
||||
@@ -47,7 +47,9 @@ export default function RoomSelection({
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
{rateSummary && <RateSummary rateSummary={rateSummary} user={user} />}
|
||||
{rateSummary && (
|
||||
<RateSummary rateSummary={rateSummary} isUserLoggedIn={!!user} />
|
||||
)}
|
||||
</form>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -96,6 +96,10 @@
|
||||
color: var(--UI-Text-High-contrast);
|
||||
}
|
||||
|
||||
.uiTextMediumContrast {
|
||||
color: var(--UI-Text-Medium-contrast);
|
||||
}
|
||||
|
||||
.uiTextPlaceholder {
|
||||
color: var(--UI-Text-Placeholder);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ const config = {
|
||||
peach50: styles.peach50,
|
||||
peach80: styles.peach80,
|
||||
uiTextHighContrast: styles.uiTextHighContrast,
|
||||
uiTextMediumContrast: styles.uiTextMediumContrast,
|
||||
uiTextPlaceholder: styles.uiTextPlaceholder,
|
||||
},
|
||||
textAlign: {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Rate } from "./selectRate"
|
||||
|
||||
import { User } from "@/types/user"
|
||||
|
||||
export interface RateSummaryProps {
|
||||
rateSummary: Rate
|
||||
user: User | null
|
||||
isUserLoggedIn: boolean
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user