From 4e6ecac43edc85ed8cef726f4e0242b249b018ba Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 1 Oct 2020 05:32:07 -0700 Subject: [PATCH] Load ant theme in classic Flipper as well Summary: If a new code path uses some Ant design based components in classic flipper, they are unstyled before this diff. By making sure that the ant stylesheet is loaded we can safely 'leak' new UI elements into the old UI. For example when we use toasters, dialogs etc. Reviewed By: cekkaewnumchai Differential Revision: D24021751 fbshipit-source-id: 3b42d28f1c75e4df441170660027562264e879dd --- desktop/app/src/init.tsx | 8 +++----- desktop/static/empty.css | 12 ------------ desktop/static/index.dev.html | 2 +- desktop/static/index.html | 2 +- 4 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 desktop/static/empty.css diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 98d93cfb6..e0da6e1da 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -106,11 +106,9 @@ function init() { store, {name: 'loadTheme', fireImmediately: true, throttleMs: 500}, (state) => - state.settingsState.enableSandy - ? state.settingsState.darkMode - ? 'themes/dark' - : 'themes/light' - : 'none', + state.settingsState.enableSandy && state.settingsState.darkMode + ? 'themes/dark' + : 'themes/light', (theme) => { (document.getElementById( 'flipper-theme-import', diff --git a/desktop/static/empty.css b/desktop/static/empty.css deleted file mode 100644 index 5e3768f9d..000000000 --- a/desktop/static/empty.css +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @format - */ - -/* - used as theme in case Sandy is not enabled -*/ diff --git a/desktop/static/index.dev.html b/desktop/static/index.dev.html index c18c8e5c6..2b3e481b8 100644 --- a/desktop/static/index.dev.html +++ b/desktop/static/index.dev.html @@ -4,7 +4,7 @@ - + Flipper diff --git a/desktop/static/index.html b/desktop/static/index.html index 9eb3dd92e..0508ff97e 100644 --- a/desktop/static/index.html +++ b/desktop/static/index.html @@ -4,7 +4,7 @@ - + Flipper