|
@@ -3,11 +3,16 @@ import React, { useEffect } from 'react';
|
|
|
import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
|
|
import type { ReactMarkdownOptions } from 'react-markdown/lib/react-markdown';
|
|
|
import Reveal from 'reveal.js';
|
|
import Reveal from 'reveal.js';
|
|
|
|
|
|
|
|
|
|
+import { MARP_CONTAINER_CLASS_NAME, Sections } from './Sections';
|
|
|
|
|
|
|
|
import 'reveal.js/dist/reveal.css';
|
|
import 'reveal.js/dist/reveal.css';
|
|
|
-import { CONTAINER_CLASS_NAME, Sections } from './Sections';
|
|
|
|
|
|
|
+import styles from './Presentation.module.scss';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const baseRevealOptions: Reveal.Options = {
|
|
|
|
|
+ disableLayout: true,
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
type Props = {
|
|
type Props = {
|
|
|
rendererOptions: ReactMarkdownOptions,
|
|
rendererOptions: ReactMarkdownOptions,
|
|
|
revealOptions?: Reveal.Options,
|
|
revealOptions?: Reveal.Options,
|
|
@@ -19,14 +24,14 @@ export const Presentation = (props: Props): JSX.Element => {
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (children != null) {
|
|
if (children != null) {
|
|
|
- const deck = new Reveal(revealOptions);
|
|
|
|
|
|
|
+ const deck = new Reveal({ ...baseRevealOptions, ...revealOptions });
|
|
|
deck.initialize()
|
|
deck.initialize()
|
|
|
.then(() => deck.slide(0)); // navigate to the first slide
|
|
.then(() => deck.slide(0)); // navigate to the first slide
|
|
|
}
|
|
}
|
|
|
}, [children, revealOptions]);
|
|
}, [children, revealOptions]);
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
- <div className={`reveal ${CONTAINER_CLASS_NAME}`}>
|
|
|
|
|
|
|
+ <div className={`grw-presentation ${styles['grw-presentation']} reveal ${MARP_CONTAINER_CLASS_NAME}`}>
|
|
|
<div className="slides d-flex justify-content-center align-items-center">
|
|
<div className="slides d-flex justify-content-center align-items-center">
|
|
|
<Sections rendererOptions={rendererOptions}>{children}</Sections>
|
|
<Sections rendererOptions={rendererOptions}>{children}</Sections>
|
|
|
</div>
|
|
</div>
|