fix: make incomplete steps in accordion look disabled
This commit is contained in:
@@ -45,12 +45,12 @@ export default async function SummaryPage({
|
|||||||
user && availability.memberRate
|
user && availability.memberRate
|
||||||
? {
|
? {
|
||||||
local: {
|
local: {
|
||||||
price: availability.memberRate?.localPrice.pricePerStay,
|
price: availability.memberRate.localPrice.pricePerStay,
|
||||||
currency: availability.memberRate?.localPrice.currency,
|
currency: availability.memberRate.localPrice.currency,
|
||||||
},
|
},
|
||||||
euro: {
|
euro: {
|
||||||
price: availability.memberRate?.requestedPrice?.pricePerStay,
|
price: availability.memberRate.requestedPrice.pricePerStay,
|
||||||
currency: availability.memberRate?.requestedPrice?.currency,
|
currency: availability.memberRate.requestedPrice.currency,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
@@ -59,8 +59,8 @@ export default async function SummaryPage({
|
|||||||
currency: availability.publicRate?.localPrice.currency,
|
currency: availability.publicRate?.localPrice.currency,
|
||||||
},
|
},
|
||||||
euro: {
|
euro: {
|
||||||
price: availability.publicRate?.requestedPrice?.pricePerStay,
|
price: availability.publicRate?.requestedPrice.pricePerStay,
|
||||||
currency: availability.publicRate?.requestedPrice?.currency,
|
currency: availability.publicRate?.requestedPrice.currency,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,30 +8,32 @@
|
|||||||
background-color: var(--Scandic-Brand-Warm-White);
|
background-color: var(--Scandic-Brand-Warm-White);
|
||||||
}
|
}
|
||||||
|
|
||||||
.enter-details-layout__content {
|
.enter-details-layout__container {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Spacing-x3) var(--Spacing-x9);
|
gap: var(--Spacing-x3) var(--Spacing-x9);
|
||||||
margin: var(--Spacing-x3) var(--Spacing-x2) 0;
|
|
||||||
/* simulates padding on viewport smaller than --max-width-navigation */
|
/* simulates padding on viewport smaller than --max-width-navigation */
|
||||||
width: min(
|
}
|
||||||
calc(100dvw - (var(--Spacing-x2) * 2)),
|
|
||||||
var(--max-width-navigation)
|
.enter-details-layout__content {
|
||||||
);
|
margin: var(--Spacing-x3) var(--Spacing-x2) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.enter-details-layout__summaryContainer {
|
.enter-details-layout__summaryContainer {
|
||||||
position: fixed;
|
position: sticky;
|
||||||
z-index: 1;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1367px) {
|
@media screen and (min-width: 1367px) {
|
||||||
.enter-details-layout__content {
|
.enter-details-layout__container {
|
||||||
grid-template-columns: 1fr 340px;
|
grid-template-columns: 1fr 340px;
|
||||||
grid-template-rows: auto 1fr;
|
grid-template-rows: auto 1fr;
|
||||||
margin: var(--Spacing-x5) auto 0;
|
margin: var(--Spacing-x5) auto 0;
|
||||||
|
width: min(
|
||||||
|
calc(100dvw - (var(--Spacing-x2) * 2)),
|
||||||
|
var(--max-width-navigation)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
.enter-details-layout__summaryContainer {
|
.enter-details-layout__summaryContainer {
|
||||||
|
|||||||
@@ -28,9 +28,11 @@ export default async function StepLayout({
|
|||||||
<EnterDetailsProvider step={params.step} isMember={!!user}>
|
<EnterDetailsProvider step={params.step} isMember={!!user}>
|
||||||
<main className="enter-details-layout__layout">
|
<main className="enter-details-layout__layout">
|
||||||
{hotelHeader}
|
{hotelHeader}
|
||||||
<div className={"enter-details-layout__content"}>
|
<div className={"enter-details-layout__container"}>
|
||||||
{children}
|
<div className={"enter-details-layout__content"}>{children}</div>
|
||||||
<aside className={"enter-details-layout__summaryContainer"}>{summary}</aside>
|
<aside className={"enter-details-layout__summaryContainer"}>
|
||||||
|
{summary}
|
||||||
|
</aside>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</EnterDetailsProvider>
|
</EnterDetailsProvider>
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ export default function SectionAccordion({
|
|||||||
function onModify() {
|
function onModify() {
|
||||||
navigate(step)
|
navigate(step)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const textColor =
|
||||||
|
isComplete || isOpen ? "uiTextHighContrast" : "baseTextDisabled"
|
||||||
return (
|
return (
|
||||||
<section className={styles.wrapper} data-open={isOpen} data-step={step}>
|
<section className={styles.wrapper} data-open={isOpen} data-step={step}>
|
||||||
<div className={styles.iconWrapper}>
|
<div className={styles.iconWrapper}>
|
||||||
@@ -78,15 +81,11 @@ export default function SectionAccordion({
|
|||||||
asChild
|
asChild
|
||||||
textTransform="uppercase"
|
textTransform="uppercase"
|
||||||
type="label"
|
type="label"
|
||||||
color="uiTextHighContrast"
|
color={textColor}
|
||||||
>
|
>
|
||||||
<h2>{header}</h2>
|
<h2>{header}</h2>
|
||||||
</Footnote>
|
</Footnote>
|
||||||
<Subtitle
|
<Subtitle className={styles.selection} type="two" color={textColor}>
|
||||||
className={styles.selection}
|
|
||||||
type="two"
|
|
||||||
color="uiTextHighContrast"
|
|
||||||
>
|
|
||||||
{title}
|
{title}
|
||||||
</Subtitle>
|
</Subtitle>
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export default function PriceList({
|
|||||||
</Body>
|
</Body>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<Subtitle type="two" color="disabled">
|
<Subtitle type="two" color="baseTextDisabled">
|
||||||
{intl.formatMessage({ id: "n/a" })}
|
{intl.formatMessage({ id: "n/a" })}
|
||||||
</Subtitle>
|
</Subtitle>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -76,3 +76,7 @@
|
|||||||
.white {
|
.white {
|
||||||
color: var(--Main-Grey-White);
|
color: var(--Main-Grey-White);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.baseTextDisabled {
|
||||||
|
color: var(--Base-Text-Disabled);
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const config = {
|
|||||||
uiTextHighContrast: styles.uiTextHighContrast,
|
uiTextHighContrast: styles.uiTextHighContrast,
|
||||||
uiTextPlaceholder: styles.uiTextPlaceholder,
|
uiTextPlaceholder: styles.uiTextPlaceholder,
|
||||||
white: styles.white,
|
white: styles.white,
|
||||||
|
baseTextDisabled: styles.baseTextDisabled,
|
||||||
},
|
},
|
||||||
textAlign: {
|
textAlign: {
|
||||||
center: styles.center,
|
center: styles.center,
|
||||||
|
|||||||
@@ -79,6 +79,6 @@
|
|||||||
color: var(--Scandic-Brand-Scandic-Red);
|
color: var(--Scandic-Brand-Scandic-Red);
|
||||||
}
|
}
|
||||||
|
|
||||||
.disabled {
|
.baseTextDisabled {
|
||||||
color: var(--Base-Text-Disabled);
|
color: var(--Base-Text-Disabled);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const config = {
|
|||||||
color: {
|
color: {
|
||||||
black: styles.black,
|
black: styles.black,
|
||||||
burgundy: styles.burgundy,
|
burgundy: styles.burgundy,
|
||||||
disabled: styles.disabled,
|
baseTextDisabled: styles.baseTextDisabled,
|
||||||
pale: styles.pale,
|
pale: styles.pale,
|
||||||
baseTextMediumContrast: styles.baseTextMediumContrast,
|
baseTextMediumContrast: styles.baseTextMediumContrast,
|
||||||
uiTextHighContrast: styles.uiTextHighContrast,
|
uiTextHighContrast: styles.uiTextHighContrast,
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ export const productTypePriceSchema = z.object({
|
|||||||
rateCode: z.string(),
|
rateCode: z.string(),
|
||||||
rateType: z.string().optional(),
|
rateType: z.string().optional(),
|
||||||
localPrice: priceSchema,
|
localPrice: priceSchema,
|
||||||
requestedPrice: priceSchema.optional(),
|
requestedPrice: priceSchema,
|
||||||
})
|
})
|
||||||
|
|
||||||
const productSchema = z.object({
|
const productSchema = z.object({
|
||||||
@@ -671,7 +671,7 @@ export const apiCitiesByCountrySchema = z.object({
|
|||||||
})
|
})
|
||||||
|
|
||||||
export interface CitiesByCountry
|
export interface CitiesByCountry
|
||||||
extends z.output<typeof apiCitiesByCountrySchema> { }
|
extends z.output<typeof apiCitiesByCountrySchema> {}
|
||||||
export type CitiesGroupedByCountry = Record<string, CitiesByCountry["data"]>
|
export type CitiesGroupedByCountry = Record<string, CitiesByCountry["data"]>
|
||||||
|
|
||||||
export const apiCountriesSchema = z.object({
|
export const apiCountriesSchema = z.object({
|
||||||
@@ -701,7 +701,7 @@ export const apiCountriesSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
export interface Countries extends z.output<typeof apiCountriesSchema> { }
|
export interface Countries extends z.output<typeof apiCountriesSchema> {}
|
||||||
|
|
||||||
export const apiLocationCitySchema = z.object({
|
export const apiLocationCitySchema = z.object({
|
||||||
attributes: z.object({
|
attributes: z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user