From 9e00a7de1100fa736e63f2e463ed0a8a181eaf12 Mon Sep 17 00:00:00 2001 From: Jaco Date: Fri, 6 Jan 2023 10:00:19 +0200 Subject: [PATCH] Expander on treasury rows (#8704) --- .../page-treasury/src/Overview/Proposal.tsx | 91 +++++++++++-------- 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/packages/page-treasury/src/Overview/Proposal.tsx b/packages/page-treasury/src/Overview/Proposal.tsx index ac6e105965..a6474f043c 100644 --- a/packages/page-treasury/src/Overview/Proposal.tsx +++ b/packages/page-treasury/src/Overview/Proposal.tsx @@ -5,8 +5,8 @@ import type { DeriveTreasuryProposal } from '@polkadot/api-derive/types'; import React, { useMemo } from 'react'; -import { AddressMini, AddressSmall, LinkExternal, Table } from '@polkadot/react-components'; -import { useApi } from '@polkadot/react-hooks'; +import { AddressSmall, Columar, LinkExternal, Table } from '@polkadot/react-components'; +import { useApi, useToggle } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { isFunction } from '@polkadot/util'; @@ -24,6 +24,7 @@ interface Props { function ProposalDisplay ({ className = '', isMember, members, proposal: { council, id, proposal }, withSend }: Props): React.ReactElement { const { t } = useTranslation(); const { api } = useApi(); + const [isExpanded, toggleIsExpanded] = useToggle(false); const hasCouncil = isFunction(api.tx.council?.propose); const hasProposals = useMemo( @@ -35,41 +36,59 @@ function ProposalDisplay ({ className = '', isMember, members, proposal: { counc ); return ( - - - - - - - - - - - - - - - - {hasCouncil - ? hasProposals - ? {t('Voting')} - : withSend && ( - - ) - : null - } - - - + + + + + + + + + + + + + + + + {hasCouncil + ? hasProposals + ? {t('Voting')} + : withSend && ( + + ) + : null + } + + - - + + + + + + + + + + + + + ); }