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