kopia lustrzana https://github.com/Tldraw/Tldraw
Restores context menu
rodzic
f8b5906520
commit
e45977167a
|
@ -54,7 +54,7 @@ interface ContextMenuProps {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ContextMenu = React.memo(({ children }: ContextMenuProps): JSX.Element => {
|
export const ContextMenu = ({ children }: ContextMenuProps): JSX.Element => {
|
||||||
const { tlstate, useSelector } = useTLDrawContext()
|
const { tlstate, useSelector } = useTLDrawContext()
|
||||||
const hasSelection = useSelector(has1SelectedIdsSelector)
|
const hasSelection = useSelector(has1SelectedIdsSelector)
|
||||||
const hasTwoOrMore = useSelector(has2SelectedIdsSelector)
|
const hasTwoOrMore = useSelector(has2SelectedIdsSelector)
|
||||||
|
@ -225,7 +225,7 @@ export const ContextMenu = React.memo(({ children }: ContextMenuProps): JSX.Elem
|
||||||
</RadixContextMenu.Content>
|
</RadixContextMenu.Content>
|
||||||
</ContextMenuRoot>
|
</ContextMenuRoot>
|
||||||
)
|
)
|
||||||
})
|
}
|
||||||
|
|
||||||
function AlignDistributeSubMenu({
|
function AlignDistributeSubMenu({
|
||||||
hasThreeOrMore,
|
hasThreeOrMore,
|
||||||
|
@ -305,7 +305,6 @@ function AlignDistributeSubMenu({
|
||||||
<SpaceEvenlyHorizontallyIcon />
|
<SpaceEvenlyHorizontallyIcon />
|
||||||
</ContextMenuIconButton>
|
</ContextMenuIconButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ContextMenuIconButton onSelect={alignTop}>
|
<ContextMenuIconButton onSelect={alignTop}>
|
||||||
<AlignTopIcon />
|
<AlignTopIcon />
|
||||||
</ContextMenuIconButton>
|
</ContextMenuIconButton>
|
||||||
|
|
|
@ -19,7 +19,7 @@ import { Menu } from '~components/menu'
|
||||||
import { breakpoints, iconButton } from '~components'
|
import { breakpoints, iconButton } from '~components'
|
||||||
import { DotFilledIcon } from '@radix-ui/react-icons'
|
import { DotFilledIcon } from '@radix-ui/react-icons'
|
||||||
import { TLDR } from '~state/tldr'
|
import { TLDR } from '~state/tldr'
|
||||||
import { ContextMenu } from '@radix-ui/react-context-menu'
|
import { ContextMenu } from '~components/context-menu'
|
||||||
|
|
||||||
// Selectors
|
// Selectors
|
||||||
const isInSelectSelector = (s: Data) => s.appState.activeTool === 'select'
|
const isInSelectSelector = (s: Data) => s.appState.activeTool === 'select'
|
||||||
|
|
Ładowanie…
Reference in New Issue