1
1
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:
Brent Jackson 2018-08-04 18:25:03 -04:00
parent 0d5b9f0866
commit b1f91996dd

View File

@ -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>
)
}