mirror of
https://github.com/logseq/logseq.git
synced 2026-05-29 15:09:41 +00:00
chore: remove toolbar component
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import * as React from 'react'
|
||||
import { observer } from 'mobx-react-lite'
|
||||
import { useApp } from '@tldraw/react'
|
||||
import type { Shape } from '../../lib'
|
||||
|
||||
export const ToolBar = observer(function ToolBar(): JSX.Element {
|
||||
const app = useApp<Shape>()
|
||||
|
||||
const zoomIn = React.useCallback(() => {
|
||||
app.api.zoomIn()
|
||||
}, [app])
|
||||
|
||||
const zoomOut = React.useCallback(() => {
|
||||
app.api.zoomOut()
|
||||
}, [app])
|
||||
|
||||
const resetZoom = React.useCallback(() => {
|
||||
app.api.resetZoom()
|
||||
}, [app])
|
||||
|
||||
const zoomToFit = React.useCallback(() => {
|
||||
app.api.zoomToFit()
|
||||
}, [app])
|
||||
|
||||
const zoomToSelection = React.useCallback(() => {
|
||||
app.api.zoomToSelection()
|
||||
}, [app])
|
||||
|
||||
const sendToBack = React.useCallback(() => {
|
||||
app.sendToBack()
|
||||
}, [app])
|
||||
|
||||
const sendBackward = React.useCallback(() => {
|
||||
app.sendBackward()
|
||||
}, [app])
|
||||
|
||||
const bringToFront = React.useCallback(() => {
|
||||
app.bringToFront()
|
||||
}, [app])
|
||||
|
||||
const bringForward = React.useCallback(() => {
|
||||
app.bringForward()
|
||||
}, [app])
|
||||
|
||||
const flipHorizontal = React.useCallback(() => {
|
||||
app.flipHorizontal()
|
||||
}, [app])
|
||||
|
||||
const flipVertical = React.useCallback(() => {
|
||||
app.flipVertical()
|
||||
}, [app])
|
||||
|
||||
return (
|
||||
<div className="tl-toolbar">
|
||||
<button onClick={sendToBack}>Send to Back</button>
|
||||
<button onClick={sendBackward}>Send Backward</button>
|
||||
<button onClick={bringForward}>Bring Forward</button>
|
||||
<button onClick={bringToFront}>Bring To Front</button>|<button onClick={zoomOut}>-</button>
|
||||
<button onClick={zoomIn}>+</button>
|
||||
<button onClick={resetZoom}>reset</button>
|
||||
<button onClick={zoomToFit}>zoom to fit</button>
|
||||
<button onClick={zoomToSelection}>zoom to selection</button>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
@@ -1 +0,0 @@
|
||||
export * from './ToolBar'
|
||||
@@ -22,20 +22,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.tl-toolbar {
|
||||
@apply absolute top-0 w-full flex;
|
||||
|
||||
grid-row: 1;
|
||||
align-items: center;
|
||||
padding: 8px;
|
||||
color: black;
|
||||
z-index: 100000;
|
||||
user-select: none;
|
||||
background: white;
|
||||
border-bottom: 1px solid var(--ls-secondary-border-color);
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.tl-context-menu-button {
|
||||
@apply flex items-center px-4 py-1 text-sm !important;
|
||||
|
||||
@@ -50,7 +36,7 @@
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: var(--ls-secondary-background-color) !important;
|
||||
background-color: var(--ls-primary-background-color) !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +53,7 @@
|
||||
z-index: 180;
|
||||
min-width: 220px;
|
||||
pointer-events: 'all';
|
||||
background: var(--ls-primary-background-color);
|
||||
background: var(--ls-secondary-background-color);
|
||||
}
|
||||
|
||||
.tl-context-menu-right-slot {
|
||||
@@ -115,7 +101,7 @@
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.tl-button-bar {
|
||||
.tl-toolbar {
|
||||
@apply relative flex text-sm;
|
||||
|
||||
pointer-events: all;
|
||||
@@ -841,7 +827,7 @@ html[data-theme='dark'] {
|
||||
}
|
||||
}
|
||||
|
||||
.tl-contextbar-separator {
|
||||
.tl-toolbar-separator {
|
||||
background-color: var(--ls-border-color);
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user