Open in desktop #6667

Closed
btzr-io wants to merge 13 commits from protocol into master
4 changed files with 27 additions and 0 deletions
Showing only changes of commit d320a07d8b - Show all commits

View file

@ -2053,5 +2053,9 @@
"Commenting...": "Commenting...", "Commenting...": "Commenting...",
"Reset": "Reset", "Reset": "Reset",
"Reset to original (previous) publish date": "Reset to original (previous) publish date", "Reset to original (previous) publish date": "Reset to original (previous) publish date",
"Show reply": "Show reply",
"Show %count% replies": "Show %count% replies",
"Open in Desktop": "Open in Desktop",
"Open in Web": "Open in Web",
"--end--": "--end--" "--end--": "--end--"
} }

View file

@ -226,6 +226,14 @@ function ClaimMenuList(props: Props) {
push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`); push(`/$/${PAGES.REPORT_CONTENT}?claimId=${contentClaim && contentClaim.claim_id}`);
} }
function handleOpenInWeb() {
window.open(shareUrl);
}
function handleOpenInDesktop() {
window.open(claim.permanent_url);
}
return ( return (
<Menu> <Menu>
<MenuButton <MenuButton
@ -400,6 +408,13 @@ function ClaimMenuList(props: Props) {
</MenuItem> </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>
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}> <MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
<div className="menu__link"> <div className="menu__link">
<Icon aria-hidden icon={ICONS.SHARE} /> <Icon aria-hidden icon={ICONS.SHARE} />

View file

@ -2323,4 +2323,11 @@ export const icons = {
<path d="M4.954 14.753l3.535 3.535-1.768 1.768-3.535-3.535z" /> <path d="M4.954 14.753l3.535 3.535-1.768 1.768-3.535-3.535z" />
</g> </g>
), ),
[ICONS.DESKTOP]: buildIcon(
<g>
<rect x="2" y="3" width="20" height="14" rx="2" ry="2" />
<line x1="8" y1="21" x2="16" y2="21" />
<line x1="12" y1="17" x2="12" y2="21" />
</g>
),
}; };

View file

@ -165,3 +165,4 @@ export const GLOBE = 'globe';
export const RSS = 'rss'; export const RSS = 'rss';
export const STAR = 'star'; export const STAR = 'star';
export const MUSIC = 'MusicCategory'; export const MUSIC = 'MusicCategory';
export const DESKTOP = 'desktop';