diff --git a/apps/dapp/components/CopyToClipboard.tsx b/apps/dapp/components/CopyToClipboard.tsx
index b2e461b70..7a1bca5f8 100644
--- a/apps/dapp/components/CopyToClipboard.tsx
+++ b/apps/dapp/components/CopyToClipboard.tsx
@@ -17,19 +17,20 @@ function concatAddressImpl(
return first + '...' + last
}
-function concatAddress(address: string) {
- const takeN = 7
+function concatAddress(address: string, takeN = 7): string {
return concatAddressImpl(address, takeN, takeN)
}
interface CopyToClipboardProps {
value: string
success?: string
+ takeN?: number
}
export function CopyToClipboard({
value,
success = 'Copied to clipboard!',
+ takeN,
}: CopyToClipboardProps) {
const [copied, setCopied] = useState(false)
return (
@@ -47,7 +48,7 @@ export function CopyToClipboard({
) : (
+ ?
+
+ Proposal +
+ ++ # {proposal.id.toString().padStart(6, '0')} +
++ Status +
+ +
+
+ You +
+ + {!memberWhenProposalCreated ? ( +
+
+
+
+
+ Unknown: {walletVote} +
+ ) : proposal.status === 'open' ? ( +Proposer
+ +TX
+Loading...
+ > + ) : !!proposalExecutionTXHash ? ( + <> + {CHAIN_TXN_URL_PREFIX ? ( + + TX +TX
+ )} + +- Proposal -
-- # {proposal.id.toString().padStart(6, '0')} -
-- Status -
-- Proposer -
-
-
TX
-Loading...
- > - ) : !!proposalExecutionTXHash ? ( - <> - {CHAIN_TXN_URL_PREFIX ? ( - - TX -TX
- )} -
-
- Your vote +
+ Ratio of votes
- {walletVote === WalletVote.Yes ? ( -
-
-
-
-
- Unknown: {walletVote} -
- ) : ( -- {proposal.status === 'open' ? 'Pending...' : 'None'} -
- )} - > - )} -- Ratio of votes -
- -- Yes{' '} - {turnoutYesPercent.toLocaleString(undefined, localeOptions)} - % -
, -- No{' '} - {turnoutNoPercent.toLocaleString(undefined, localeOptions)}% -
, - ] - .sort(() => yesVotes - noVotes) - .map((elem, idx) => ( -- Abstain{' '} - {turnoutAbstainPercent.toLocaleString( - undefined, - localeOptions - )} +
+ Yes{' '} + {turnoutYesPercent.toLocaleString(undefined, localeOptions)}% +
, ++ No {turnoutNoPercent.toLocaleString(undefined, localeOptions)} % -
-- Passing threshold:{' '} - {threshold.display} -
- -
- {turnoutYesPercent >= threshold.percent ? (
- <>
- Reached{' '}
-
- Turnout -
- -- {turnoutPercent.toLocaleString(undefined, localeOptions)}% -
-- Quorum:{' '} - {quorum.display} -
- -
- {turnoutPercent >= quorum.percent ? (
- <>
- Reached{' '}
-
- Turnout -
- -- Yes{' '} - {totalYesPercent.toLocaleString(undefined, localeOptions)}% -
, -- No {totalNoPercent.toLocaleString(undefined, localeOptions)} - % -
, - ] - .sort(() => yesVotes - noVotes) - .map((elem, idx) => ( -- Abstain{' '} - {totalAbstainPercent.toLocaleString(undefined, localeOptions)} - % -
-- Passing threshold:{' '} - {threshold.display} -
- -
- {totalYesPercent >= threshold.percent ? (
- <>
- Reached{' '}
-
+ Passing threshold:{' '} + {threshold.display} +
+ +
+ {turnoutYesPercent >= threshold.percent ? (
+ <>
+ Reached{' '}
+
+ Turnout +
- {expiresInSeconds !== undefined && expiresInSeconds > 0 && ( ++ {turnoutPercent.toLocaleString(undefined, localeOptions)}% +
++ Quorum: {quorum.display} +
+ +
+ {turnoutPercent >= quorum.percent ? (
+ <>
+ Reached{' '}
+
- Time left -
- -- {secondsToWdhms(expiresInSeconds, 2)} +
+ Turnout
- {maxVotingSeconds !== undefined && ( -+ Passing threshold:{' '} + {threshold.display} +
+ +
+ {totalYesPercent >= threshold.percent ? (
+ <>
+ Reached{' '}
+
Tie clarification
- -{"'Yes' will win a tie vote."}
-+ Time left +
+ ++ {secondsToWdhms(expiresInSeconds, 2)} +
+ + {maxVotingSeconds !== undefined && ( +Tie clarification
+ +{"'Yes' will win a tie vote."}
+All abstain clarification
+ {abstainVotes === turnoutTotal && ( +All abstain clarification
-- When all abstain, a proposal will fail. -
-+ When all abstain, a proposal will fail. +
+