From 3a09bb18e31a883650ba5c6f5f2164e49a2ad515 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Wed, 31 Mar 2021 16:01:49 +0800 Subject: [PATCH] Reporting: use upcoming new Page --- ui/component/claimMenuList/view.jsx | 7 ++++++- ui/component/fileActions/view.jsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index a5320670e..2675d2318 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -1,11 +1,13 @@ // @flow import { URL, SHARE_DOMAIN_URL } from 'config'; import * as ICONS from 'constants/icons'; +import * as PAGES from 'constants/pages'; import React from 'react'; import classnames from 'classnames'; import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button'; import Icon from 'component/common/icon'; import { generateShareUrl } from 'util/url'; +import { useHistory } from 'react-router'; const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL; @@ -33,6 +35,9 @@ function ClaimMenuList(props: Props) { doCommentModBlock, doCommentModUnBlock, } = props; + + const { push } = useHistory(); + const channelUri = claim && (claim.value_type === 'channel' @@ -62,7 +67,7 @@ function ClaimMenuList(props: Props) { } function handleReportContent() { - window.open(`https://lbry.com/dmca/${claim.claim_id}`, '_blank', 'noopener'); + push(`/$/${PAGES.REPORT_CONTENT}?claimId=${claim.claim_id}`); } return ( diff --git a/ui/component/fileActions/view.jsx b/ui/component/fileActions/view.jsx index 37acfbc85..c12a7206b 100644 --- a/ui/component/fileActions/view.jsx +++ b/ui/component/fileActions/view.jsx @@ -134,7 +134,7 @@ function FileActions(props: Props) { title={__('Report content')} className="button--file-action" icon={ICONS.REPORT} - href={`https://lbry.com/dmca/${claimId}`} + navigate={`/$/${PAGES.REPORT_CONTENT}?claimId=${claimId}`} /> )}