Skip to content

Commit

Permalink
wallet-ext: disable stake coins
Browse files Browse the repository at this point in the history
* allow users to navigate to stake home view but disable staking new coins
* see MystenLabs@e929c1a and MystenLabs#3616 for more details on why this was disabled
  • Loading branch information
pchrysochoidis committed Aug 16, 2022
1 parent 90bb8cb commit e5caa8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions wallet/configs/environment/.env.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ EXPLORER_URL_LOCAL=http://localhost:8080/
EXPLORER_URL_DEV_NET=https://explorer.devnet.sui.io/
EXPLORER_URL_STAGING=https://explorer.staging.sui.io/
SHOW_STAGING=false
STAKING_ENABLED=false
3 changes: 3 additions & 0 deletions wallet/src/ui/app/staking/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Button from '_app/shared/button';
import CoinBalance from '_app/shared/coin-balance';
import PageTitle from '_app/shared/page-title';
import StatsCard, { StatsRow, StatsItem } from '_app/shared/stats-card';
import { STAKING_ENABLED } from '_app/staking';
import {
activeDelegationIDsSelector,
totalActiveStakedSelector,
Expand Down Expand Up @@ -134,6 +135,8 @@ function StakeHome() {
mode="primary"
className={st.action}
href="new"
title="Currently disabled"
disabled={!STAKING_ENABLED}
>
Stake Coins
<Icon
Expand Down
6 changes: 5 additions & 1 deletion wallet/src/ui/app/staking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ import { Route } from 'react-router-dom';
import StakeHome from './home';
import StakeNew from './stake';

export const STAKING_ENABLED = process.env.STAKING_ENABLED === 'true';

export const routes = (
<>
<Route path="stake" element={<StakeHome />} />
<Route path="stake/new" element={<StakeNew />} />
{STAKING_ENABLED ? (
<Route path="stake/new" element={<StakeNew />} />
) : null}
</>
);

0 comments on commit e5caa8a

Please sign in to comment.