Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal discussion fixes #3969

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
17 changes: 11 additions & 6 deletions packages/ui/src/app/pages/Proposals/ProposalPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { PageTitle } from '@/common/components/page/PageTitle'
import { PreviousPage } from '@/common/components/page/PreviousPage'
import { SidePanel } from '@/common/components/page/SidePanel'
import { Label, TextInlineMedium, TextMedium } from '@/common/components/typography'
import { TokenValue } from '@/common/components/typography/TokenValue'
import { camelCaseToText } from '@/common/helpers'
import { useModal } from '@/common/hooks/useModal'
import { useRefetchQueries } from '@/common/hooks/useRefetchQueries'
Expand All @@ -40,20 +41,19 @@ import { VoteRationaleModalCall } from '@/proposals/modals/VoteRationale/types'
import { proposalPastStatuses } from '@/proposals/model/proposalStatus'

export const ProposalPreview = () => {
const { id } = useParams<{ id: string }>()
const history = useHistory()
const { id } = useParams<{ id: string }>()
const { isLoading, proposal } = useProposal(id)
const { council } = useElectedCouncil()
const constants = useProposalConstants(proposal?.details.type)
const loc = useLocation()
const voteId = new URLSearchParams(loc.search).get('showVote')
const blocksToProposalExecution = useBlocksToProposalExecution(proposal, constants)
useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal])

const { council } = useElectedCouncil()
const loc = useLocation()
const voteId = new URLSearchParams(loc.search).get('showVote')
const votingRounds = useVotingRounds(proposal?.votes, proposal?.proposalStatusUpdates)
const [currentVotingRound, setVotingRound] = useState(0)

const votes = votingRounds[currentVotingRound] ?? votingRounds[0]
useRefetchQueries({ interval: MILLISECONDS_PER_BLOCK, include: ['getProposal', 'GetProposalVotes'] }, [proposal])
traumschule marked this conversation as resolved.
Show resolved Hide resolved
const notVoted = useMemo(() => {
if (
!proposal ||
Expand Down Expand Up @@ -198,6 +198,11 @@ export const ProposalPreview = () => {
<Label>Proposer</Label>
<MemberInfo member={proposal.proposer} />
</RowGapBlock>

<RowGapBlock gap={16}>
<Label>Stake</Label>
{constants ? <TokenValue value={constants.requiredStake} /> : 'Loading...'}
</RowGapBlock>
</RowGapBlock>
</SidePanel>
}
Expand Down