From fbb438361843b0975e2a15dd33bc727efc606fb2 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 21 Apr 2020 07:39:39 +0200 Subject: [PATCH] Add council close proposal button (#2595) --- packages/page-council/src/Motions/Close.tsx | 67 ++++++++++++++++++++ packages/page-council/src/Motions/Motion.tsx | 29 ++++++--- 2 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 packages/page-council/src/Motions/Close.tsx diff --git a/packages/page-council/src/Motions/Close.tsx b/packages/page-council/src/Motions/Close.tsx new file mode 100644 index 0000000000..7aa17ed4e0 --- /dev/null +++ b/packages/page-council/src/Motions/Close.tsx @@ -0,0 +1,67 @@ +// Copyright 2017-2020 @polkadot/app-council authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +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 { useTranslation } from '../translate'; + +interface Props { + hash: Hash; + idNumber: ProposalIndex; + proposal: Proposal; +} + +function Close ({ hash, idNumber, 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 && ( + + + + + + + + + + )} +