Skip to content

Commit

Permalink
fix: navigation-based carousel close action
Browse files Browse the repository at this point in the history
  • Loading branch information
aegroto committed Nov 22, 2024
1 parent a7a16e4 commit 3be1418
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ export function CarouselProvider ({ children }) {
window.history.pushState(null, '', pathname)

showModal((close, setOptions) => {
return <Carousel close={close} mediaArr={Array.from(media.current.entries())} src={src} setOptions={setOptions} />
const closeAction = () => {
window.history.back()
}
return <Carousel close={closeAction} mediaArr={Array.from(media.current.entries())} src={src} setOptions={setOptions} />
}, {
fullScreen: true,
overflow: <CarouselOverflow {...media.current.get(src)} />
Expand Down

0 comments on commit 3be1418

Please sign in to comment.