-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
113 additions
and
42 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 40 additions & 26 deletions
66
src/components/creatorsStaking/utils/StakingInfoBanner.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/components/creatorsStaking/utils/getAmountRangeForAnalytics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { convertToBalanceWithDecimal } from '../../common/balances/utils' | ||
|
||
const getAmountRange = (decimals: number, amount?: string) => { | ||
if (!amount || amount === '0') return '0' | ||
|
||
const amountWithDecimals = convertToBalanceWithDecimal(amount, decimals) | ||
|
||
if (amountWithDecimals.lte(2000)) { | ||
return 'up to 2000' | ||
} else if (amountWithDecimals.lte(10000)) { | ||
return 'up to 10000' | ||
} else if (amountWithDecimals.lte(50000)) { | ||
return 'up to 50000' | ||
} else if (amountWithDecimals.lte(100000)) { | ||
return 'up to 100000' | ||
} else if (amountWithDecimals.lte(500000)) { | ||
return 'up to 500000' | ||
} else if (amountWithDecimals.lte(1000000)) { | ||
return 'up to 1000000' | ||
} else { | ||
return 'more than 1000000' | ||
} | ||
} | ||
|
||
export default getAmountRange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters