Skip to content

Commit

Permalink
One more try to fix revealjs build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Maslennikov committed Jan 18, 2024
1 parent 7946e4a commit 555ad1c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/components/reveal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type PropsWithChildren, type ReactElement, useEffect, useRef } from 're
import Reveal from 'reveal.js'
import RevealNotes from 'reveal.js/plugin/notes/notes'

export function RevealSlides ({ children }: PropsWithChildren): ReactElement {
function RevealSlidesInner ({ children }: PropsWithChildren): ReactElement {
const ref = useRef(null)

useEffect(() => {
Expand All @@ -17,15 +17,17 @@ export function RevealSlides ({ children }: PropsWithChildren): ReactElement {
return () => { r.destroy() }
}, [ref])

return <BrowserOnly>
{() => {
return <div className={'w-full h-80 not-prose'}>
<div ref={ref} className={'reveal'}>
<div className={'slides'}>
{children}
</div>
</div>
return <div className={'w-full h-80 not-prose'}>
<div ref={ref} className={'reveal'}>
<div className={'slides'}>
{children}
</div>
}}
</div>
</div>
}

export function RevealSlides ({ children }: PropsWithChildren): ReactElement {
return <BrowserOnly>
{() => <RevealSlidesInner>{ children }</RevealSlidesInner>}
</BrowserOnly>
}

0 comments on commit 555ad1c

Please sign in to comment.