Skip to content

Commit 3e6fce4

Browse files
authored
doc config fix (#15)
1 parent a2089b3 commit 3e6fce4

File tree

4 files changed

+27
-30
lines changed

4 files changed

+27
-30
lines changed

styleguide/components/Logo/index.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
import React, { PropsWithChildren } from 'react';
2-
import Styled from 'react-styleguidist/lib/client/rsg-components/Styled';
32
import { Theme } from 'react-styleguidist/lib/typings/RsgTheme';
3+
import Styled, { JssInjectedProps } from 'rsg-components/Styled';
44

55
import logo from './logo.png';
66

7-
const styles = ({ fontFamily, fontSize }: Theme) => ({
7+
const styles = ({ fontFamily }: Theme) => ({
88
logo: {
99
display: 'flex',
1010
alignItems: 'center',
11-
margin: 0,
1211
fontFamily: fontFamily.base,
13-
fontSize: fontSize.h1,
14-
fontWeight: 'normal',
12+
fontSize: 18,
1513
},
1614
image: {
1715
width: '2.5em',
1816
marginRight: '0.5em',
1917
},
2018
});
2119

22-
interface LogoProps {
23-
classes: Record<string, string>;
24-
}
25-
26-
function LogoRenderer({ classes, children }: PropsWithChildren<LogoProps>) {
20+
function LogoRenderer({ classes, children }: PropsWithChildren<JssInjectedProps>) {
2721
return (
2822
<h1 className={classes.logo}>
2923
<img src={logo} alt="Kubevirt UI" className={classes.image} />

styleguide/styles.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
import { Theme } from 'react-styleguidist/lib/typings/RsgTheme';
22

3-
module.exports = {
4-
styles: (theme: Theme) => {
5-
return {
6-
Playground: {
7-
preview: {
8-
paddingLeft: 0,
9-
paddingRight: 0,
10-
borderWidth: [[0, 0, 1, 0]],
11-
borderRadius: 0,
12-
},
3+
const style = (theme: Theme) => {
4+
return {
5+
Playground: {
6+
preview: {
7+
paddingLeft: 0,
8+
paddingRight: 0,
9+
borderWidth: [[0, 0, 1, 0]],
10+
borderRadius: 0,
1311
},
14-
Code: {
15-
code: {
16-
// make inline code example appear the same color as links
17-
color: theme.color.link,
18-
fontSize: 14,
19-
},
12+
},
13+
Code: {
14+
code: {
15+
// make inline code example appear the same color as links
16+
color: theme.color.link,
17+
fontSize: 14,
2018
},
21-
};
22-
},
19+
},
20+
};
2321
};
22+
23+
export default style;

styleguide/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ const customTheme: Partial<Theme> = {
1818
},
1919
};
2020

21-
module.exports = customTheme;
21+
export default customTheme;

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
"outDir": "dist",
1515
"moduleResolution": "node",
1616
"allowSyntheticDefaultImports": true,
17-
"emitDeclarationOnly": true
17+
"emitDeclarationOnly": true,
18+
"paths": {
19+
"rsg-components/*": ["./node_modules/react-styleguidist/lib/client/rsg-components/*"]
20+
}
1821
},
1922
"exclude": ["/node_modules/"]
2023
}

0 commit comments

Comments
 (0)