Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

undo-redo.tsx 1023B

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