Skip to content

Commit d15fe89

Browse files
authored
Storybook css fixes (#139)
* Fix: Keyboard shortcuts window positioning * Fix: Settings panel alignment * Task: storybook/options is deprecated - pulled in parameters function instead
1 parent d8fbd5e commit d15fe89

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

.storybook/config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { configure } from '@storybook/react';
2-
import { setOptions } from '@storybook/addon-options';
1+
import { addParameters, configure } from '@storybook/react';
32

43
// automatically import all files ending in *.stories.js
54
// https://webpack.js.org/guides/dependency-management/
@@ -13,10 +12,11 @@ function loadStories() {
1312
styles.keys().forEach((filename) => styles(filename));
1413
}
1514

16-
setOptions({
17-
name: 'react-transcript-editor',
18-
url: 'https://github.com/bbc/react-transcript-editor',
19-
addonPanelInRight: true
15+
addParameters({
16+
options: {
17+
panelPosition: 'right',
18+
sidebarAnimations: true
19+
},
2020
});
2121

2222
configure(loadStories, module);

.storybook/styles/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
body * {
2-
// font-family: ReithSans, Helvetica, sans-serif !important;
32
font-family: ReithSerif, Fallback, sans-serif;
3+
// font-family: ReithSans, Helvetica, sans-serif !important;
44
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
"@babel/preset-react": "^7.0.0",
6666
"@storybook/addon-actions": "^5.0.6",
6767
"@storybook/addon-links": "^5.0.6",
68-
"@storybook/addon-options": "^5.0.6",
6968
"@storybook/addons": "^5.0.6",
7069
"@storybook/react": "^5.0.6",
7170
"babel-eslint": "^10.0.1",

packages/components/keyboard-shortcuts/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3+
import { faWindowClose } from '@fortawesome/free-solid-svg-icons';
34
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
5+
46
import returnHotKeys from './hot-keys';
57

68
import style from './index.module.css';
@@ -27,9 +29,8 @@ class KeyboardShortcuts extends React.Component {
2729
<h2 className={ style.header }>Shortcuts</h2>
2830
<div
2931
className={ style.closeButton }
30-
onClick={ this.props.handleShortcutsToggle }
31-
>
32-
<FontAwesomeIcon icon="window-close" />
32+
onClick={ this.props.handleShortcutsToggle }>
33+
<FontAwesomeIcon icon={ faWindowClose } />
3334
</div>
3435
<ul className={ style.list }>{hotKeysCheatsheet}</ul>
3536
</div>

packages/components/keyboard-shortcuts/index.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
color: black;
1010
background: color-lightest-grey;
1111
z-index: 2;
12+
position: absolute;
13+
top: 0;
14+
right: 0;
1215
}
1316

1417
.header {
@@ -23,12 +26,13 @@
2326
right: 0;
2427
padding: 1em;
2528
cursor: pointer;
29+
z-index: 3;
2630
}
2731

2832
.list {
2933
list-style: none;
3034
padding: 1em;
31-
margin: 0;
35+
margin: 0 auto;
3236
}
3337

3438
.listItem {

packages/components/settings/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
.controlsContainer {
3232
display: flex;
3333
flex-direction: column;
34-
flex-wrap: wrap;
3534
align-content: flex-start;
3635
align-items: center;
36+
margin: 0 auto;
3737
}
3838

3939
.settingElement {

0 commit comments

Comments
 (0)