|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+import { IconButton } from 'components/shared'
|
|
|
2
|
+import { RotateCcw, RotateCw, Trash2 } from 'react-feather'
|
|
|
3
|
+import state, { useSelector } from 'state'
|
|
|
4
|
+import styled from 'styles'
|
|
|
5
|
+
|
|
|
6
|
+const undo = () => state.send('UNDO')
|
|
|
7
|
+const redo = () => state.send('REDO')
|
|
|
8
|
+const clear = () => state.send('CLEARED_PAGE')
|
|
|
9
|
+
|
|
|
10
|
+export default function UndoRedo() {
|
|
|
11
|
+ return (
|
|
|
12
|
+ <Container>
|
|
|
13
|
+ <IconButton onClick={undo}>
|
|
|
14
|
+ <RotateCcw />
|
|
|
15
|
+ </IconButton>
|
|
|
16
|
+ <IconButton onClick={redo}>
|
|
|
17
|
+ <RotateCw />
|
|
|
18
|
+ </IconButton>
|
|
|
19
|
+ <IconButton onClick={clear}>
|
|
|
20
|
+ <Trash2 />
|
|
|
21
|
+ </IconButton>
|
|
|
22
|
+ </Container>
|
|
|
23
|
+ )
|
|
|
24
|
+}
|
|
|
25
|
+
|
|
|
26
|
+const Container = styled('div', {
|
|
|
27
|
+ position: 'absolute',
|
|
|
28
|
+ bottom: 12,
|
|
|
29
|
+ right: 12,
|
|
|
30
|
+ backgroundColor: '$panel',
|
|
|
31
|
+ borderRadius: '4px',
|
|
|
32
|
+ overflow: 'hidden',
|
|
|
33
|
+ alignSelf: 'flex-end',
|
|
|
34
|
+ border: '1px solid $border',
|
|
|
35
|
+ pointerEvents: 'all',
|
|
|
36
|
+ userSelect: 'none',
|
|
|
37
|
+ zIndex: 200,
|
|
|
38
|
+ boxShadow: '0px 2px 12px rgba(0,0,0,.08)',
|
|
|
39
|
+ display: 'flex',
|
|
|
40
|
+ padding: 4,
|
|
|
41
|
+
|
|
|
42
|
+ '& svg': {
|
|
|
43
|
+ height: 13,
|
|
|
44
|
+ width: 13,
|
|
|
45
|
+ },
|
|
|
46
|
+})
|