From e2c5bfaf7263574b77d4e666e529f654c5a13692 Mon Sep 17 00:00:00 2001 From: selankon Date: Thu, 27 Jun 2024 17:02:43 +0200 Subject: [PATCH] Fix show connect button for blind csp --- src/components/Process/Aside.tsx | 2 -- src/components/Process/Chained.tsx | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Process/Aside.tsx b/src/components/Process/Aside.tsx index 6beb0a7..d434617 100644 --- a/src/components/Process/Aside.tsx +++ b/src/components/Process/Aside.tsx @@ -7,7 +7,6 @@ import { TFunction } from 'i18next' import { Trans, useTranslation } from 'react-i18next' import { Link as ReactRouterLink } from 'react-router-dom' import { useAccount } from 'wagmi' -import BlindCSPConnect from './BlindCSPConnect' import { CensusMeta } from './Census/CensusType' const results = (result: number, decimals?: number) => @@ -217,7 +216,6 @@ export const VoteButton = ({ ...props }: FlexProps) => { px={{ base: 3, lg2: 0 }} {...props} > - {isBlindCsp && !connected && } {census?.type !== 'spreadsheet' && !isBlindCsp && !connected && ( {({ account, chain, openConnectModal, authenticationStatus, mounted }) => { diff --git a/src/components/Process/Chained.tsx b/src/components/Process/Chained.tsx index c8f4edd..0d10514 100644 --- a/src/components/Process/Chained.tsx +++ b/src/components/Process/Chained.tsx @@ -8,6 +8,7 @@ import { Trans } from 'react-i18next' import { VoteButton } from './Aside' import { ChainedProvider, useChainedProcesses } from './ChainedContext' import { ConfirmVoteModal } from './ConfirmVoteModal' +import BlindCSPConnect from '~components/Process/BlindCSPConnect' type ChainedProcessesInnerProps = { connected: boolean @@ -113,12 +114,15 @@ const ChainedProcessesWrapper = () => { return } + const isBlindCsp = election.get('census.type') === 'csp' && election?.meta.csp?.service === 'vocdoni-blind-csp' + return ( <> {!connected && election.get('census.type') === 'spreadsheet' && } + {isBlindCsp && !connected && } ) }