From 6629ea604199eccdc9d5c5479fe81aefa34ce208 Mon Sep 17 00:00:00 2001 From: saltrafael Date: Sat, 12 Jun 2021 10:46:04 -0300 Subject: [PATCH] final code touches --- ui/component/claimMenuList/view.jsx | 42 +++++++++++++++-------------- ui/modal/modalRevokeClaim/view.jsx | 8 +++--- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ui/component/claimMenuList/view.jsx b/ui/component/claimMenuList/view.jsx index 37ae3a368..92a285b13 100644 --- a/ui/component/claimMenuList/view.jsx +++ b/ui/component/claimMenuList/view.jsx @@ -82,7 +82,7 @@ function ClaimMenuList(props: Props) { } = props; const incognito = channelUri && !(channelUri.includes('@')); const signingChannel = claim && (claim.signing_channel || claim); - const permanentUrl = String(signingChannel && signingChannel.permanent_url); + const permanentUrl = String(channelUri); const isChannel = !incognito && signingChannel === claim; const showDelete = claimIsMine || (fileInfo && (fileInfo.written_bytes > 0 || fileInfo.blobs_completed > 0)); const subscriptionLabel = isSubscribed ? __('Unfollow') : __('Follow'); @@ -138,7 +138,6 @@ function ClaimMenuList(props: Props) { if (!isChannel) { const signingChannelName = signingChannel && signingChannel.name; - let editUri; const uriObject: { streamName: string, streamClaimId: string, channelName?: string } = { streamName: claim.name, streamClaimId: claim.claim_id, @@ -146,7 +145,7 @@ function ClaimMenuList(props: Props) { if (signingChannelName) { uriObject.channelName = signingChannelName; } - editUri = buildURI(uriObject); + const editUri = buildURI(uriObject); push(`/$/${PAGES.UPLOAD}`); prepareEdit(claim, editUri, fileInfo); @@ -160,7 +159,7 @@ function ClaimMenuList(props: Props) { if (!isRepost && !isChannel) { openModal(MODALS.CONFIRM_FILE_REMOVE, { uri }); } else { - openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: !isRepost && (() => replace(`/$/${PAGES.CHANNELS}`)), isRepost }); + openModal(MODALS.CONFIRM_CLAIM_REVOKE, { claim, cb: !isRepost && (() => replace(`/$/${PAGES.CHANNELS}`)) }); } } @@ -189,14 +188,14 @@ function ClaimMenuList(props: Props) { - {!incognito && (!claimIsMine ? (!isChannelPage && + {!incognito && !isRepost && (!claimIsMine ? (!isChannelPage &&
{subscriptionLabel}
- ) : (!isRepost && + ) : (
@@ -205,15 +204,6 @@ function ClaimMenuList(props: Props) { ))} - {!isChannelPage && ( - -
- - {__('Support')} -
-
- )} - {hasExperimentalUi && ( <> {/* WATCH LATER */} @@ -273,15 +263,25 @@ function ClaimMenuList(props: Props) {
)} - {!isChannelPage && ( -
- )} + + )} + + {!isChannelPage && ( + <> + +
+ + {__('Support')} +
+
+
)} {!isMyCollection && ( <> - {(!claimIsMine || channelIsBlocked) && channelUri ? !incognito && ( + {(!claimIsMine || channelIsBlocked) && channelUri + ? !incognito && !isRepost && ( <>
@@ -318,7 +318,9 @@ function ClaimMenuList(props: Props) { )} )} -
+ {!isRepost && ( +
+ )} )} diff --git a/ui/modal/modalRevokeClaim/view.jsx b/ui/modal/modalRevokeClaim/view.jsx index 757140176..d720b0b9e 100644 --- a/ui/modal/modalRevokeClaim/view.jsx +++ b/ui/modal/modalRevokeClaim/view.jsx @@ -15,17 +15,15 @@ type Props = { tx: Txo, claim: GenericClaim, cb: () => void, - isRepost: boolean, }; export default function ModalRevokeClaim(props: Props) { - const { tx, claim, closeModal, abandonTxo, abandonClaim, cb, isRepost } = props; + const { tx, claim, closeModal, abandonTxo, abandonClaim, cb } = props; const { value_type: valueType, type, normalized_name: name, is_my_input: isSupport } = tx || claim; const [channelName, setChannelName] = useState(''); - const shouldConfirmChannel = !isRepost && ( - valueType === txnTypes.CHANNEL || type === txnTypes.CHANNEL || (type === txnTypes.UPDATE && name.startsWith('@')) - ); + const shouldConfirmChannel = + valueType === txnTypes.CHANNEL || type === txnTypes.CHANNEL || (type === txnTypes.UPDATE && name.startsWith('@')); function getButtonLabel(type: string, isSupport: boolean) { if (isSupport && type === txnTypes.SUPPORT) {