mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-12-01 13:32:13 +03:00
Add buttons for basic mobile support
This commit is contained in:
parent
0d5b9f0866
commit
b1f91996dd
@ -1,6 +1,7 @@
|
||||
import React from 'react'
|
||||
import styled from 'styled-components'
|
||||
import Dots from './Dots'
|
||||
import { dec, inc } from './index'
|
||||
|
||||
const Bottom = styled.div([], {
|
||||
position: 'fixed',
|
||||
@ -9,6 +10,24 @@ const Bottom = styled.div([], {
|
||||
bottom: 0,
|
||||
})
|
||||
|
||||
const Button = styled.div([], {
|
||||
cursor: 'pointer',
|
||||
width: '64px',
|
||||
height: '100vh'
|
||||
})
|
||||
const Previous = styled(Button)([], {
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
})
|
||||
const Next = styled(Button)([], {
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
})
|
||||
|
||||
export default class Provider extends React.Component {
|
||||
render () {
|
||||
const {
|
||||
@ -32,6 +51,20 @@ export default class Provider extends React.Component {
|
||||
}}
|
||||
/>
|
||||
</Bottom>
|
||||
<Previous
|
||||
role='button'
|
||||
title='Previous Slide'
|
||||
onClick={e => {
|
||||
update(dec)
|
||||
}}
|
||||
/>
|
||||
<Next
|
||||
role='button'
|
||||
title='Next Slide'
|
||||
onClick={e => {
|
||||
update(inc)
|
||||
}}
|
||||
/>
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user