Skip to content

Commit

Permalink
fix: hide open page button on whiteboard blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc authored and tiensonqin committed Dec 28, 2022
1 parent 9d4497b commit 2010ccf
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Side } from '@radix-ui/react-popper'
import { validUUID } from '@tldraw/core'
import { useApp } from '@tldraw/react'
import React from 'react'

import { observer } from 'mobx-react-lite'
Expand Down Expand Up @@ -31,6 +32,7 @@ function ShapeLinkItem({
onRemove?: () => void
showContent?: boolean
}) {
const app = useApp<Shape>()
const { handlers } = React.useContext(LogseqContext)

return (
Expand All @@ -39,9 +41,11 @@ function ShapeLinkItem({
<BlockLink id={id} showReferenceContent={showContent} />
</div>
<div className="flex-1" />
<Button tooltip="Open Page" type="button" onClick={() => handlers?.redirectToPage(id)}>
<TablerIcon name="open-as-page" />
</Button>
{handlers.getBlockPageName(id) !== app.currentPage.name && (
<Button tooltip="Open Page" type="button" onClick={() => handlers?.redirectToPage(id)}>
<TablerIcon name="open-as-page" />
</Button>
)}
<Button
tooltip="Open Page in Right Sidebar"
type="button"
Expand Down

0 comments on commit 2010ccf

Please sign in to comment.