mdx-deck icon indicating copy to clipboard operation
mdx-deck copied to clipboard

Allows the usage of slide index in print mode

Open foyarash opened this issue 5 years ago • 2 comments

Refers to #374

Allows to retrieve the slides index using the useDeck hook on print mode. Previously the value was always 0, because on the Print component, the slide index is not passed to the Slide component.

foyarash avatar Jan 14 '20 10:01 foyarash

Even better would be to do this, which makes it possible to print the notes as well.

const Print = ({ slides, notes }) => {
  const outer = useDeck()
  const context = {
    ...outer,
    mode: modes.print,
  }

  return (
    <Context.Provider value={context}>
      {slides.map((slide, i) => (
        <Slide key={i} slide={slide} index={i} notes={notes} preview />
      ))}
    </Context.Provider>
  )
}

alpinegizmo avatar May 23 '20 14:05 alpinegizmo

Would be very cool to see this merged :)

maxammann avatar Dec 06 '20 14:12 maxammann