2
0

🐛 (editor) Fix bug preventing user to manually zoom in / out

Closes #156
This commit is contained in:
Baptiste Arnaud
2022-11-06 10:21:20 +01:00
parent 6dd7bd9562
commit 1f44e8f31f
3 changed files with 30 additions and 12 deletions

View File

@ -1,13 +1,15 @@
import { Stack, IconButton } from '@chakra-ui/react'
import { PlusIcon, MinusIcon } from 'assets/icons'
import { memo } from 'react'
import { headerHeight } from '../TypebotHeader'
type Props = {
onZoomIn: () => void
onZoomOut: () => void
onZoomInClick: () => void
onZoomOutClick: () => void
}
export const ZoomButtons = memo(({ onZoomIn, onZoomOut }: Props) => (
export const ZoomButtons = ({
onZoomInClick: onZoomIn,
onZoomOutClick: onZoomOut,
}: Props) => (
<Stack
pos="fixed"
top={`calc(${headerHeight}px + 70px)`}
@ -20,7 +22,7 @@ export const ZoomButtons = memo(({ onZoomIn, onZoomOut }: Props) => (
>
<IconButton
icon={<PlusIcon />}
aria-label={'Zoom out'}
aria-label={'Zoom in'}
size="sm"
onClick={onZoomIn}
bgColor="white"
@ -35,4 +37,4 @@ export const ZoomButtons = memo(({ onZoomIn, onZoomOut }: Props) => (
borderTopRadius={0}
/>
</Stack>
))
)