Merged in fix/SW-1955-image-gallery-hide-room-label (pull request #1621)
fix(SW-1955): hide label on room sidepeek * fix(SW-1955): hide label on room sidepeek Approved-by: Erik Tiekstra
This commit is contained in:
@@ -81,6 +81,7 @@ export default async function RoomSidePeek({
|
|||||||
images={galleryImages}
|
images={galleryImages}
|
||||||
title={room.name}
|
title={room.name}
|
||||||
height={280}
|
height={280}
|
||||||
|
hideLabel={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<Typography variant="Body/Paragraph/mdRegular">
|
<Typography variant="Body/Paragraph/mdRegular">
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ function ImageGallery({
|
|||||||
fill,
|
fill,
|
||||||
height = 280,
|
height = 280,
|
||||||
sizes,
|
sizes,
|
||||||
|
hideLabel,
|
||||||
}: ImageGalleryProps) {
|
}: ImageGalleryProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const [lightboxIsOpen, setLightboxIsOpen] = useState(false)
|
const [lightboxIsOpen, setLightboxIsOpen] = useState(false)
|
||||||
@@ -58,6 +59,7 @@ function ImageGallery({
|
|||||||
dialogTitle={title}
|
dialogTitle={title}
|
||||||
isOpen={lightboxIsOpen}
|
isOpen={lightboxIsOpen}
|
||||||
onClose={() => setLightboxIsOpen(false)}
|
onClose={() => setLightboxIsOpen(false)}
|
||||||
|
hideLabel={hideLabel}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export default function FullView({
|
|||||||
onPrev,
|
onPrev,
|
||||||
currentIndex,
|
currentIndex,
|
||||||
totalImages,
|
totalImages,
|
||||||
|
hideLabel,
|
||||||
}: FullViewProps) {
|
}: FullViewProps) {
|
||||||
const [animateLeft, setAnimateLeft] = useState(true)
|
const [animateLeft, setAnimateLeft] = useState(true)
|
||||||
|
|
||||||
@@ -97,7 +98,9 @@ export default function FullView({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div className={styles.fullViewFooter}>
|
<div className={styles.fullViewFooter}>
|
||||||
{image.caption && <Body color="white">{image.caption}</Body>}
|
{image.caption && !hideLabel && (
|
||||||
|
<Body color="white">{image.caption}</Body>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</motion.div>
|
</motion.div>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export default function Gallery({
|
|||||||
onSelectImage,
|
onSelectImage,
|
||||||
onImageClick,
|
onImageClick,
|
||||||
selectedImage,
|
selectedImage,
|
||||||
|
hideLabel,
|
||||||
}: GalleryProps) {
|
}: GalleryProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
const [animateLeft, setAnimateLeft] = useState(true)
|
const [animateLeft, setAnimateLeft] = useState(true)
|
||||||
@@ -79,7 +80,7 @@ export default function Gallery({
|
|||||||
{/* Desktop Gallery */}
|
{/* Desktop Gallery */}
|
||||||
<div className={styles.desktopGallery}>
|
<div className={styles.desktopGallery}>
|
||||||
<div className={styles.galleryHeader}>
|
<div className={styles.galleryHeader}>
|
||||||
{mainImage.caption && (
|
{mainImage.caption && !hideLabel && (
|
||||||
<div className={styles.imageCaption}>
|
<div className={styles.imageCaption}>
|
||||||
<Caption color="textMediumContrast">{mainImage.caption}</Caption>
|
<Caption color="textMediumContrast">{mainImage.caption}</Caption>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function Lightbox({
|
|||||||
onClose,
|
onClose,
|
||||||
isOpen,
|
isOpen,
|
||||||
activeIndex = 0,
|
activeIndex = 0,
|
||||||
|
hideLabel,
|
||||||
}: LightboxProps) {
|
}: LightboxProps) {
|
||||||
const [selectedImageIndex, setSelectedImageIndex] = useState(activeIndex)
|
const [selectedImageIndex, setSelectedImageIndex] = useState(activeIndex)
|
||||||
const [isFullView, setIsFullView] = useState(false)
|
const [isFullView, setIsFullView] = useState(false)
|
||||||
@@ -73,6 +74,7 @@ export default function Lightbox({
|
|||||||
onPrev={handlePrev}
|
onPrev={handlePrev}
|
||||||
currentIndex={selectedImageIndex}
|
currentIndex={selectedImageIndex}
|
||||||
totalImages={images.length}
|
totalImages={images.length}
|
||||||
|
hideLabel={hideLabel}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Gallery
|
<Gallery
|
||||||
@@ -85,6 +87,7 @@ export default function Lightbox({
|
|||||||
}}
|
}}
|
||||||
onImageClick={() => setIsFullView(true)}
|
onImageClick={() => setIsFullView(true)}
|
||||||
selectedImage={images[selectedImageIndex]}
|
selectedImage={images[selectedImageIndex]}
|
||||||
|
hideLabel={hideLabel}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|||||||
@@ -12,4 +12,5 @@ export type ImageGalleryProps = {
|
|||||||
width?: number
|
width?: number
|
||||||
height?: number
|
height?: number
|
||||||
sizes?: string
|
sizes?: string
|
||||||
|
hideLabel?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export interface LightboxProps {
|
|||||||
onClose: () => void
|
onClose: () => void
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
activeIndex?: number
|
activeIndex?: number
|
||||||
|
hideLabel?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GalleryProps {
|
export interface GalleryProps {
|
||||||
@@ -14,6 +15,7 @@ export interface GalleryProps {
|
|||||||
onSelectImage: (image: GalleryImage) => void
|
onSelectImage: (image: GalleryImage) => void
|
||||||
onImageClick: () => void
|
onImageClick: () => void
|
||||||
selectedImage: GalleryImage | null
|
selectedImage: GalleryImage | null
|
||||||
|
hideLabel?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FullViewProps {
|
export interface FullViewProps {
|
||||||
@@ -23,4 +25,5 @@ export interface FullViewProps {
|
|||||||
onPrev: () => void
|
onPrev: () => void
|
||||||
currentIndex: number
|
currentIndex: number
|
||||||
totalImages: number
|
totalImages: number
|
||||||
|
hideLabel?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user