1
1
mirror of https://github.com/jxnblk/mdx-deck.git synced 2024-11-26 00:35:02 +03:00

Few improvements

- Add comment to explicitly mark the code as an example of a Provider
- Remove unused import
This commit is contained in:
Randy Topliffe 2019-04-23 13:41:50 -04:00
parent 984e69e150
commit 03347297bf

View File

@ -50,8 +50,8 @@ which can be used to show custom page numbers or add other elements to the UI.
The example below will display the current slide out of the total amount of slides. The example below will display the current slide out of the total amount of slides.
```js ```js
// Example Provider.js
import React from 'react' import React from 'react'
import { css } from '@emotion/core'
function AtTheBottomCenter ({ children }) { function AtTheBottomCenter ({ children }) {
const css = { const css = {
@ -63,15 +63,15 @@ function AtTheBottomCenter ({ children }) {
textAlign: 'center', textAlign: 'center',
} }
return <div css={ css }> return <div css={css}>
{ children } {children}
</div> </div>
} }
export function Provider ({ children, ...props }) { export function Provider ({ children, ...props }) {
return <> return <>
{ children } {children}
<AtTheBottomCenter>{ props.index }/{ props.slides.length }</AtTheBottomCenter> <AtTheBottomCenter>{props.index}/{props.slides.length}</AtTheBottomCenter>
</> </>
} }
``` ```