diff --git a/sanityv3/schemas/textSnippets.ts b/sanityv3/schemas/textSnippets.ts index 03737479b..9a8c26b3f 100644 --- a/sanityv3/schemas/textSnippets.ts +++ b/sanityv3/schemas/textSnippets.ts @@ -13,6 +13,7 @@ export const groups = { pensionForm: { title: 'Pension form', hidden: !Flags.HAS_PENSION_FORM }, form: { title: 'Form', hidden: !Flags.HAS_FORMS }, cookie: { title: 'Cookie' }, + carousel: { title: 'Carousel' }, others: { title: 'Others' }, common: { title: 'Common' }, } @@ -295,7 +296,7 @@ const snippets: textSnippet = { title: 'Pension Category', defaultValue: 'Pension', group: groups.pensionForm, - }, + }, pension_form_select_topic: { title: 'Default Pension Category', defaultValue: 'Pension', @@ -816,6 +817,11 @@ const snippets: textSnippet = { defaultValue: `Please don't enter any personal information`, group: groups.common, }, + carousel_controls: { + title: 'Carousel controls', + defaultValue: 'Carousel controls', + group: groups.carousel, + }, } type textSnippetGroup = { title: string; hidden?: boolean } diff --git a/web/core/Carousel/Carousel.tsx b/web/core/Carousel/Carousel.tsx index 8cedeb95b..a653fe83c 100644 --- a/web/core/Carousel/Carousel.tsx +++ b/web/core/Carousel/Carousel.tsx @@ -27,6 +27,7 @@ import { useMediaQuery } from '../../lib/hooks/useMediaQuery' import { CarouselEventItem } from './CarouselEventItem' import { CarouselKeyNumberItem } from './CarouselKeyNumberItem' import { CarouselIframeItem } from './CarouselIframeItem' +import { FormattedMessage } from 'react-intl' export type DisplayModes = 'single' | 'scroll' export type Layouts = 'full' | 'default' @@ -360,7 +361,9 @@ export const Carousel = forwardRef(function Carousel internalAutoRotation ? 'justify-between' : 'justify-end' }`} > -
{`Carousel controls`}
+
+ +
{internalAutoRotation && ( (function Carousel title={`Go to previous`} aria-controls={carouselItemsId} mode="previous" - disabled={displayMode === 'scroll' && scrollPosition === 'start'} + disabled={(displayMode === 'scroll' && scrollPosition === 'start') ?? false} onClick={() => { if (variant === 'image' && displayMode === 'single') { loopSlidePrev() @@ -395,7 +398,7 @@ export const Carousel = forwardRef(function Carousel title={`Go to next`} mode="next" aria-controls={carouselItemsId} - disabled={displayMode === 'scroll' && scrollPosition === 'end'} + disabled={(displayMode === 'scroll' && scrollPosition === 'end') ?? false} onClick={() => { if (variant === 'image' && displayMode === 'single') { loopSlideNext()