Open in desktop #6667
3 changed files with 17 additions and 27 deletions
|
@ -2056,6 +2056,5 @@
|
|||
"Show reply": "Show reply",
|
||||
"Show %count% replies": "Show %count% replies",
|
||||
"Open in Desktop": "Open in Desktop",
|
||||
"Open in Web": "Open in Web",
|
||||
"--end--": "--end--"
|
||||
}
|
||||
|
|
|
@ -226,10 +226,6 @@ function ClaimMenuList(props: Props) {
|
|||
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`);
|
||||
}
|
||||
|
||||
function handleOpenInWeb() {
|
||||
window.open(shareUrl);
|
||||
}
|
||||
|
||||
function handleOpenInDesktop() {
|
||||
window.open(claim.permanent_url);
|
||||
}
|
||||
|
@ -408,12 +404,14 @@ function ClaimMenuList(props: Props) {
|
|||
</MenuItem>
|
||||
)}
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={IS_WEB ? handleOpenInDesktop : handleOpenInWeb}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={IS_WEB ? ICONS.DESKTOP : ICONS.WEB} />
|
||||
{IS_WEB ? __('Open in Desktop') : __('Open in Web')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
{IS_WEB && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleOpenInDesktop}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DESKTOP} />
|
||||
{__('Open in Desktop')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
|
||||
<div className="menu__link">
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import { URL, SHARE_DOMAIN_URL, SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import { SITE_NAME, ENABLE_FILE_REACTIONS } from 'config';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
@ -16,9 +16,6 @@ import FileReactions from 'component/fileReactions';
|
|||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { webDownloadClaim } from 'util/downloadClaim';
|
||||
import { generateShareUrl, generateLbryContentUrl } from 'util/url';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
|
@ -70,8 +67,6 @@ function FileActions(props: Props) {
|
|||
const { signing_channel: signingChannel } = claim;
|
||||
const channelName = signingChannel && signingChannel.name;
|
||||
const fileName = claim && claim.value && claim.value.source && claim.value.source.name;
|
||||
const lbryUrl = generateLbryContentUrl(claim.canonical_url, claim.permanent_url);
|
||||
const shareUrl = generateShareUrl(SHARE_DOMAIN, lbryUrl);
|
||||
|
||||
// We want to use the short form uri for editing
|
||||
// This is what the user is used to seeing, they don't care about the claim id
|
||||
|
@ -118,10 +113,6 @@ function FileActions(props: Props) {
|
|||
}
|
||||
}
|
||||
|
||||
function handleOpenInWeb() {
|
||||
window.open(shareUrl);
|
||||
}
|
||||
|
||||
function handleOpenInDesktop() {
|
||||
window.open(claim.permanent_url);
|
||||
}
|
||||
|
@ -201,12 +192,14 @@ function FileActions(props: Props) {
|
|||
</MenuItem>
|
||||
)}
|
||||
{/* @endif */}
|
||||
<MenuItem className="comment__menu-option" onSelect={IS_WEB ? handleOpenInDesktop : handleOpenInWeb}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={IS_WEB ? ICONS.DESKTOP : ICONS.WEB} />
|
||||
{IS_WEB ? __('Open in Desktop') : __('Open in Web')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
{IS_WEB && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleOpenInDesktop}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.DESKTOP} />
|
||||
{__('Open in Desktop')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
{!claimIsMine && (
|
||||
<MenuItem
|
||||
className="comment__menu-option"
|
||||
|
|
Loading…
Reference in a new issue