Skip to content

Commit

Permalink
Fix: APP-2551 - Crowdin Issues (#1085)
Browse files Browse the repository at this point in the history
* resolve crowdin issues

* Update common.json to latest, fix 2 errors via CrowdIn, fix error in code

* Update PrivacyPolicy

* resolve comments

* fix lint errors

* remove membersLoading

* remove plugin settings props for SetupMultisigVotingForm

* fix lint errors

* resolve second round of comments

* resolve comments round 3

* fix lint errors

* resolve lint errors

---------

Co-authored-by: James Ellis-Jones <[email protected]>
sepehr2github and jamesej authored Oct 27, 2023
1 parent 06098ab commit 50c5b13
Showing 8 changed files with 107 additions and 55 deletions.
23 changes: 21 additions & 2 deletions src/containers/gatingMenu/index.tsx
Original file line number Diff line number Diff line change
@@ -16,13 +16,17 @@ import {useNetwork} from 'context/network';
import {PluginTypes} from 'hooks/usePluginClient';
import WalletIcon from 'public/wallet.svg';
import {Governance, Community} from 'utils/paths';
import {Erc20WrapperTokenDetails} from '@aragon/sdk-client';
import {toDisplayEns} from 'utils/library';
import {
Erc20WrapperTokenDetails,
MajorityVotingSettings,
} from '@aragon/sdk-client';
import {formatUnits, toDisplayEns} from 'utils/library';
import {useExistingToken} from 'hooks/useExistingToken';
import {htmlIn} from 'utils/htmlIn';
import {useGovTokensWrapping} from 'context/govTokensWrapping';
import {useDaoDetailsQuery} from 'hooks/useDaoDetails';
import {useDaoToken} from 'hooks/useDaoToken';
import {useVotingSettings} from 'services/aragon-sdk/queries/use-voting-settings';

export const GatingMenu: React.FC = () => {
const {close, isOpen} = useGlobalModalContext('gating');
@@ -40,6 +44,11 @@ export const GatingMenu: React.FC = () => {
const {data: daoToken} = useDaoToken(plugins?.[0].instanceAddress);
const {isDAOTokenWrapped} = useExistingToken({daoDetails, daoToken});

const {data: votingSettings} = useVotingSettings({
pluginAddress: plugins?.[0].instanceAddress,
pluginType: plugins?.[0].id as PluginTypes,
});

const handleCloseMenu = () => {
const governancePath = generatePath(Governance, {network, dao: daoName});
navigate(governancePath);
@@ -61,6 +70,13 @@ export const GatingMenu: React.FC = () => {
(daoToken as Erc20WrapperTokenDetails | undefined)?.underlyingToken
?.symbol || '';

const minProposalThreshold = Number(
formatUnits(
(votingSettings as MajorityVotingSettings)?.minProposerVotingPower ?? 0,
daoToken?.decimals as number
)
);

return (
<ModalBottomSheetSwitcher isOpen={isOpen} onClose={handleCloseMenu}>
<ModalBody>
@@ -86,7 +102,10 @@ export const GatingMenu: React.FC = () => {
<WarningTitle>{t('alert.gatingUsers.tokenTitle')}</WarningTitle>
<WarningDescription>
{t('alert.gatingUsers.tokenDescription', {
daoName: daoName,
tokenName: daoToken?.name,
amount: minProposalThreshold,
tokenSymbol: daoToken?.symbol,
})}
</WarningDescription>
</WarningContainer>
14 changes: 7 additions & 7 deletions src/containers/privacyPolicy/privacyPolicyContent.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import styled from 'styled-components';
import {useTranslation} from 'react-i18next';
import {ButtonText, Link} from '@aragon/ods-old';
import {ButtonText} from '@aragon/ods-old';
import {htmlIn} from 'utils/htmlIn';

type PrivacyPolicyContentProps = {
isDesktop: boolean;
@@ -18,12 +19,11 @@ const PrivacyPolicyContent: React.FC<PrivacyPolicyContentProps> = ({

return (
<>
<Text>
{t('privacyPolicy.content')}{' '}
<span className="capitalize">
<Link label={t('privacyPolicy.title')} href="#" />.
</span>
</Text>
<Text
dangerouslySetInnerHTML={{
__html: htmlIn(t)('privacyPolicy.content'),
}}
/>

<ButtonGroup>
<ButtonText
3 changes: 2 additions & 1 deletion src/containers/setupCommunity/createNewToken.tsx
Original file line number Diff line number Diff line change
@@ -92,7 +92,8 @@ const CreateNewToken: React.FC = () => {
<DescriptionContainer>
<Label
label={t('labels.distributeTokens')}
helpText={t('createDAO.step3.distributeTokensHelpertext')}
helpText={htmlIn(t)('createDAO.step3.distributeTokensHelpertext')}
renderHtml={true}
/>
</DescriptionContainer>
<AlertInline
2 changes: 1 addition & 1 deletion src/containers/setupVotingForm/index.tsx
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import {
import SetupMultisigVotingForm from './multisig';
import SetupTokenVotingForm from './tokenVoting';

type Props = {
export type Props = {
pluginSettings: SupportedVotingSettings;
};

4 changes: 2 additions & 2 deletions src/containers/setupVotingForm/tokenVoting.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ import {Controller, useFormContext, useWatch} from 'react-hook-form';
import {useTranslation} from 'react-i18next';
import styled from 'styled-components';

import {VotingSettings} from '@aragon/sdk-client';
import DateTimeSelector from 'containers/dateTimeSelector';
import Duration, {DurationLabel} from 'containers/duration';
import UtcMenu from 'containers/utcMenu';
@@ -21,9 +20,10 @@ import {
import {DateTimeErrors} from './dateTimeErrors';
import {ToggleCheckList, UtcInstance} from './multisig';
import {ProposalFormData} from 'utils/types';
import {MajorityVotingSettings} from '@aragon/sdk-client';

type Props = {
pluginSettings: VotingSettings;
pluginSettings: MajorityVotingSettings;
};

const MAX_DURATION_MILLS = MAX_DURATION_DAYS * MINS_IN_DAY * 60 * 1000;
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@ import styled from 'styled-components';
import ModalBottomSheetSwitcher from 'components/modalBottomSheetSwitcher';
import ModalHeader from 'components/modalHeader';
import {StateEmpty} from 'components/stateEmpty';
import {htmlIn} from 'utils/htmlIn';

type Props = {
isOpen: boolean;
@@ -35,7 +36,8 @@ const EmptyState: React.FC<Props> = props => {
type="Object"
object="smart_contract"
title={t('scc.emptyState.title')}
description={t('scc.emptyState.description')}
description={htmlIn(t)('scc.emptyState.description')}
renderHtml
primaryButton={{
label: t('scc.emptyState.ctaLabel'),
onClick: () => {
107 changes: 67 additions & 40 deletions src/locales/en/common.json
Original file line number Diff line number Diff line change
@@ -475,8 +475,8 @@
"buttonLabel": "Connect wallet now"
},
"gatingUsers": {
"tokenTitle": "Token not found",
"tokenDescription": "The wallet does not contain '{{tokenName}}' token. Please ensure that you have the necessary tokens in order to continue.",
"tokenTitle": "You can’t create a proposal",
"tokenDescription": "You don’t have the required voting power or token balance. Creating proposals in {{daoName}} requires at least {{amount}} ‘{{tokenSymbol}}’ in either voting power or token balance.",
"walletTitle": "Wallet not allowlisted",
"walletDescription": "The connected wallet is not allowlisted. Please connect a valid wallet in order to proceed with the process.",
"buttonLabel": "Ok, understood"
@@ -769,7 +769,14 @@
"descriptionLinkLabel": "read this guide",
"descriptionLinkURL": "https://aragon.org/how-to/set-up-your-dao-governance-in-8-steps",
"distributeTokensHelpertextLinkLabel": "read our guide",
"distributeTokensHelpertextLinkURL": "https://aragon.org/how-to/distribute-a-dao-governance-token"
"distributeTokensHelpertextLinkURL": "https://aragon.org/how-to/distribute-a-dao-governance-token",
"blockChainVoting": {
"label": "On what blockchain will community voting take place?",
"optionOnchainLabel": "{{blockchainName}}",
"optionOnchainDesc": "Voting on proposals will require your community members to sign transactions and pay {{blockchainName}} gas fees. Proposals that pass a community vote can be executed by anyone.",
"optionGaslessLabel": "Vocdoni",
"optionGaslessDesc": "Voting on proposals will allow your community members to vote on a voting-specific proof-of-authority blockchain without paying any gas fees. Proposals that pass a community vote must be approved by an Execution Multisig before being executed on {{blockchainName}}."
}
},
"step4": {
"label": "Step 4",
@@ -1001,65 +1008,64 @@
"toggleFilter": {
"Favourites": "Following",
"allDAOs": "All DAOs ",
"memberOf": "Member of",
"delegate": "Delegate duties"
"member": "Member"
},
"inputPlaceholder": {
"searchDAOs": "Search DAOs"
"searchDAOs": "Search by name or address"
},
"searchDropwdown": {
"labelAmountDAOs": "{{amount}} DAOs"
},
"emptyStateSearch": {
"ctaLabel": "Reset search",
"title": "No results to show",
"description": "No DAOs found for this search term."
},
"sortOption": {
"mostActive": "Sort by Most active ",
"blockchain": "Sort by Blockchain",
"treasurySize": "Sort by Treasury size"
"ctaLabel": "Clear filters & search",
"title": "No results",
"description": "No DAOs match your filters."
},
"modal": {
"filterDAOs": {
"title": "Filter DAOs",
"label": {
"blockchains": "Blockchains",
"DAOtype": "DAO type",
"treasurySize": "Treasury size",
"base": "Base",
"allChains": "All chains",
"polygon": "Polygon",
"ethereum": {
"label": "Ethereum"
},
"member": {
"label": "Member"
},
"tokenVoting": "Token voting",
"anyGovernance": "Any governance",
"1M": "> $1.000.000",
"1K": "> $1.000",
"anySize": "Any size",
"10M": "$10M"
"tokenVoting": "Token-based",
"ethereum": "Ethereum",
"ethereumGoerli": "Ethereum Goerli",
"baseGoerli": "Base Goerli",
"polygonMumbai": "Polygon Mumbai",
"member": "Wallet-based",
"governanceType": "Governance type"
},
"ctaLabel": {
"see0": "See 0 DAOs",
"see{{amount}}": "See {{amount}} DAOs",
"seeAll": "See all DAOs"
},
"buttonLabel": {
"resetFilters": "Reset filters"
"clearFilters": "Clear filters"
},
"ctaLoading": "Filtering DAOs..."
},
"filterDAOS": {
"label": {
"showTesnets": "Show testnets"
}
}
},
"pagination": {
"label": {
"amountOf DAOs": "{{x}} of {{x-amount}} DAOs"
"amountOf DAOs": "{{amount}} of {{total}}"
}
},
"search": {
"labelAmount": "Found {{x}} DAOs"
"labelAmount": "{{amount}} DAOs"
},
"sortBy": {
"largestTreasury": "Sort by largest treasury",
"mostProposals": "Sort by most proposals",
"largestCommunity": "Sort by largest community",
"recentlyCreated": "Sort by recently created"
}
},
"privacyPolicy": {
@@ -1073,8 +1079,8 @@
"rejectAllCookies": "Reject all",
"acceptSelectedCookies": "Accept",
"content": "We use cookies and similar technologies to improve your experience, enable certain features, and analyze our application usage. You may opt-out of cookies here. Learn more in our {{link}}.",
"linkLabel": "privacy policy",
"linkURL": "https://aragon.org/privacy-policy"
"contentLinkURL": "https://aragon.org/privacy-policy",
"contentLinkLabel": "privacy policy"
},
"transactionDetail": {
"title": "Transaction detail",
@@ -1299,9 +1305,9 @@
},
"dappConnect": {
"title": "Select dApp",
"desc": "You can interact with the following dApps to add actions to your proposal. Learn more about this {{link}}.",
"desc": "You can interact with the following dApps to add actions to your proposal. Learn more about {{link}}.",
"descLinkLabel": "in our guide",
"descLinkURL": "https://aragon.org/how-to/swap-tokens-with-cowswap",
"descLinkURL": "https://",
"validation": {
"codeInputHelp": "To connect, open {{dappName}}, copy the WalletConnect QR code to your clipboard, and paste it here.",
"modalTitle": "{{dappName}}",
@@ -1317,18 +1323,18 @@
"alertCriticalQRcode": "The QR code provided is not from {{dappName}}."
},
"detaildApp": {
"spinnerLabel": "Listening for actions ",
"spinnerLabel": "Listening for actions…",
"desc": "You can can interact with {{dappName}}. Actions you take will be added to this proposal.",
"noActionsTag": "No actions received yet",
"amountActionsTag": "{{amountActions}} actions received",
"ctaLabel": "Add {{amountActions}} actions"
},
"ctaOpenDapp": "Open {{dappName}}",
"ctaDisconnectDapp": "Disconnect {{dappName}}",
"dAppConnectedLabel": "Connected",
"headerTitle": "Select dApp",
"headerDesc": "You can interact with the following dApps to add actions to your proposal. Learn more about {{link}}.",
"alertInfo": "More dApps coming soon!"
"alertInfo": "More dApps coming soon!",
"ctaDisconnectDapp": "Disconnect {{dappName}}"
}
},
"scc": {
@@ -1458,7 +1464,7 @@
"optionCopyAddress": "Copy address",
"optionBlockExplorer": "View on block explorer",
"optionDelegate": "Delegate to",
"optionUndelegate": "Undelegate"
"optionChangeDelegation": "Change delegation"
},
"actionItemVoter": {
"labelVoteWasChanged": "Vote was changed"
@@ -1499,7 +1505,8 @@
}
},
"label": {
"exportCSV": "Export to CSV"
"exportCSV": "Export to CSV",
"executionMultisig": "Execution multisig"
},
"tokenAmount": {
"InputLabel": "Tokens",
@@ -1623,5 +1630,25 @@
"labelOs": "Operating system",
"labelGovernance": "Governance"
}
},
"addAction": {
"configureActions": {
"AlertCritical": {
"title": "Action may fail",
"desc": "Even if the proposal passes, this action may fail if it is executed after {{date time}}"
}
}
},
"createDao": {
"stepCommunityVoting": {
"title": "Community voting parameters",
"desc": "Establish the conditions that determine the passage of a proposal during the initial community voting phase. How much support does the proposal need? How much of the community needs to participate? How long is the proposal open for voting? Learn more about in {{this guide}}."
},
"executionMultisig": {
"title": "Define your execution multisig",
"desc": "To bring the offchain results onchain, a execution multisig is needed to validate the results and perform the optional actions of a proposal. Learn more about the execution multisig and its tasks in {{link}}.",
"membersLabel": "Execution multisig members",
"membersDesc": "These addresses form the governing body that approves and executes proposals passed by the community. Add the addresses who will be members of the execution multisig."
}
}
}
5 changes: 4 additions & 1 deletion src/pages/mintTokens.tsx
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ import {useVotingSettings} from 'services/aragon-sdk/queries/use-voting-settings
import {toDisplayEns} from 'utils/library';
import {Community} from 'utils/paths';
import {MintTokensFormData} from 'utils/types';
import {MajorityVotingSettings} from '@aragon/sdk-client';

export const MintToken: React.FC = () => {
const {data: daoDetails, isLoading} = useDaoDetailsQuery();
@@ -110,7 +111,9 @@ export const MintToken: React.FC = () => {
wizardDescription={t('newWithdraw.setupVoting.description')}
isNextButtonDisabled={!setupVotingIsValid(errors)}
>
<SetupVotingForm pluginSettings={votingSettings} />
<SetupVotingForm
pluginSettings={votingSettings as MajorityVotingSettings}
/>
</Step>
<Step
wizardTitle={t('newWithdraw.defineProposal.heading')}

0 comments on commit 50c5b13

Please sign in to comment.