Skip to content

Commit

Permalink
fix(airdrops): remove non-campaigns and fix stx amount
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Nov 30, 2021
1 parent 680da61 commit 130317c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,39 @@ const getQuantity = (amt, coin) => {
})
}

const MissedCampaign = ({ campaign }) => {
// filter out non-airdrops
if (campaign.campaignName === 'MONETARY_INCENTIVE' || campaign.campaignName === 'MIAMI_2021') {
return null
}
// no campaign transactions but show some info anyway
return (
<TableRow>
<TableCell width='18%'>
<Type {...campaign} />
</TableCell>
<TableCell width='18%'>
<Status {...campaign} />
</TableCell>
<TableCell width='18%'>
<Text size='14px' weight={500}>
-
</Text>
</TableCell>
<TableCell width='18%'>
<To {...campaign} />
</TableCell>
<TableCell width='28%'>
<Text>-</Text>
</TableCell>
</TableRow>
)
}

export default function Success({ userCampaignsInfoResponseList }: Props) {
const completedCampaigns = userCampaignsInfoResponseList.filter(
(campaign) => campaign.campaignState === 'ENDED'
)

return (
<div style={{ minWidth: '500px', paddingBottom: '45px' }}>
<Table style={{ minWidth: '500px' }}>
Expand Down Expand Up @@ -86,26 +114,7 @@ export default function Success({ userCampaignsInfoResponseList }: Props) {
)
})
) : (
// No campaign transactions but show some info anyway
<TableRow>
<TableCell width='18%'>
<Type {...campaign} />
</TableCell>
<TableCell width='18%'>
<Status {...campaign} />
</TableCell>
<TableCell width='18%'>
<Text size='14px' weight={500}>
-
</Text>
</TableCell>
<TableCell width='18%'>
<To {...campaign} />
</TableCell>
<TableCell width='28%'>
<Text>-</Text>
</TableCell>
</TableRow>
<MissedCampaign campaign={campaign} />
)
})}
</Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const calcStxAmount = (stxCampaign) => {
stxCampaign.userCampaignTransactionResponseList.length &&
stxCampaign.userCampaignTransactionResponseList[0].withdrawalQuantity
if (!stxAmount) return
return new BigNumber(stxAmount).dividedBy(10000000).toString().concat(' STX')
return new BigNumber(stxAmount).dividedBy(1000000).toString().concat(' STX')
}

export const StxDateOrAmount = ({ stxCampaign }: { stxCampaign: CampaignInfoType }) => {
Expand Down

0 comments on commit 130317c

Please sign in to comment.