Destruct prices
This commit is contained in:
committed by
Pontus Dreij
parent
4a64cd083d
commit
67df5f0771
@@ -19,6 +19,14 @@ export default function FlexibilityOption({
|
||||
// TODO: Implement empty state when this rate can't be booked
|
||||
return <div>TBI: Rate not available</div>
|
||||
}
|
||||
|
||||
const { productType } = product
|
||||
const { public: publicPrice, member: memberPrice } = productType
|
||||
const { localPrice: publicLocalPrice, requestedPrice: publicRequestedPrice } =
|
||||
publicPrice
|
||||
const { localPrice: memberLocalPrice, requestedPrice: memberRequestedPrice } =
|
||||
memberPrice
|
||||
|
||||
return (
|
||||
<label>
|
||||
<input
|
||||
@@ -35,30 +43,27 @@ export default function FlexibilityOption({
|
||||
<div>
|
||||
<dt>{intl.formatMessage({ id: "Standard price" })}</dt>
|
||||
<dd>
|
||||
{product.productType.public.localPrice.pricePerNight}{" "}
|
||||
{product.productType.public.localPrice.currency}/
|
||||
{publicLocalPrice.pricePerNight} {publicLocalPrice.currency}/
|
||||
{intl.formatMessage({ id: "night" })}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>{intl.formatMessage({ id: "Member price" })}</dt>
|
||||
<dd>
|
||||
{product.productType.member.localPrice.pricePerNight}{" "}
|
||||
{product.productType.member.localPrice.currency}/
|
||||
{memberLocalPrice.pricePerNight} {memberLocalPrice.currency}/
|
||||
{intl.formatMessage({ id: "night" })}
|
||||
</dd>
|
||||
</div>
|
||||
{product.productType.public.requestedPrice &&
|
||||
product.productType.member.requestedPrice && (
|
||||
<div>
|
||||
<dt>{intl.formatMessage({ id: "Approx." })}</dt>
|
||||
<dd>
|
||||
{product.productType.public.requestedPrice.pricePerNight}/
|
||||
{product.productType.member.requestedPrice.pricePerNight}{" "}
|
||||
{product.productType.public.requestedPrice.currency}
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
{publicRequestedPrice && memberRequestedPrice && (
|
||||
<div>
|
||||
<dt>{intl.formatMessage({ id: "Approx." })}</dt>
|
||||
<dd>
|
||||
{publicRequestedPrice.pricePerNight}/
|
||||
{memberRequestedPrice.pricePerNight}{" "}
|
||||
{publicRequestedPrice.currency}
|
||||
</dd>
|
||||
</div>
|
||||
)}
|
||||
</dl>
|
||||
</div>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user