Skip to content

Commit

Permalink
refactor: rebrand ProposalStatusPill (#1948)
Browse files Browse the repository at this point in the history
* refactor: rebrand ProposalStatusPill

* Update packages/desktop/views/governance/components/ProposalStatusPill.svelte

Co-authored-by: Mark Nardi <[email protected]>

---------

Co-authored-by: Mark Nardi <[email protected]>
  • Loading branch information
jeeanribeiro and MarkNerdi authored Feb 15, 2024
1 parent 20f3755 commit 0a8c26f
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
import { visibleSelectedAccountTokens } from '@core/token/stores'
import { getBestTimeDuration, milestoneToDate } from '@core/utils'
import { PopupId, openPopup } from '@desktop/auxiliary/popup'
import { MarkdownBlock, Pane, ProposalStatusPill, Text, TextType } from '@ui'
import { ProposalStatusPill } from '@views/governance'
import { MarkdownBlock, Pane, Text, TextType } from '@ui'
import { onDestroy, onMount } from 'svelte'
const { metadata } = $visibleSelectedAccountTokens?.[$activeProfile?.network?.id]?.baseCoin ?? {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { ProposalStatusPill } from '@views/governance'
import { ProposalStatusTimelineTooltip } from '@components'
import { InformationTooltip, ProposalStatusPill } from '@ui'
import { InformationTooltip } from '@ui'
import { IProposal } from '@contexts/governance/interfaces'
import { localize } from '@core/i18n'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<script lang="ts">
import { EventStatus } from '@iota/sdk/out/types'
import { COLOR_PALETTE, Icon, IconName, Pill, Text } from '@bloomwalletio/ui'
import { localize } from '@core/i18n'
import { IProposal } from '@contexts/governance/interfaces'
export let proposal: IProposal
$: status = proposal?.status
$: error = proposal?.error
const STATUS_COLORS: Record<EventStatus, keyof typeof COLOR_PALETTE> = {
[EventStatus.Upcoming]: 'yellow',
[EventStatus.Commencing]: 'blue',
[EventStatus.Holding]: 'teal',
[EventStatus.Ended]: 'neutral',
}
</script>

{#if status}
<Pill color={STATUS_COLORS[status]}>
<div class="flex flex-row space-x-1 items-center">
{#if error}
<Icon name={IconName.CrossClose} textColor="danger" size="xs" />
{/if}
<Text textColor="current">{localize(`pills.governance.proposalStatus.${error ? error : status}`)}</Text>
</div>
</Pill>
{/if}
1 change: 1 addition & 0 deletions packages/desktop/views/governance/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as ProposalStatusPill } from './ProposalStatusPill.svelte'
export { default as ProposalStatusInfo } from './ProposalStatusInfo.svelte'
34 changes: 0 additions & 34 deletions packages/shared/src/components/pills/ProposalStatusPill.svelte

This file was deleted.

1 change: 0 additions & 1 deletion packages/shared/src/components/pills/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export { default as TimelockActivityPill } from './TimelockActivityPill.svelte'
export { default as UnclaimedActivityPill } from './UnclaimedActivityPill.svelte'
export { default as ActivityAsyncStatusPill } from './ActivityAsyncStatusPill.svelte'
export { default as NetworkStatusPill } from './NetworkStatusPill.svelte'
export { default as ProposalStatusPill } from './ProposalStatusPill.svelte'

0 comments on commit 0a8c26f

Please sign in to comment.