fix: conditionally render pin button based on app ID
This commit is contained in:
parent
c0e25879e5
commit
725f81c165
@ -31,6 +31,7 @@ const PopupContainer: React.FC<Props> = ({ app, resolve }) => {
|
|||||||
useBridge()
|
useBridge()
|
||||||
|
|
||||||
const canOpenExternalLink = app.url.startsWith('http://') || app.url.startsWith('https://')
|
const canOpenExternalLink = app.url.startsWith('http://') || app.url.startsWith('https://')
|
||||||
|
const canPinned = !!app.id
|
||||||
|
|
||||||
const onClose = async (_delay = 0.3) => {
|
const onClose = async (_delay = 0.3) => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
@ -63,9 +64,11 @@ const PopupContainer: React.FC<Props> = ({ app, resolve }) => {
|
|||||||
<Button onClick={onReload}>
|
<Button onClick={onReload}>
|
||||||
<ReloadOutlined />
|
<ReloadOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={onTogglePin} className={isPinned ? 'pinned' : ''}>
|
{canPinned && (
|
||||||
<PushpinOutlined style={{ fontSize: 16 }} />
|
<Button onClick={onTogglePin} className={isPinned ? 'pinned' : ''}>
|
||||||
</Button>
|
<PushpinOutlined style={{ fontSize: 16 }} />
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
{canOpenExternalLink && (
|
{canOpenExternalLink && (
|
||||||
<Button onClick={onOpenLink}>
|
<Button onClick={onOpenLink}>
|
||||||
<ExportOutlined />
|
<ExportOutlined />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user