From 92a6af7983106653703d5f07089e12b02ca2d23c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 1 May 2020 11:39:03 +0200 Subject: [PATCH] Adjust council modals with column layout (#2666) * Adjust council modals with column layout * Adjust to council icon * Tip endorsement columns, remove duplicated Transfer modal --- .../page-accounts/src/Contacts/Address.tsx | 3 +- .../page-accounts/src/Sidebar/Sidebar.tsx | 3 +- packages/page-council/src/Motions/Close.tsx | 49 ++++--- packages/page-council/src/Motions/Motion.tsx | 2 + .../page-democracy/src/Overview/Voting.tsx | 15 +- .../page-treasury/src/Overview/Proposal.tsx | 7 +- .../page-treasury/src/Overview/Proposals.tsx | 4 +- .../page-treasury/src/Overview/Submission.tsx | 54 +++++--- .../page-treasury/src/Overview/TipEndorse.tsx | 44 ++++-- .../page-treasury/src/Overview/Voting.tsx | 57 +++++--- packages/page-treasury/src/Overview/index.tsx | 2 + .../react-components/src/ProposedAction.tsx | 2 +- packages/react-components/src/Transfer.tsx | 128 ------------------ packages/react-components/src/index.tsx | 1 - 14 files changed, 161 insertions(+), 210 deletions(-) delete mode 100644 packages/react-components/src/Transfer.tsx diff --git a/packages/page-accounts/src/Contacts/Address.tsx b/packages/page-accounts/src/Contacts/Address.tsx index c1a4709f33..62b5317f34 100644 --- a/packages/page-accounts/src/Contacts/Address.tsx +++ b/packages/page-accounts/src/Contacts/Address.tsx @@ -8,11 +8,12 @@ import { ActionStatus } from '@polkadot/react-components/Status/types'; import React, { useCallback, useEffect, useState } from 'react'; import styled from 'styled-components'; -import { AddressSmall, AddressInfo, Button, ChainLock, Icon, LinkExternal, Forget, Menu, Popup, Tag, Transfer } from '@polkadot/react-components'; +import { AddressSmall, AddressInfo, Button, ChainLock, Icon, LinkExternal, Forget, Menu, Popup, Tag } from '@polkadot/react-components'; import { useApi, useCall } from '@polkadot/react-hooks'; import keyring from '@polkadot/ui-keyring'; import { formatNumber } from '@polkadot/util'; +import Transfer from '../Accounts/modals/Transfer'; import { useTranslation } from '../translate'; interface Props { diff --git a/packages/page-accounts/src/Sidebar/Sidebar.tsx b/packages/page-accounts/src/Sidebar/Sidebar.tsx index ce35bd0565..3066f1d3a3 100644 --- a/packages/page-accounts/src/Sidebar/Sidebar.tsx +++ b/packages/page-accounts/src/Sidebar/Sidebar.tsx @@ -9,9 +9,10 @@ import styled from 'styled-components'; import { useAccountInfo, useApi, useRegistrars, useToggle } from '@polkadot/react-hooks'; import { classes } from '@polkadot/react-components/util'; import { colorLink } from '@polkadot/react-components/styles/theme'; -import { AccountName, AddressMini, AvatarItem, Button, Icon, IconLink, IdentityIcon, Input, InputTags, LinkExternal, Tag, Transfer } from '@polkadot/react-components'; +import { AccountName, AddressMini, AvatarItem, Button, Icon, IconLink, IdentityIcon, Input, InputTags, LinkExternal, Tag } from '@polkadot/react-components'; import { isHex } from '@polkadot/util'; +import Transfer from '../Accounts/modals/Transfer'; import { useTranslation } from '../translate'; import Flags from './Flags'; import RegistrarJudgement from './RegistrarJudgement'; diff --git a/packages/page-council/src/Motions/Close.tsx b/packages/page-council/src/Motions/Close.tsx index 7aa17ed4e0..638c7acdcb 100644 --- a/packages/page-council/src/Motions/Close.tsx +++ b/packages/page-council/src/Motions/Close.tsx @@ -6,44 +6,56 @@ import { Hash, Proposal, ProposalIndex } from '@polkadot/types/interfaces'; import React, { useState } from 'react'; import { Button, InputAddress, Modal, ProposedAction, TxButton } from '@polkadot/react-components'; -import { useAccounts, useToggle } from '@polkadot/react-hooks'; +import { useToggle } from '@polkadot/react-hooks'; import { useTranslation } from '../translate'; interface Props { hash: Hash; idNumber: ProposalIndex; + isDisabled: boolean; + members: string[]; proposal: Proposal; } -function Close ({ hash, idNumber, proposal }: Props): React.ReactElement | null { +function Close ({ hash, idNumber, isDisabled, members, proposal }: Props): React.ReactElement | null { const { t } = useTranslation(); - const { hasAccounts } = useAccounts(); const [isOpen, toggleOpen] = useToggle(); const [accountId, setAccountId] = useState(null); - if (!hasAccounts) { - return null; - } - return ( <> {isOpen && ( - - + + + + + +

{t('The proposal that will be affected. Once closed for the current voting round, it would need to be re-submitted to council for a subsequent voting round.')}

+
+
+ + + + + +

{t('The council account that will apply the close for the current round.')}

+
+
)}