Open in desktop #6818
1 changed files with 7 additions and 5 deletions
|
@ -7,10 +7,10 @@ import React from 'react';
|
|||
import classnames from 'classnames';
|
||||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { useIsMobile } from 'effects/use-screensize';
|
||||
import { generateShareUrl, generateRssUrl, generateLbryContentUrl } from 'util/url';
|
||||
import { useHistory } from 'react-router';
|
||||
import { buildURI, parseURI, COLLECTIONS_CONSTS } from 'lbry-redux';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
const PAGE_VIEW_QUERY = `view`;
|
||||
const EDIT_PAGE = 'edit';
|
||||
|
@ -94,6 +94,8 @@ function ClaimMenuList(props: Props) {
|
|||
editedCollection,
|
||||
isAuthenticated,
|
||||
} = props;
|
||||
|
||||
const isMobile = useIsMobile();
|
||||
const incognitoClaim = contentChannelUri && !contentChannelUri.includes('@');
|
||||
const isChannel = !incognitoClaim && !contentSigningChannel;
|
||||
const { channelName } = parseURI(contentChannelUri);
|
||||
|
@ -229,7 +231,7 @@ function ClaimMenuList(props: Props) {
|
|||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`);
|
||||
}
|
||||
|
||||
function openInDesktop() {
|
||||
function handleOpenInDesktop() {
|
||||
// $FlowFixMe
|
||||
window.open(`/$/${PAGES.OPEN_IN_DESKTOP}/${contentClaim.name}/${contentClaim.claim_id}`, '_blank');
|
||||
}
|
||||
|
@ -416,11 +418,11 @@ function ClaimMenuList(props: Props) {
|
|||
</MenuItem>
|
||||
)}
|
||||
|
||||
{IS_WEB && (
|
||||
<MenuItem className="comment__menu-option" onSelect={openInDesktop}>
|
||||
{IS_WEB && !isMobile && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleOpenInDesktop}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DESKTOP} />
|
||||
{__('Open in desktop')}
|
||||
{__('Open in Desktop')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue