Update ActionButton.tsx (#320)

This commit is contained in:
Steve Ruiz 2021-11-20 10:48:18 +00:00 committed by GitHub
parent 0685ca3871
commit 8531971896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,7 @@ import {
StretchHorizontallyIcon, StretchHorizontallyIcon,
StretchVerticallyIcon, StretchVerticallyIcon,
BoxIcon, BoxIcon,
AngleIcon,
} from '@radix-ui/react-icons' } from '@radix-ui/react-icons'
import { DMContent } from '~components/Primitives/DropdownMenu' import { DMContent } from '~components/Primitives/DropdownMenu'
import { Divider } from '~components/Primitives/Divider' import { Divider } from '~components/Primitives/Divider'
@ -127,8 +128,8 @@ export function ActionButton(): JSX.Element {
app.moveToFront() app.moveToFront()
}, [app]) }, [app])
const handleDelete = React.useCallback(() => { const handleResetAngle = React.useCallback(() => {
app.delete() app.setShapeProps({ rotation: 0 })
}, [app]) }, [app])
const alignTop = React.useCallback(() => { const alignTop = React.useCallback(() => {
@ -231,9 +232,9 @@ export function ActionButton(): JSX.Element {
<PinTopIcon /> <PinTopIcon />
</Tooltip> </Tooltip>
</ToolButton> </ToolButton>
<ToolButton disabled={!hasSelection} onClick={handleDelete}> <ToolButton disabled={!hasSelection} onClick={handleResetAngle}>
<Tooltip label="Delete" kbd="⌫"> <Tooltip label="Reset Angle">
<TrashIcon /> <AngleIcon />
</Tooltip> </Tooltip>
</ToolButton> </ToolButton>
</ButtonsRow> </ButtonsRow>