From 7f239997dc06dbee513c0ed5f62c91030a75286e Mon Sep 17 00:00:00 2001 From: David Walsh Date: Fri, 25 Mar 2022 20:42:52 -0500 Subject: [PATCH] Dark Mode: Remove feature flag (#14207) --- development/build/scripts.js | 2 -- ui/pages/routes/routes.component.js | 14 ++++---------- .../experimental-tab/experimental-tab.component.js | 6 ------ 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index e02c81519..2096c837d 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -34,7 +34,6 @@ const metamaskrc = require('rc')('metamask', { INFURA_PROD_PROJECT_ID: process.env.INFURA_PROD_PROJECT_ID, ONBOARDING_V2: process.env.ONBOARDING_V2, COLLECTIBLES_V1: process.env.COLLECTIBLES_V1, - DARK_MODE_V1: process.env.DARK_MODE_V1, TOKEN_DETECTION_V2: process.env.TOKEN_DETECTION_V2, SEGMENT_HOST: process.env.SEGMENT_HOST, SEGMENT_WRITE_KEY: process.env.SEGMENT_WRITE_KEY, @@ -812,7 +811,6 @@ function getEnvironmentVariables({ buildType, devMode, testing, version }) { SWAPS_USE_DEV_APIS: process.env.SWAPS_USE_DEV_APIS === '1', ONBOARDING_V2: metamaskrc.ONBOARDING_V2 === '1', COLLECTIBLES_V1: metamaskrc.COLLECTIBLES_V1 === '1', - DARK_MODE_V1: metamaskrc.DARK_MODE_V1 === '1', TOKEN_DETECTION_V2: metamaskrc.TOKEN_DETECTION_V2 === '1', }; } diff --git a/ui/pages/routes/routes.component.js b/ui/pages/routes/routes.component.js index 7f5565d9a..45140c8dd 100644 --- a/ui/pages/routes/routes.component.js +++ b/ui/pages/routes/routes.component.js @@ -105,11 +105,9 @@ export default class Routes extends Component { }; componentDidUpdate(prevProps) { - if (process.env.DARK_MODE_V1) { - const { theme } = this.props; - if (theme !== prevProps.theme) { - document.documentElement.setAttribute('data-theme', theme); - } + const { theme } = this.props; + if (theme !== prevProps.theme) { + document.documentElement.setAttribute('data-theme', theme); } } @@ -130,9 +128,7 @@ export default class Routes extends Component { pageChanged(locationObj.pathname); } }); - if (process.env.DARK_MODE_V1 && theme) { - document.documentElement.setAttribute('data-theme', theme); - } + document.documentElement.setAttribute('data-theme', theme); } renderRoutes() { @@ -333,7 +329,6 @@ export default class Routes extends Component { isMouseUser, browserEnvironmentOs: os, browserEnvironmentBrowser: browser, - theme, } = this.props; const loadMessage = loadingMessage || isNetworkLoading @@ -345,7 +340,6 @@ export default class Routes extends Component { [`os-${os}`]: os, [`browser-${browser}`]: browser, 'mouse-user-styles': isMouseUser, - [`theme-${theme}`]: process.env.DARK_MODE_V1 && theme, })} dir={textDirection} onClick={() => setMouseUserState(true)} diff --git a/ui/pages/settings/experimental-tab/experimental-tab.component.js b/ui/pages/settings/experimental-tab/experimental-tab.component.js index c520ed02b..de266f153 100644 --- a/ui/pages/settings/experimental-tab/experimental-tab.component.js +++ b/ui/pages/settings/experimental-tab/experimental-tab.component.js @@ -9,9 +9,6 @@ import Dropdown from '../../../components/ui/dropdown'; import { THEME_TYPE } from './experimental-tab.constant'; -/*eslint-disable prefer-destructuring*/ -const DARK_MODE_V1 = process.env.DARK_MODE_V1; - export default class ExperimentalTab extends PureComponent { static contextTypes = { t: PropTypes.func, @@ -229,9 +226,6 @@ export default class ExperimentalTab extends PureComponent { } renderTheme() { - if (!DARK_MODE_V1) { - return null; - } const { t } = this.context; const { theme, setTheme } = this.props;