kopia lustrzana https://github.com/Tldraw/Tldraw
[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
rodzic
2f02daf37f
commit
f551528ddf
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue