feat(SW-96): add preview image and lightbox CTA on mobile viewports
This commit is contained in:
@@ -15,8 +15,27 @@ export default async function PreviewImages({
|
|||||||
const intl = await getIntl()
|
const intl = await getIntl()
|
||||||
return (
|
return (
|
||||||
<Lightbox images={images}>
|
<Lightbox images={images}>
|
||||||
|
{/*TODO: Replace with images from API once SW-189 is merged. */}
|
||||||
|
<div className={styles.mobileWrapper}>
|
||||||
|
<Image
|
||||||
|
src={images[0].url}
|
||||||
|
alt={images[0].alt}
|
||||||
|
width={752}
|
||||||
|
height={540}
|
||||||
|
objectFit="cover"
|
||||||
|
className={styles.mobileImage}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
theme="base"
|
||||||
|
intent="inverted"
|
||||||
|
size="small"
|
||||||
|
id="lightboxTrigger"
|
||||||
|
className={styles.seeAllButton}
|
||||||
|
>
|
||||||
|
{intl.formatMessage({ id: "See all photos" })}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<div className={styles.desktopGrid}>
|
<div className={styles.desktopGrid}>
|
||||||
{/*TODO: Replace with images from API once SW-189 is merged. */}
|
|
||||||
{images.slice(0, 3).map((image, index) => (
|
{images.slice(0, 3).map((image, index) => (
|
||||||
<Image
|
<Image
|
||||||
key={index}
|
key={index}
|
||||||
|
|||||||
@@ -1,8 +1,33 @@
|
|||||||
|
.mobileWrapper {
|
||||||
|
position: relative;
|
||||||
|
padding-top: var(--Spacing-x2);
|
||||||
|
background-color: var(--Base-Surface-Subtle-Normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobileImage {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
border-radius: var(--Corner-radius-Medium);
|
||||||
|
}
|
||||||
|
|
||||||
.desktopGrid {
|
.desktopGrid {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.seeAllButton {
|
||||||
|
position: absolute;
|
||||||
|
bottom: var(--Spacing-x2);
|
||||||
|
right: var(--Spacing-x4);
|
||||||
|
z-index: 1;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 1367px) {
|
@media screen and (min-width: 1367px) {
|
||||||
|
.mobileImage {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.desktopGrid {
|
.desktopGrid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 72% 28%;
|
grid-template-columns: 72% 28%;
|
||||||
|
|||||||
Reference in New Issue
Block a user