瀏覽代碼

feat(dark-theme): fix breakage on mobile

e09949be9f introduced the dark theme globally, but
it only applies to web, so move the logic to App.web.js
j8
Saúl Ibarra Corretgé 7 年之前
父節點
當前提交
23550d377e
共有 2 個檔案被更改,包括 18 行新增6 行删除
  1. 1
    6
      react/features/app/components/AbstractApp.js
  2. 17
    0
      react/features/app/components/App.web.js

+ 1
- 6
react/features/app/components/AbstractApp.js 查看文件

@@ -4,7 +4,6 @@ import { I18nextProvider } from 'react-i18next';
4 4
 import { Provider } from 'react-redux';
5 5
 import { compose, createStore } from 'redux';
6 6
 import Thunk from 'redux-thunk';
7
-import { AtlasKitThemeProvider } from '@atlaskit/theme';
8 7
 
9 8
 import { i18next } from '../../base/i18n';
10 9
 import {
@@ -202,11 +201,7 @@ export class AbstractApp extends Component {
202 201
             return (
203 202
                 <I18nextProvider i18n = { i18next }>
204 203
                     <Provider store = { this._getStore() }>
205
-                        <AtlasKitThemeProvider mode = 'dark'>
206
-                            {
207
-                                this._createElement(component)
208
-                            }
209
-                        </AtlasKitThemeProvider>
204
+                        { this._createElement(component) }
210 205
                     </Provider>
211 206
                 </I18nextProvider>
212 207
             );

+ 17
- 0
react/features/app/components/App.web.js 查看文件

@@ -1,3 +1,6 @@
1
+import { AtlasKitThemeProvider } from '@atlaskit/theme';
2
+import React from 'react';
3
+
1 4
 import { getLocationContextRoot } from '../../base/util';
2 5
 import '../../room-lock';
3 6
 
@@ -37,6 +40,20 @@ export class App extends AbstractApp {
37 40
         };
38 41
     }
39 42
 
43
+    /**
44
+     * Overrides the parent method to inject {@link AtlasKitThemeProvider} as
45
+     * the top most component.
46
+     *
47
+     * @override
48
+     */
49
+    _createElement(component, props) {
50
+        return (
51
+            <AtlasKitThemeProvider mode = 'dark'>
52
+                { super._createElement(component, props) }
53
+            </AtlasKitThemeProvider>
54
+        );
55
+    }
56
+
40 57
     /**
41 58
      * Gets a Location object from the window with information about the current
42 59
      * location of the document.

Loading…
取消
儲存