Skip to content

Commit

Permalink
Add feature flag for Ledger Live
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsmiarowski committed Jul 27, 2023
1 parent 98a6086 commit 7382d4a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
REACT_APP_FEATURE_FLAG_POSTHOG=false
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=true
REACT_APP_SENTRY_DSN=$SENTRY_DSN

REACT_APP_ELECTRUM_PROTOCOL=$ELECTRUM_PROTOCOL
REACT_APP_ELECTRUM_HOST=$ELECTRUM_HOST
REACT_APP_ELECTRUM_PORT=$ELECTRUM_PORT
REACT_APP_MOCK_BITCOIN_CLIENT=true

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID
REACT_APP_WALLET_CONNECT_PROJECT_ID=5e3b81a06187cfd3288af992faafc0eb
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ REACT_APP_FEATURE_FLAG_POSTHOG=$POSTHOG_SUPPORT
REACT_APP_POSTHOG_API_KEY=$POSTHOG_API_KEY
REACT_APP_POSTHOG_HOSTNAME_HTTP=$POSTHOG_HOSTNAME_HTTP
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
REACT_APP_FEATURE_FLAG_LEDGER_LIVE=false
REACT_APP_SENTRY_DSN=$SENTRY_DSN

REACT_APP_ELECTRUM_PROTOCOL=$ELECTRUM_PROTOCOL
Expand Down
21 changes: 13 additions & 8 deletions src/components/Modal/SelectWalletModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import ConnectTaho from "./ConnectTaho"
import ConnectLedgerLive from "./ConnectLedgerLive"
import { LedgerLight } from "../../../static/icons/LedgerLight"
import { LedgerDark } from "../../../static/icons/LedgerDark"
import { featureFlags } from "../../../constants"

const walletOptions: WalletOption[] = [
{
Expand All @@ -37,14 +38,18 @@ const walletOptions: WalletOption[] = [
dark: MetaMaskIcon,
},
},
{
id: WalletType.LedgerLive,
title: "Ledger Live",
icon: {
light: LedgerLight,
dark: LedgerDark,
},
},
...(featureFlags.LEDGER_LIVE
? [
{
id: WalletType.LedgerLive,
title: "Ledger Live",
icon: {
light: LedgerLight,
dark: LedgerDark,
},
},
]
: []),
{
id: WalletType.WalletConnect,
title: "WalletConnect",
Expand Down
3 changes: 3 additions & 0 deletions src/constants/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ export const SENTRY = getEnvVariable(EnvVariable.FEATURE_FLAG_SENTRY) === "true"

export const TBTC_V2_REDEMPTION =
getEnvVariable(EnvVariable.FEATURE_FLAG_TBTC_V2_REDEMPTION) === "true"

export const LEDGER_LIVE =
getEnvVariable(EnvVariable.FEATURE_FLAG_LEDGER_LIVE) === "true"
1 change: 1 addition & 0 deletions src/enums/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const envVariables = [
"FEATURE_FLAG_SENTRY",
"SENTRY_DSN",
"WALLET_CONNECT_PROJECT_ID",
"FEATURE_FLAG_LEDGER_LIVE",
] as const

export type EnvVariableKey = typeof envVariables[number]
Expand Down

0 comments on commit 7382d4a

Please sign in to comment.