From 9d821ae0f7d5332b4069cada305f734d31af64ed Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 13 Jul 2020 15:09:49 +0200 Subject: [PATCH] Adjust poll wording (#3176) * Adjust poll wording * Poll header * Adjust column widths * Result adjustment --- packages/page-poll/src/index.tsx | 33 ++++++++++++++--------- packages/react-components/src/Columar.tsx | 31 ++++++++++++++++----- 2 files changed, 46 insertions(+), 18 deletions(-) diff --git a/packages/page-poll/src/index.tsx b/packages/page-poll/src/index.tsx index 1b56f7638d..e04109ca8c 100644 --- a/packages/page-poll/src/index.tsx +++ b/packages/page-poll/src/index.tsx @@ -7,6 +7,7 @@ import { ITuple } from '@polkadot/types/types'; import BN from 'bn.js'; import React, { useEffect, useState } from 'react'; +import { Trans } from 'react-i18next'; import styled from 'styled-components'; import { Button, Columar, InputAddress, Progress, Spinner, Toggle, TxButton } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; @@ -47,26 +48,33 @@ function PollApp ({ className }: Props): React.ReactElement { const blocksLeft = (api.consts.poll.end as BlockNumber).sub(bestNumber); const canVote = blocksLeft.gt(BN_ZERO); - const options: [string, boolean, (value: boolean) => void][] = [ - [t('10 million DOTs; status quo'), opt10m, setOpt10m], - [t('100 million DOTs; 11 decimals'), opt100m, setOpt100m], - [t('1 billion DOTs; 10 decimals'), opt1b, setOpt1b], - [t('10 billion DOTs; 9 decimals'), opt10b, setOpt10b] + const options: [string, string, boolean, (value: boolean) => void][] = [ + [t('No change'), t('No change from the original 2017 sale definitions; will mean a total of 10m DOT from genesis.'), opt10m, setOpt10m], + [t('Split of 10x'), t('Split of 10x from the original sale; will mean a total of 100m DOT from genesis. Apparent DOT price would be 10x lower.'), opt100m, setOpt100m], + [t('Split of 100x'), t('Split of 100x from the original sale; will mean a total of 1b DOT from genesis. Apparent DOT price would be 100x lower.'), opt1b, setOpt1b], + [t('Split of 1000x'), t('Split of 1,000x from the original sale; will mean a total of 10b DOT from genesis. Apparent DOT price would be 1000x lower.'), opt10b, setOpt10b] ]; const hasValue = opt10m || opt100m || opt1b || opt10b; + /* eslint-disable react/jsx-max-props-per-line */ + return (
-

{t('poll on token decimals')}

+

{t('denomination vote')}

-

{t('This poll is setup to judge the sentiment of the Polkadot token holders in adjusting the number of decimals that is used to identify one full DOT. It does not change the overall supply, but rather just allows for a different representation of the current supply.')}

-

{t('You can indicate your vote for any combination of the options laid out below.')}

+

The Polkadot DOT denomination vote: Seventy-two hours after the DOT token becomes transferable, the most popular option from this poll will decide the denomination used for the DOT token.

+

This is an approval vote. There are four options and you may select any combination of them. The most popular of the four will be selected as the final DOT denomination three days after DOT token transfers are enabled.

+

Please see the Medium article for more information

- {options.map(([label, value, onChange], index) => - + {options.map(([label, desc, value, onChange], index) => +
{label}
+
{desc}
& { Column: React.ComponentType; }; -function Columar ({ children, className = '' }: Props): React.ReactElement { +function Columar ({ children, className = '', is60 }: Props): React.ReactElement { return ( -
+
{children}
); @@ -28,10 +29,28 @@ const ColumarExp = React.memo(styled(Columar)` display: flex; flex-wrap: wrap; - .ui--Column { - @media (min-width: 1025px) { - max-width: 50%; - min-width: 50%; + &.is50 { + .ui--Column { + @media (min-width: 1025px) { + max-width: 50%; + min-width: 50%; + } + } + } + + &.is60 { + .ui--Column:first-child { + @media (min-width: 1025px) { + max-width: 60%; + min-width: 60%; + } + } + + .ui--Column:last-child { + @media (min-width: 1025px) { + max-width: 40%; + min-width: 40%; + } } } `) as unknown as ColumarType;