From 2ea9ecc0d0580fafef50a4539cd9f12d007f2e34 Mon Sep 17 00:00:00 2001 From: selankon Date: Fri, 2 Feb 2024 10:38:28 +0100 Subject: [PATCH] Hide delegation column if not governance --- src/components/membersList/index.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/membersList/index.tsx b/src/components/membersList/index.tsx index 5b7cecf98..a0305cbb0 100644 --- a/src/components/membersList/index.tsx +++ b/src/components/membersList/index.tsx @@ -12,6 +12,8 @@ import styled from 'styled-components'; import {useScreen} from '@aragon/ods-old'; import {useTranslation} from 'react-i18next'; import {featureFlags} from 'utils/featureFlags'; +import {useGaslessGovernanceEnabled} from '../../hooks/useGaslessGovernanceEnabled'; +import {useDaoDetailsQuery} from '../../hooks/useDaoDetails'; type MembersListProps = { members: DaoMember[]; @@ -32,6 +34,11 @@ export const MembersList: React.FC = ({ const {isDesktop} = useScreen(); const {t} = useTranslation(); + // Gasless voting plugin support non wrapped tokens + // Used to hide delegation column in case of gasless voting plugin + const {data: daoDetails} = useDaoDetailsQuery(); + const {isGovernanceEnabled} = useGaslessGovernanceEnabled(daoDetails); + const isTokenBasedDao = token != null; const useCompactMode = isCompactMode ?? !isDesktop; const enableDelegation = @@ -94,7 +101,7 @@ export const MembersList: React.FC = ({ {t('community.listHeader.votingPower')} )} - {showDelegationHeaders && ( + {showDelegationHeaders && isGovernanceEnabled && ( {t('community.listHeader.delegations')}