Skip to content

Commit

Permalink
show council rules iff council isnt dormant (#1843)
Browse files Browse the repository at this point in the history
  • Loading branch information
asktree authored Sep 29, 2023
1 parent e35eb02 commit c0ed604
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions components/treasuryV2/Details/WalletDetails/Info/Rules/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ScaleIcon,
UserGroupIcon,
} from '@heroicons/react/outline'
import { VoteThresholdType, VoteTipping } from '@solana/spl-governance'
import { GoverningTokenType, VoteTipping } from '@solana/spl-governance'
import cx from 'classnames'
import { useRouter } from 'next/router'

Expand All @@ -29,6 +29,7 @@ import {
useRealmCouncilMintInfoQuery,
} from '@hooks/queries/mintInfo'
import { useLegacyVoterWeight } from '@hooks/queries/governancePower'
import { useRealmConfigQuery } from '@hooks/queries/realmConfig'

const UNIX_SECOND = 1
const UNIX_MINUTE = UNIX_SECOND * 60
Expand Down Expand Up @@ -93,17 +94,18 @@ export default function Rules(props: Props) {
const router = useRouter()
const { symbol } = router.query
const { fmtUrlWithCluster } = useQueryContext()
const realmConfig = useRealmConfigQuery().data?.result

const programVersion = useProgramVersion()

const governanceConfig = props.wallet.governanceAccount?.account.config

const communityEnabled =
governanceConfig &&
governanceConfig.communityVoteThreshold.type !== VoteThresholdType.Disabled
realmConfig?.account.communityTokenConfig.tokenType !==
GoverningTokenType.Dormant
const councilEnabled =
governanceConfig &&
governanceConfig.councilVoteThreshold.type !== VoteThresholdType.Disabled
realmConfig?.account.councilTokenConfig.tokenType !==
GoverningTokenType.Dormant

const canEditRules =
ownVoterWeight &&
Expand Down

1 comment on commit c0ed604

@vercel
Copy link

@vercel vercel bot commented on c0ed604 Sep 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.