diff --git a/src/components/posts/view-post/PostRewardStat.tsx b/src/components/posts/view-post/PostRewardStat.tsx index 109c03c7c..fdedeb14f 100644 --- a/src/components/posts/view-post/PostRewardStat.tsx +++ b/src/components/posts/view-post/PostRewardStat.tsx @@ -4,6 +4,7 @@ import clsx from 'clsx' import capitalize from 'lodash/capitalize' import { ComponentProps } from 'react' import { TbCoins } from 'react-icons/tb' +import { useIsMyAddress } from 'src/components/auth/MyAccountsContext' import { FormatBalance, formatBalanceToJsx } from 'src/components/common/balances' import { MINIMUM_LOCK } from 'src/config/constants' import { useSelectPost } from 'src/rtk/app/hooks' @@ -57,6 +58,7 @@ export default function PostRewardStat({ postId, ...props }: PostRewardStatProps const post = useSelectPost(postId) const isComment = post?.post.struct.isComment const owner = post?.post.struct.ownerId + const isMyPost = useIsMyAddress(post?.post.struct.ownerId) const { data: totalStake } = useFetchTotalStake(owner || '') if (!reward?.isNotZero) return null @@ -66,7 +68,7 @@ export default function PostRewardStat({ postId, ...props }: PostRewardStatProps return (
- {totalStakeAmount.isZero() ? ( + {totalStakeAmount.isZero() && isMyPost ? ( - earned + + {totalStakeAmount.isZero() ? 'could earn' : 'earned'} + )} diff --git a/src/components/substrate/SubstrateTxButton.tsx b/src/components/substrate/SubstrateTxButton.tsx index 34d16e73f..692989ae9 100644 --- a/src/components/substrate/SubstrateTxButton.tsx +++ b/src/components/substrate/SubstrateTxButton.tsx @@ -104,6 +104,7 @@ function TxButton({ children, parentProxyAddress, customNodeApi, + canUseProxy, ...antdProps }: TxButtonProps) { const { api: subsocialApi } = useSubstrate() @@ -308,7 +309,7 @@ function TxButton({ let account: AnyAccountId | KeyringSigner = accountId try { - if (accountId === useMyAccount.getState().address) { + if (accountId === useMyAccount.getState().address && canUseProxy) { // use proxy signer signer = undefined const keypairSigner = useMyAccount.getState().signer @@ -457,8 +458,8 @@ function TxButton({ {...antdProps} onClick={() => { if (!customNodeApi && !isFreeTx && !getIsUsingKeypairSigner(accountId ?? '')) { - openSignInModal(false) if (!accountId) { + openSignInModal(false) return setIsSending(false) } if (!hasTokens) { diff --git a/src/components/utils/TxButton.tsx b/src/components/utils/TxButton.tsx index 60eb91601..0c1f9a3b9 100644 --- a/src/components/utils/TxButton.tsx +++ b/src/components/utils/TxButton.tsx @@ -21,7 +21,12 @@ function ResolvedTxButton({ canUseProxy = true, ...props }: TxButtonProps) { const { isStorybook = false } = useStorybookContext() const parentProxyAddress = useMyAccount(state => state.parentProxyAddress) const address = useMyAccount(state => state.address) - const usedAddress = props.accountId || address || '' + let usedAddress = props.accountId || address || '' + if (props.accountId === parentProxyAddress && canUseProxy) { + usedAddress = address || '' + } else if (!canUseProxy) { + usedAddress = parentProxyAddress || address || '' + } return isStorybook ? ( diff --git a/src/pages/legal/content-policy.md b/src/pages/legal/content-policy.md index 9111c9029..fe950f04b 100644 --- a/src/pages/legal/content-policy.md +++ b/src/pages/legal/content-policy.md @@ -44,7 +44,7 @@ Content related to prohibited substances or weapons is not allowed. Content with the intention to harm the community, project, or other users is prohibited. -➕ **Report Violations** +### Report Violations If you’ve seen a post, message or comment which violates this code of conduct, please report it to the Grill moderators or administrators as soon as possible. We rely on our community to help keep the discussions respectful and productive. diff --git a/src/pages/legal/content-policy.tsx b/src/pages/legal/content-policy.tsx index 9ca08d504..5f5a1f70e 100644 --- a/src/pages/legal/content-policy.tsx +++ b/src/pages/legal/content-policy.tsx @@ -2,4 +2,4 @@ import React from 'react' import HtmlPage from 'src/components/utils/HtmlPage' import html from './content-policy.md' -export default React.memo(() => ) +export default React.memo(() => )