|
@@ -2,9 +2,9 @@ import React, { ComponentProps, useRef } from 'react'
|
|
|
|
|
|
import { GridHeadingContainer } from '@/shared/components'
|
|
import { GridHeadingContainer } from '@/shared/components'
|
|
import { Arrow } from '@/shared/components/Carousel/Carousel.style'
|
|
import { Arrow } from '@/shared/components/Carousel/Carousel.style'
|
|
-import { SvgGlyphChevronLeft, SvgGlyphChevronRight } from '@/shared/icons'
|
|
|
|
|
|
+import { SvgGlyphChevronLeft, SvgGlyphChevronRight, SvgPlayerPlay } from '@/shared/icons'
|
|
|
|
|
|
-import { CarouselArrowsContainer, Container } from './Gallery.style'
|
|
|
|
|
|
+import { CarouselArrowsContainer, Container, SeeAllLink, TitleWrapper } from './Gallery.style'
|
|
|
|
|
|
import { Carousel, CarouselProps } from '../Carousel/Carousel'
|
|
import { Carousel, CarouselProps } from '../Carousel/Carousel'
|
|
import { Text } from '../Text'
|
|
import { Text } from '../Text'
|
|
@@ -12,6 +12,7 @@ import { Text } from '../Text'
|
|
export type GalleryProps = {
|
|
export type GalleryProps = {
|
|
title?: string
|
|
title?: string
|
|
className?: string
|
|
className?: string
|
|
|
|
+ seeAllUrl?: string
|
|
} & CarouselProps
|
|
} & CarouselProps
|
|
|
|
|
|
type ImperativeHandleData = {
|
|
type ImperativeHandleData = {
|
|
@@ -19,7 +20,7 @@ type ImperativeHandleData = {
|
|
getNextArrowProps: () => ComponentProps<typeof Arrow>
|
|
getNextArrowProps: () => ComponentProps<typeof Arrow>
|
|
}
|
|
}
|
|
|
|
|
|
-export const Gallery: React.FC<GalleryProps> = ({ title, className, ...carouselProps }) => {
|
|
|
|
|
|
+export const Gallery: React.FC<GalleryProps> = ({ title, className, seeAllUrl, ...carouselProps }) => {
|
|
// TODO: this is the only place in the app that requires refs to buttons. Once we refactor this component, we can remove forwardRef from buttons
|
|
// TODO: this is the only place in the app that requires refs to buttons. Once we refactor this component, we can remove forwardRef from buttons
|
|
const prevArrowRef = useRef<HTMLButtonElement>(null)
|
|
const prevArrowRef = useRef<HTMLButtonElement>(null)
|
|
const nextArrowRef = useRef<HTMLButtonElement>(null)
|
|
const nextArrowRef = useRef<HTMLButtonElement>(null)
|
|
@@ -27,7 +28,23 @@ export const Gallery: React.FC<GalleryProps> = ({ title, className, ...carouselP
|
|
return (
|
|
return (
|
|
<Container className={className}>
|
|
<Container className={className}>
|
|
<GridHeadingContainer>
|
|
<GridHeadingContainer>
|
|
- {title && <Text variant="h4">{title}</Text>}
|
|
|
|
|
|
+ <TitleWrapper>
|
|
|
|
+ {title && <Text variant="h4">{title}</Text>}
|
|
|
|
+ {seeAllUrl && (
|
|
|
|
+ <>
|
|
|
|
+ <SeeAllLink
|
|
|
|
+ iconPlacement="left"
|
|
|
|
+ icon={<SvgPlayerPlay width={16} height={16} />}
|
|
|
|
+ textOnly
|
|
|
|
+ to={seeAllUrl}
|
|
|
|
+ size="large"
|
|
|
|
+ variant="primary"
|
|
|
|
+ >
|
|
|
|
+ See all
|
|
|
|
+ </SeeAllLink>
|
|
|
|
+ </>
|
|
|
|
+ )}
|
|
|
|
+ </TitleWrapper>
|
|
<CarouselArrowsContainer>
|
|
<CarouselArrowsContainer>
|
|
<Arrow {...carouselRef.current?.getPrevArrowProps()} ref={prevArrowRef} size="large" variant="secondary">
|
|
<Arrow {...carouselRef.current?.getPrevArrowProps()} ref={prevArrowRef} size="large" variant="secondary">
|
|
<SvgGlyphChevronLeft />
|
|
<SvgGlyphChevronLeft />
|