mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-25 15:50:39 +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:
parent
984e69e150
commit
03347297bf
@ -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.
|
||||
|
||||
```js
|
||||
// Example Provider.js
|
||||
import React from 'react'
|
||||
import { css } from '@emotion/core'
|
||||
|
||||
function AtTheBottomCenter ({ children }) {
|
||||
const css = {
|
||||
@ -63,15 +63,15 @@ function AtTheBottomCenter ({ children }) {
|
||||
textAlign: 'center',
|
||||
}
|
||||
|
||||
return <div css={ css }>
|
||||
{ children }
|
||||
return <div css={css}>
|
||||
{children}
|
||||
</div>
|
||||
}
|
||||
|
||||
export function Provider ({ children, ...props }) {
|
||||
return <>
|
||||
{ children }
|
||||
<AtTheBottomCenter>{ props.index }/{ props.slides.length }</AtTheBottomCenter>
|
||||
{children}
|
||||
<AtTheBottomCenter>{props.index}/{props.slides.length}</AtTheBottomCenter>
|
||||
</>
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user