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