From bf728f8716385749370de9a1edee50b267d61fa4 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Thu, 11 Mar 2021 12:56:34 -0500 Subject: [PATCH] update staked amount constants --- dist/bundle.es.js | 28 ++++++++++++++-------------- src/constants/claim.js | 10 +++++----- src/redux/selectors/claims.js | 18 +++++++++--------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 13e6571..bc8889d 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -12,11 +12,11 @@ const CHANNEL_ANONYMOUS = 'anonymous'; const CHANNEL_NEW = 'new'; const PAGE_SIZE = 20; -const LEVEL_1_STAKED_AMOUNT = 1; -const LEVEL_2_STAKED_AMOUNT = 2; -const LEVEL_3_STAKED_AMOUNT = 3; -const LEVEL_4_STAKED_AMOUNT = 4; -const LEVEL_5_STAKED_AMOUNT = 5; +const LEVEL_1_STAKED_AMOUNT = 0; +const LEVEL_2_STAKED_AMOUNT = 1; +const LEVEL_3_STAKED_AMOUNT = 50; +const LEVEL_4_STAKED_AMOUNT = 250; +const LEVEL_5_STAKED_AMOUNT = 1000; var claim = /*#__PURE__*/Object.freeze({ MINIMUM_PUBLISH_BID: MINIMUM_PUBLISH_BID, @@ -2683,19 +2683,19 @@ const makeSelectTotalStakedAmountForChannelUri = uri => reselect.createSelector( }); const makeSelectStakedLevelForChannelUri = uri => reselect.createSelector(makeSelectTotalStakedAmountForChannelUri(uri), amount => { - let level = LEVEL_1_STAKED_AMOUNT; + let level = 1; switch (true) { - case amount >= 1 && amount < 50: - level = LEVEL_2_STAKED_AMOUNT; + case amount >= LEVEL_2_STAKED_AMOUNT && amount < LEVEL_3_STAKED_AMOUNT: + level = 2; break; - case amount >= 50 && amount < 250: - level = LEVEL_3_STAKED_AMOUNT; + case amount >= LEVEL_3_STAKED_AMOUNT && amount < LEVEL_4_STAKED_AMOUNT: + level = 3; break; - case amount >= 250 && amount < 1000: - level = LEVEL_4_STAKED_AMOUNT; + case amount >= LEVEL_4_STAKED_AMOUNT && amount < LEVEL_5_STAKED_AMOUNT: + level = 4; break; - case amount >= 1000: - level = LEVEL_5_STAKED_AMOUNT; + case amount >= LEVEL_5_STAKED_AMOUNT: + level = 5; break; } return level; diff --git a/src/constants/claim.js b/src/constants/claim.js index 8e594e1..83ff7ed 100644 --- a/src/constants/claim.js +++ b/src/constants/claim.js @@ -4,8 +4,8 @@ export const CHANNEL_ANONYMOUS = 'anonymous'; export const CHANNEL_NEW = 'new'; export const PAGE_SIZE = 20; -export const LEVEL_1_STAKED_AMOUNT = 1; -export const LEVEL_2_STAKED_AMOUNT = 2; -export const LEVEL_3_STAKED_AMOUNT = 3; -export const LEVEL_4_STAKED_AMOUNT = 4; -export const LEVEL_5_STAKED_AMOUNT = 5; +export const LEVEL_1_STAKED_AMOUNT = 0; +export const LEVEL_2_STAKED_AMOUNT = 1; +export const LEVEL_3_STAKED_AMOUNT = 50; +export const LEVEL_4_STAKED_AMOUNT = 250; +export const LEVEL_5_STAKED_AMOUNT = 1000; diff --git a/src/redux/selectors/claims.js b/src/redux/selectors/claims.js index 3483630..5d2ae91 100644 --- a/src/redux/selectors/claims.js +++ b/src/redux/selectors/claims.js @@ -867,19 +867,19 @@ export const makeSelectStakedLevelForChannelUri = (uri: string) => createSelector( makeSelectTotalStakedAmountForChannelUri(uri), amount => { - let level = CLAIM.LEVEL_1_STAKED_AMOUNT; + let level = 1; switch (true) { - case amount >= 1 && amount < 50: - level = CLAIM.LEVEL_2_STAKED_AMOUNT; + case amount >= CLAIM.LEVEL_2_STAKED_AMOUNT && amount < CLAIM.LEVEL_3_STAKED_AMOUNT: + level = 2; break; - case amount >= 50 && amount < 250: - level = CLAIM.LEVEL_3_STAKED_AMOUNT; + case amount >= CLAIM.LEVEL_3_STAKED_AMOUNT && amount < CLAIM.LEVEL_4_STAKED_AMOUNT: + level = 3; break; - case amount >= 250 && amount < 1000: - level = CLAIM.LEVEL_4_STAKED_AMOUNT; + case amount >= CLAIM.LEVEL_4_STAKED_AMOUNT && amount < CLAIM.LEVEL_5_STAKED_AMOUNT: + level = 4; break; - case amount >= 1000: - level = CLAIM.LEVEL_5_STAKED_AMOUNT; + case amount >= CLAIM.LEVEL_5_STAKED_AMOUNT: + level = 5; break; } return level;