images_viewer/src/components/BookComponentsController.tsx

51 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-05-08 17:02:03 +07:00
import React from 'react'
import styled from 'styled-components'
2020-05-09 12:32:54 +07:00
import {Button} from 'antd'
2020-05-08 17:02:03 +07:00
import ViewSwitcher from './ViewSwitcher'
import JumpControls from './JumpControls'
2020-05-09 12:32:54 +07:00
import {
CaretLeftOutlined,
CaretRightOutlined,
} from '@ant-design/icons';
2020-05-08 17:02:03 +07:00
const ControlsContanter = styled.div`
display: inline-flex;
justify-content: space-between;
2020-05-09 12:32:54 +07:00
width: 100%;
2020-05-08 17:02:03 +07:00
`
export default function BookCoponentsController(props: any) {
const {onPrevClick, prevDisable, onNextClick, nextDisable, ...restProps} = props
return (
<ControlsContanter>
2020-05-09 12:32:54 +07:00
<JumpControls {...restProps}/>
2020-05-08 17:02:03 +07:00
<Button
onClick={()=>{
onPrevClick()
}}
disabled={prevDisable}
2020-05-09 12:32:54 +07:00
style={{
marginRight: 8
}}
icon={<CaretLeftOutlined />}
/>
2020-05-08 17:02:03 +07:00
<Button
onClick={()=>{
onNextClick()
}}
disabled={nextDisable}
2020-05-09 12:32:54 +07:00
style={{
marginRight: 8
}}
icon={<CaretRightOutlined />}
2020-05-08 17:02:03 +07:00
>
</Button>
2020-05-09 12:32:54 +07:00
2020-05-08 17:02:03 +07:00
<ViewSwitcher {...restProps}/>
</ControlsContanter>
)
}