Skip to content

Commit

Permalink
🥊 Fix the first stage of multi round proposals (#4387)
Browse files Browse the repository at this point in the history
Fix the first stage of multi round proposals
  • Loading branch information
thesan authored May 30, 2023
1 parent 7c4ffc2 commit 8151c6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/ui/src/proposals/components/ProposalStages.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { last } from 'lodash'
import React, { useMemo } from 'react'

import { ControlProps } from '@/common/components/forms'
import { CheckboxIcon, CrossIcon } from '@/common/components/icons'
import { TabContainer, TabsContainer } from '@/common/components/Tabs'
import { Tooltip } from '@/common/components/Tooltip'
import { last, repeat } from '@/common/utils'
import { repeat } from '@/common/utils'
import { ProposalStatus, ProposalStatusUpdates } from '@/proposals/types'

export interface ProposalStagesProps extends ControlProps<number> {
Expand All @@ -21,9 +22,9 @@ export const ProposalStages = ({ status, updates, constitutionality, value, onCh
// `decidingCount` is ("deciding updates" + 1) because the first deciding stage isn't included in updates
const decidingCount = updates.filter(({ status }) => status === 'deciding').length + 1

const lastUpdate = last(updates).status
const onGoing = lastUpdate === status
const approved = lastUpdate === 'gracing'
const latestUpdate = last(updates)?.status
const onGoing = !latestUpdate || latestUpdate === status
const approved = latestUpdate === 'gracing'
const rejected = !onGoing && !approved
const isDormant = onGoing && status === 'dormant'

Expand Down

2 comments on commit 8151c6e

@vercel
Copy link

@vercel vercel bot commented on 8151c6e May 30, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

pioneer-2-storybook – ./

pioneer-2-storybook.vercel.app
pioneer-2-storybook-git-dev-joystream.vercel.app
pioneer-2-storybook-joystream.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8151c6e May 30, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

pioneer-2 – ./

pioneer-2.vercel.app
pioneer-2-joystream.vercel.app
pioneer-2-git-dev-joystream.vercel.app

Please sign in to comment.