Skip to content

Commit

Permalink
Hide delegation column if not governance
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Feb 2, 2024
1 parent 26c79c3 commit 2ea9ecc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/membersList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand All @@ -32,6 +34,11 @@ export const MembersList: React.FC<MembersListProps> = ({
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 =
Expand Down Expand Up @@ -94,7 +101,7 @@ export const MembersList: React.FC<MembersListProps> = ({
{t('community.listHeader.votingPower')}
</TableCellHead>
)}
{showDelegationHeaders && (
{showDelegationHeaders && isGovernanceEnabled && (
<TableCellHead>
{t('community.listHeader.delegations')}
</TableCellHead>
Expand Down

0 comments on commit 2ea9ecc

Please sign in to comment.