Bläddra i källkod

refactor(keyboard-shortcuts) use jss instead of scss

master
Shahab 3 år sedan
förälder
incheckning
0ce6fce58d

+ 0
- 10
css/_keyboard-shortcuts.scss Visa fil

@@ -1,10 +0,0 @@
1
-.shortcuts-list {
2
-    list-style-type: none;
3
-    padding: 0;
4
-
5
-    &__item {
6
-        display: flex;
7
-        justify-content: space-between;
8
-        margin-bottom: em(7, 14);
9
-    }
10
-}

+ 0
- 1
css/main.scss Visa fil

@@ -57,7 +57,6 @@ $flagsImagePath: "../images/";
57 57
 @import 'welcome_page_content';
58 58
 @import 'welcome_page_settings_toolbar';
59 59
 @import 'toolbars';
60
-@import 'keyboard-shortcuts';
61 60
 @import 'redirect_page';
62 61
 @import 'components/form-control';
63 62
 @import 'components/link';

+ 31
- 2
react/features/keyboard-shortcuts/components/KeyboardShortcutsDialog.web.js Visa fil

@@ -1,6 +1,8 @@
1 1
 /* @flow */
2 2
 
3 3
 import Lozenge from '@atlaskit/lozenge';
4
+import { withStyles } from '@material-ui/core/styles';
5
+import clsx from 'clsx';
4 6
 import React, { Component } from 'react';
5 7
 
6 8
 import { Dialog } from '../../base/dialog';
@@ -12,6 +14,11 @@ import { translate } from '../../base/i18n';
12 14
  */
13 15
 type Props = {
14 16
 
17
+    /**
18
+     * An object containing the CSS classes.
19
+     */
20
+    classes: Object,
21
+
15 22
     /**
16 23
      * A Map with keyboard keys as keys and translation keys as values.
17 24
      */
@@ -23,6 +30,28 @@ type Props = {
23 30
     t: Function
24 31
 };
25 32
 
33
+/**
34
+ * Creates the styles for the component.
35
+ *
36
+ * @param {Object} theme - The current UI theme.
37
+ *
38
+ * @returns {Object}
39
+ */
40
+const styles = theme => {
41
+    return {
42
+        list: {
43
+            listStyleType: 'none',
44
+            padding: 0,
45
+
46
+            '& .shortcuts-list__item': {
47
+                display: 'flex',
48
+                justifyContent: 'space-between',
49
+                marginBottom: theme.spacing(2)
50
+            }
51
+        }
52
+    };
53
+};
54
+
26 55
 /**
27 56
  * Implements a React {@link Component} which displays a dialog describing
28 57
  * registered keyboard shortcuts.
@@ -49,7 +78,7 @@ class KeyboardShortcutsDialog extends Component<Props> {
49 78
                 <div
50 79
                     id = 'keyboard-shortcuts'>
51 80
                     <ul
52
-                        className = 'shortcuts-list'
81
+                        className = { clsx('shortcuts-list', this.props.classes.list) }
53 82
                         id = 'keyboard-shortcuts-list'>
54 83
                         { shortcuts }
55 84
                     </ul>
@@ -96,4 +125,4 @@ class KeyboardShortcutsDialog extends Component<Props> {
96 125
     }
97 126
 }
98 127
 
99
-export default translate(KeyboardShortcutsDialog);
128
+export default translate(withStyles(styles)(KeyboardShortcutsDialog));

Laddar…
Avbryt
Spara