[fix] lock option for laser tool (#1460)

This PR removes the laser tool toggleShapeLocked button.

### Change Type

- [x] `patch` — Bug Fix

### Test Plan

1. Select laser tool.
2. Confirm that the toggle shape locked button is not visible.
pull/1450/head
Steve Ruiz 2023-05-25 16:36:12 +01:00 zatwierdzone przez GitHub
rodzic 2f02daf37f
commit f551528ddf
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 4 dodań i 13 usunięć

Wyświetl plik

@ -9,25 +9,16 @@ interface ToggleToolLockedButtonProps {
activeToolId?: string
}
export const ToggleToolLockedButton = function ToggleToolLockedButton({
activeToolId,
}: ToggleToolLockedButtonProps) {
const NOT_LOCKABLE_TOOLS = ['select', 'hand', 'draw', 'eraser', 'text', 'zoom', 'laser']
export function ToggleToolLockedButton({ activeToolId }: ToggleToolLockedButtonProps) {
const app = useApp()
const breakpoint = useBreakpoint()
const msg = useTranslation()
const isToolLocked = useValue('is tool locked', () => app.instanceState.isToolLocked, [app])
const isLockable = !(
activeToolId === 'select' ||
activeToolId === 'hand' ||
activeToolId === 'draw' ||
activeToolId === 'eraser' ||
activeToolId === 'text' ||
activeToolId === 'zoom'
)
if (!isLockable) return null
if (!activeToolId || NOT_LOCKABLE_TOOLS.includes(activeToolId)) return null
return (
<Button