Files
bot/apps/builder/src/features/graph/components/ZoomButtons.tsx

41 lines
987 B
TypeScript
Raw Normal View History

import { Stack, IconButton, useColorModeValue } from '@chakra-ui/react'
import { PlusIcon, MinusIcon } from '@/components/icons'
import { headerHeight } from '@/features/editor/constants'
2022-04-08 14:30:46 -05:00
type Props = {
onZoomInClick: () => void
onZoomOutClick: () => void
2022-04-08 14:30:46 -05:00
}
export const ZoomButtons = ({
onZoomInClick: onZoomIn,
onZoomOutClick: onZoomOut,
}: Props) => (
2022-04-08 14:30:46 -05:00
<Stack
pos="fixed"
top={`calc(${headerHeight}px + 70px)`}
right="40px"
bgColor={useColorModeValue('white', 'gray.900')}
2022-04-08 14:30:46 -05:00
rounded="md"
zIndex={1}
spacing="0"
shadow="lg"
>
<IconButton
icon={<PlusIcon />}
aria-label={'Zoom in'}
2022-04-08 14:30:46 -05:00
size="sm"
onClick={onZoomIn}
bgColor={useColorModeValue('white', undefined)}
2022-04-08 14:30:46 -05:00
borderBottomRadius={0}
/>
<IconButton
icon={<MinusIcon />}
aria-label={'Zoom out'}
size="sm"
onClick={onZoomOut}
bgColor={useColorModeValue('white', undefined)}
2022-04-08 14:30:46 -05:00
borderTopRadius={0}
/>
</Stack>
)