feat(SW-219): add ability to always stack buttons
This commit is contained in:
@@ -67,11 +67,12 @@ export default async function HotelPage() {
|
|||||||
</div>
|
</div>
|
||||||
<Rooms rooms={roomCategories} />
|
<Rooms rooms={roomCategories} />
|
||||||
<Facilities facilities={facilities} />
|
<Facilities facilities={facilities} />
|
||||||
|
{/* NOTE: These are added here for testing. Remove before PR */}
|
||||||
{/* Add ContentCard here */}
|
{/* Example of ContentCard with Button CTA's */}
|
||||||
<ContentCard
|
<ContentCard
|
||||||
title="Special Offer"
|
title="Special Offer"
|
||||||
description="Enjoy a luxurious stay with our exclusive package."
|
description="Mattis sit duis pulvinar ultricies auctor euismod. Augue mattis mauris at est iaculis pulvinar pulvinar."
|
||||||
|
alwaysStack={true}
|
||||||
primaryCTA={{
|
primaryCTA={{
|
||||||
label: "Book Now",
|
label: "Book Now",
|
||||||
href: "/booking",
|
href: "/booking",
|
||||||
@@ -81,19 +82,19 @@ export default async function HotelPage() {
|
|||||||
href: "/offers",
|
href: "/offers",
|
||||||
openInNewTab: true,
|
openInNewTab: true,
|
||||||
}}
|
}}
|
||||||
style="featured"
|
|
||||||
backgroundImage="https://www.scandichotels.com/imageVault/publishedmedia/sixadhu91jy67aal2pla/Scandic_Downtown_Camper_cocktail_lounge_bar_the_ne.jpg"
|
backgroundImage="https://www.scandichotels.com/imageVault/publishedmedia/sixadhu91jy67aal2pla/Scandic_Downtown_Camper_cocktail_lounge_bar_the_ne.jpg"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Example of ContentCard with SidePeek */}
|
{/* Example of ContentCard with SidePeek */}
|
||||||
<ContentCard
|
<ContentCard
|
||||||
title="Explore Facilities"
|
title="Explore Facilities"
|
||||||
description="Discover all the amenities our hotel has to offer."
|
description="Mattis sit duis pulvinar ultricies auctor euismod. Augue mattis mauris at est iaculis pulvinar pulvinar."
|
||||||
sidePeekCTA={{
|
sidePeekCTA={{
|
||||||
label: "View Facilities",
|
label: "View Facilities",
|
||||||
onClick: true,
|
onClick: true,
|
||||||
}}
|
}}
|
||||||
style="default"
|
style="default"
|
||||||
|
backgroundImage="https://www.scandichotels.com/imageVault/publishedmedia/sixadhu91jy67aal2pla/Scandic_Downtown_Camper_cocktail_lounge_bar_the_ne.jpg"
|
||||||
/>
|
/>
|
||||||
</main>
|
</main>
|
||||||
{googleMapsApiKey ? (
|
{googleMapsApiKey ? (
|
||||||
|
|||||||
@@ -14,6 +14,11 @@
|
|||||||
background-color: var(--Main-Grey-White);
|
background-color: var(--Main-Grey-White);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.default,
|
||||||
|
.featured {
|
||||||
|
border: 1px solid var(--Base-Border-Subtle);
|
||||||
|
}
|
||||||
|
|
||||||
.imageContainer {
|
.imageContainer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 12.58625rem; /* 201.38px / 16 = 12.58625rem */
|
height: 12.58625rem; /* 201.38px / 16 = 12.58625rem */
|
||||||
@@ -29,9 +34,9 @@
|
|||||||
.content {
|
.content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--Spacing-x2);
|
gap: var(--Spacing-x-one-and-half);
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
padding: var(--Spacing-x4);
|
padding: var(--Spacing-x2) var(--Spacing-x3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.description {
|
.description {
|
||||||
@@ -39,9 +44,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ctaContainer {
|
.ctaContainer {
|
||||||
display: flex;
|
display: grid;
|
||||||
gap: var(--Spacing-x2);
|
grid-template-columns: 1fr;
|
||||||
margin-top: var(--Spacing-x2);
|
gap: var(--Spacing-x1);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ctaButton {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1367px) {
|
||||||
|
.card:not(.alwaysStack) .ctaContainer {
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:not(.alwaysStack) .ctaContainer:has(:only-child) {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidePeekCTA {
|
.sidePeekCTA {
|
||||||
|
|||||||
@@ -21,9 +21,10 @@ export default function ContentCard({
|
|||||||
sidePeekCTA,
|
sidePeekCTA,
|
||||||
backgroundImage,
|
backgroundImage,
|
||||||
style = "default",
|
style = "default",
|
||||||
|
alwaysStack = false,
|
||||||
className,
|
className,
|
||||||
}: ContentCardProps) {
|
}: ContentCardProps) {
|
||||||
const cardClasses = contentCardVariants({ style, className })
|
const cardClasses = contentCardVariants({ style, alwaysStack, className })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cardClasses}>
|
<div className={cardClasses}>
|
||||||
@@ -58,7 +59,12 @@ export default function ContentCard({
|
|||||||
) : (
|
) : (
|
||||||
<div className={styles.ctaContainer}>
|
<div className={styles.ctaContainer}>
|
||||||
{primaryCTA && (
|
{primaryCTA && (
|
||||||
<Button asChild intent="primary" size="small">
|
<Button
|
||||||
|
asChild
|
||||||
|
intent="primary"
|
||||||
|
size="small"
|
||||||
|
className={styles.ctaButton}
|
||||||
|
>
|
||||||
<Link
|
<Link
|
||||||
href={primaryCTA.href}
|
href={primaryCTA.href}
|
||||||
target={primaryCTA.openInNewTab ? "_blank" : undefined}
|
target={primaryCTA.openInNewTab ? "_blank" : undefined}
|
||||||
@@ -68,7 +74,12 @@ export default function ContentCard({
|
|||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
{secondaryCTA && (
|
{secondaryCTA && (
|
||||||
<Button asChild intent="secondary" size="small">
|
<Button
|
||||||
|
asChild
|
||||||
|
intent="secondary"
|
||||||
|
size="small"
|
||||||
|
className={styles.ctaButton}
|
||||||
|
>
|
||||||
<Link
|
<Link
|
||||||
href={secondaryCTA.href}
|
href={secondaryCTA.href}
|
||||||
target={secondaryCTA.openInNewTab ? "_blank" : undefined}
|
target={secondaryCTA.openInNewTab ? "_blank" : undefined}
|
||||||
|
|||||||
@@ -8,8 +8,13 @@ export const contentCardVariants = cva(styles.card, {
|
|||||||
default: styles.default,
|
default: styles.default,
|
||||||
featured: styles.featured,
|
featured: styles.featured,
|
||||||
},
|
},
|
||||||
|
alwaysStack: {
|
||||||
|
true: styles.alwaysStack,
|
||||||
|
false: "",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
defaultVariants: {
|
defaultVariants: {
|
||||||
style: "default",
|
style: "default",
|
||||||
|
alwaysStack: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export interface CTA {
|
|||||||
export interface SidePeekCTA {
|
export interface SidePeekCTA {
|
||||||
label: string
|
label: string
|
||||||
// onClick: () => void
|
// onClick: () => void
|
||||||
|
// TODO: change back to function.
|
||||||
onClick: boolean
|
onClick: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user