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()
|
||||
|
||||
const canOpenExternalLink = app.url.startsWith('http://') || app.url.startsWith('https://')
|
||||
const canPinned = !!app.id
|
||||
|
||||
const onClose = async (_delay = 0.3) => {
|
||||
setOpen(false)
|
||||
@ -63,9 +64,11 @@ const PopupContainer: React.FC<Props> = ({ app, resolve }) => {
|
||||
<Button onClick={onReload}>
|
||||
<ReloadOutlined />
|
||||
</Button>
|
||||
{canPinned && (
|
||||
<Button onClick={onTogglePin} className={isPinned ? 'pinned' : ''}>
|
||||
<PushpinOutlined style={{ fontSize: 16 }} />
|
||||
</Button>
|
||||
)}
|
||||
{canOpenExternalLink && (
|
||||
<Button onClick={onOpenLink}>
|
||||
<ExportOutlined />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user