|
@@ -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));
|