[fix] tool lock button in toolbar (#2009)
This PR fixes a missing tool lock button in the toolbar. ### Change Type - [x] `patch` — Bug fix
This commit is contained in:
parent
f7b325c48c
commit
f414548347
1 changed files with 3 additions and 9 deletions
|
@ -31,13 +31,11 @@ export const Toolbar = memo(function Toolbar() {
|
||||||
|
|
||||||
const activeToolId = useValue('current tool id', () => editor.currentToolId, [editor])
|
const activeToolId = useValue('current tool id', () => editor.currentToolId, [editor])
|
||||||
|
|
||||||
const isHandTool = activeToolId === 'hand'
|
|
||||||
const geoState = useValue('geo', () => editor.sharedStyles.getAsKnownValue(GeoShapeGeoStyle), [
|
const geoState = useValue('geo', () => editor.sharedStyles.getAsKnownValue(GeoShapeGeoStyle), [
|
||||||
editor,
|
editor,
|
||||||
])
|
])
|
||||||
|
|
||||||
const showEditingTools = !isReadonly
|
const showEditingTools = !isReadonly
|
||||||
const showExtraActions = !(isReadonly || isHandTool)
|
|
||||||
|
|
||||||
const getTitle = (item: TLUiToolItem) =>
|
const getTitle = (item: TLUiToolItem) =>
|
||||||
item.label ? `${msg(item.label)} ${item.kbd ? kbdStr(item.kbd) : ''}` : ''
|
item.label ? `${msg(item.label)} ${item.kbd ? kbdStr(item.kbd) : ''}` : ''
|
||||||
|
@ -110,13 +108,9 @@ export const Toolbar = memo(function Toolbar() {
|
||||||
<div className="tlui-toolbar">
|
<div className="tlui-toolbar">
|
||||||
<div className="tlui-toolbar__inner">
|
<div className="tlui-toolbar__inner">
|
||||||
<div className="tlui-toolbar__left">
|
<div className="tlui-toolbar__left">
|
||||||
{!isReadonly && breakpoint < 6 && !editor.isInAny('hand', 'zoom') && (
|
{!isReadonly && (
|
||||||
<div
|
<div className="tlui-toolbar__extras">
|
||||||
className={classNames('tlui-toolbar__extras', {
|
{breakpoint < 6 && !(activeToolId === 'hand' || activeToolId === 'zoom') && (
|
||||||
'tlui-toolbar__extras__hidden': !showExtraActions,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{breakpoint < 6 && !editor.isInAny('hand', 'zoom') && (
|
|
||||||
<div className="tlui-toolbar__extras__controls">
|
<div className="tlui-toolbar__extras__controls">
|
||||||
<UndoButton />
|
<UndoButton />
|
||||||
<RedoButton />
|
<RedoButton />
|
||||||
|
|
Loading…
Reference in a new issue