Skip to content

Commit

Permalink
update icon for campaign that has bonus multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoYhun committed Sep 13, 2023
1 parent 0c4618c commit 202d1bf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/assets/svg/star_multiplier.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion src/pages/Campaign/CampaignItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import { Flex, Text } from 'rebass'
import styled, { CSSProperties, css } from 'styled-components'

import { ReactComponent as GrantCampaignIcon } from 'assets/svg/grant_campaign.svg'
import { ReactComponent as StarMultiplierIcon } from 'assets/svg/star_multiplier.svg'
import ProgressBar from 'components/ProgressBar'
import { MouseoverTooltip } from 'components/Tooltip'
import { DEFAULT_SIGNIFICANT, RESERVE_USD_DECIMALS } from 'constants/index'
import { NETWORKS_INFO } from 'constants/networks'
import useTheme from 'hooks/useTheme'
import { CampaignData, CampaignStatus, CampaignUserInfoStatus } from 'state/campaigns/actions'
import { CampaignData, CampaignStatus, CampaignUserInfoStatus, ConditionGroupsType } from 'state/campaigns/actions'
import { useIsDarkMode } from 'state/user/hooks'

import CampaignActions from './CampaignActions'
Expand Down Expand Up @@ -148,6 +149,9 @@ function CampaignItem({ campaign, onSelectCampaign, isSelected, style }: Campaig
(isPassedVolume && !tradingNumberRequired) ||
(isPassedNumberOfTrade && !tradingVolumeRequired)
const { showProgressBarVolume, showProgressBarNumberTrade, isShowProgressBar } = getCampaignInfo(campaign, account)
const hasBonusMultiplier = !!campaign?.conditionGroups?.find(
item => item.type === ConditionGroupsType.POINT_MULTIPLIER,
)

return (
<CampaignItemWrapper
Expand All @@ -173,6 +177,11 @@ function CampaignItem({ campaign, onSelectCampaign, isSelected, style }: Campaig
<GrantCampaignIcon width="16px" height="16px" />
</MouseoverTooltip>
) : null}
{hasBonusMultiplier && (
<MouseoverTooltip placement="top" text={<Trans>Point multiplier is in effect</Trans>}>
<StarMultiplierIcon />
</MouseoverTooltip>
)}
<CampaignStatusText status={campaign.status}>{rCampaignStatus}</CampaignStatusText>
</Flex>
</Container>
Expand Down
11 changes: 11 additions & 0 deletions src/state/campaigns/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ export interface CampaignLuckyWinner {
token: SerializedToken
}

export enum ConditionGroupsType {
POINT_MULTIPLIER = 'POINT_MULTIPLIER',
}
export interface ConditionGroups {
conditions?: any[]
extra?: any
priority: number
type: ConditionGroupsType
}

export interface CampaignData {
id: number
name: string
Expand All @@ -115,6 +125,7 @@ export interface CampaignData {
tradingNumberRequired: number
competitionId?: number
competitorId?: number
conditionGroups?: ConditionGroups[]
}

export interface CampaignProofData {
Expand Down

0 comments on commit 202d1bf

Please sign in to comment.