Skip to content

Commit fb01169

Browse files
feat: runepool granular flags (#8665)
1 parent b3ef25a commit fb01169

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

.env.base

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ REACT_APP_FEATURE_ARBITRUM_BRIDGE_CLAIMS=true
4141
REACT_APP_FEATURE_USDT_APPROVAL_RESET=true
4242
REACT_APP_FEATURE_PORTALS_SWAPPER=true
4343
REACT_APP_FEATURE_RUNEPOOL=true
44+
REACT_APP_FEATURE_RUNEPOOL_DEPOSIT=true
45+
REACT_APP_FEATURE_RUNEPOOL_WITHDRAW=true
4446
REACT_APP_FEATURE_MARKETS=true
4547
REACT_APP_FEATURE_FOX_PAGE=true
4648
REACT_APP_FEATURE_FOX_PAGE_RFOX=true

src/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ const validators = {
165165
REACT_APP_FEATURE_ARBITRUM_BRIDGE_CLAIMS: bool({ default: false }),
166166
REACT_APP_FEATURE_USDT_APPROVAL_RESET: bool({ default: false }),
167167
REACT_APP_FEATURE_RUNEPOOL: bool({ default: false }),
168+
REACT_APP_FEATURE_RUNEPOOL_DEPOSIT: bool({ default: false }),
169+
REACT_APP_FEATURE_RUNEPOOL_WITHDRAW: bool({ default: false }),
168170
REACT_APP_FEATURE_MARKETS: bool({ default: false }),
169171
REACT_APP_PORTALS_BASE_URL: url(),
170172
REACT_APP_ZERION_BASE_URL: url(),

src/features/defi/providers/thorchain-savers/components/ThorchainSaversManager/Overview/ThorchainSaversOverview.tsx

+12-2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ export const ThorchainSaversOverview: React.FC<OverviewProps> = ({
145145
const isThorchainSaversDepositEnabled = useFeatureFlag('SaversVaultsDeposit')
146146
const isThorchainSaversWithdrawalsEnabled = useFeatureFlag('SaversVaultsWithdraw')
147147

148+
const isRunePoolDepositEnabled = useFeatureFlag('RunePoolDeposit')
149+
const isRunepoolWithdrawEnabled = useFeatureFlag('RunePoolWithdraw')
150+
148151
useEffect(() => {
149152
if (!maybeAccountId) return
150153
handleAccountIdChange(maybeAccountId)
@@ -335,15 +338,22 @@ export const ThorchainSaversOverview: React.FC<OverviewProps> = ({
335338
hasPendingTxs,
336339
hasPendingQueries,
337340
isHaltedDeposits: isTradingActive === false,
338-
isDisabledDeposits: isThorchainSaversDepositEnabled === false,
339-
isDisabledWithdrawals: isThorchainSaversWithdrawalsEnabled === false,
341+
isDisabledDeposits:
342+
(!isRunePool && isThorchainSaversDepositEnabled === false) ||
343+
(isRunePool && !isRunePoolDepositEnabled),
344+
isDisabledWithdrawals:
345+
(!isRunePool && isThorchainSaversWithdrawalsEnabled === false) ||
346+
(isRunePool && !isRunepoolWithdrawEnabled),
340347
remainingLockupTime,
341348
})
342349
}, [
343350
earnOpportunityData,
344351
hasPendingQueries,
345352
hasPendingTxs,
346353
isHardCapReached,
354+
isRunePool,
355+
isRunePoolDepositEnabled,
356+
isRunepoolWithdrawEnabled,
347357
isThorchainSaversDepositEnabled,
348358
isThorchainSaversWithdrawalsEnabled,
349359
isTradingActive,

src/state/slices/preferencesSlice/preferencesSlice.ts

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ export type FeatureFlags = {
6161
ArbitrumBridgeClaims: boolean
6262
UsdtApprovalReset: boolean
6363
RunePool: boolean
64+
RunePoolDeposit: boolean
65+
RunePoolWithdraw: boolean
6466
Markets: boolean
6567
PhantomWallet: boolean
6668
FoxPage: boolean
@@ -161,6 +163,8 @@ const initialState: Preferences = {
161163
ArbitrumBridgeClaims: getConfig().REACT_APP_FEATURE_ARBITRUM_BRIDGE_CLAIMS,
162164
UsdtApprovalReset: getConfig().REACT_APP_FEATURE_USDT_APPROVAL_RESET,
163165
RunePool: getConfig().REACT_APP_FEATURE_RUNEPOOL,
166+
RunePoolDeposit: getConfig().REACT_APP_FEATURE_RUNEPOOL_DEPOSIT,
167+
RunePoolWithdraw: getConfig().REACT_APP_FEATURE_RUNEPOOL_WITHDRAW,
164168
Markets: getConfig().REACT_APP_FEATURE_MARKETS,
165169
PhantomWallet: getConfig().REACT_APP_FEATURE_PHANTOM_WALLET,
166170
FoxPage: getConfig().REACT_APP_FEATURE_FOX_PAGE,

src/test/mocks/store.ts

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ export const mockStore: ReduxState = {
126126
ArbitrumBridgeClaims: false,
127127
UsdtApprovalReset: false,
128128
RunePool: false,
129+
RunePoolDeposit: false,
130+
RunePoolWithdraw: false,
129131
PortalsSwap: false,
130132
Markets: false,
131133
PhantomWallet: false,

0 commit comments

Comments
 (0)