Skip to content

Commit 68ac46b

Browse files
committed
fix: add transition props + upgrade react
1 parent c2eb04e commit 68ac46b

File tree

10 files changed

+655
-730
lines changed

10 files changed

+655
-730
lines changed

package-lock.json

Lines changed: 628 additions & 708 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
"author": "",
1212
"license": "Apache-2.0",
1313
"dependencies": {
14-
"@material-ui/core": "^3.9.2",
15-
"@material-ui/icons": "^3.0.2",
14+
"@material-ui/core": "^4.7.1",
15+
"@material-ui/icons": "^4.5.1",
16+
"@material-ui/styles": "^4.7.1",
1617
"@open-rpc/examples": "^1.3.3",
1718
"hash-color-material": "^1.1.3",
1819
"json-schema": "^0.2.3",
1920
"lodash": "^4.17.15",
20-
"react": "^16.8.4",
21-
"react-dom": "^16.8.4",
21+
"react": "^16.12.0",
22+
"react-dom": "^16.12.0",
2223
"react-json-view": "^1.19.1",
2324
"react-markdown": "^4.0.6"
2425
},

src/Errors/Errors.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ErrorObject } from "@open-rpc/meta-schema";
1313

1414
const styles = (theme: Theme) => ({
1515
code: {
16-
marginLeft: theme.spacing.unit,
16+
marginLeft: theme.spacing(2),
1717
},
1818
});
1919

src/ExamplePairing/ExamplePairing.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ExamplePairing extends Component<IProps, {}> {
3232
return null;
3333
}
3434
return (
35-
<Grid container spacing={24}>
35+
<Grid container spacing={10}>
3636
<Grid item xs={12}>
3737
<ReactMarkdown source={example.description} className={classes.description}/>
3838
</Grid>

src/ExpansionTable/ExpansionTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ const styles = (theme: Theme) => ({
1616
fontSize: theme.typography.pxToRem(15),
1717
},
1818
root: {
19-
marginBottom: theme.spacing.unit,
20-
marginTop: theme.spacing.unit * 3,
19+
marginBottom: theme.spacing(2),
20+
marginTop: theme.spacing(6),
2121
width: "100%",
2222
},
2323
secondaryHeading: {

src/Info/Info.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import { OpenRPC } from "@open-rpc/meta-schema";
88

99
const styles = (theme: Theme) => ({
1010
button: {
11-
margin: theme.spacing.unit,
11+
margin: theme.spacing(2),
1212
},
1313
chip: {
14-
margin: theme.spacing.unit,
14+
margin: theme.spacing(2),
1515
},
1616
description: {
1717
color: theme.palette.text.primary,
18-
padding: `${theme.spacing.unit}px 0 ${theme.spacing.unit}px 0`,
18+
padding: `${theme.spacing(2)}px 0 ${theme.spacing(2)}px 0`,
1919
},
2020
});
2121

src/Links/Links.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const styles = (theme: Theme) => ({
2626
fontSize: theme.typography.pxToRem(15),
2727
},
2828
paramsMargin: {
29-
marginTop: theme.spacing.unit,
29+
marginTop: theme.spacing(2),
3030
},
3131
secondaryHeading: {
3232
alignSelf: "end",

src/Methods/Methods.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ const styles = (theme: Theme) => ({
3131
fontSize: theme.typography.pxToRem(15),
3232
},
3333
root: {
34-
marginBottom: theme.spacing.unit,
35-
marginTop: theme.spacing.unit * 3,
34+
marginBottom: theme.spacing(2),
35+
marginTop: theme.spacing(3),
3636
width: "100%",
3737
},
3838
secondaryHeading: {
@@ -52,7 +52,7 @@ interface IProps extends WithStyles<typeof styles> {
5252
methodPlugins?: Array<React.FC<IMethodPluginProps>>;
5353
}
5454

55-
class Methods extends Component<IProps> {
55+
class Methods extends Component<IProps, IState> {
5656
public render() {
5757
const { schema, classes, uiSchema } = this.props;
5858
if (!schema) {
@@ -65,7 +65,11 @@ class Methods extends Component<IProps> {
6565
<div className={classes.root}>
6666
<Typography variant="h3" gutterBottom>Methods</Typography>
6767
{schema.methods.map((method, i) => (
68-
<ExpansionPanel key={i + method.name} defaultExpanded={uiSchema && uiSchema.methods["ui:defaultExpanded"]}>
68+
<ExpansionPanel
69+
key={i + method.name}
70+
TransitionProps={{unmountOnExit: true}}
71+
defaultExpanded={uiSchema && uiSchema.methods["ui:defaultExpanded"]}
72+
>
6973
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
7074
<Typography key={method.name} className={classes.heading}>{method.name}</Typography>
7175
<Typography key={method.summary} className={classes.secondaryHeading}>{method.summary}</Typography>
@@ -78,7 +82,7 @@ class Methods extends Component<IProps> {
7882
}
7983
{method.description &&
8084
<ExpansionPanelDetails key="description">
81-
<ReactMarkdown source={method.description} className={classes.description}/>
85+
<ReactMarkdown source={method.description} className={classes.description} />
8286
</ExpansionPanelDetails>
8387
}
8488
{method.params && method.params.length > 0 &&

src/Params/Params.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ import { ContentDescriptorObject } from "@open-rpc/meta-schema";
1010

1111
const styles = (theme: Theme) => ({
1212
schema: {
13-
marginLeft: theme.spacing.unit * 4,
13+
marginLeft: theme.spacing(8),
1414
},
1515
table: {
16-
padding: theme.spacing.unit,
16+
padding: theme.spacing(2),
1717
},
1818
tableEnd: {
19-
paddingRight: `${theme.spacing.unit * 10}px !important`,
19+
paddingRight: `${theme.spacing(20)}px !important`,
2020
},
2121
tableStart: {
22-
paddingLeft: theme.spacing.unit * 6,
22+
paddingLeft: theme.spacing(3),
2323
},
2424
});
2525

src/Servers/Servers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const styles = (theme: Theme) => ({
1919
fontSize: theme.typography.pxToRem(15),
2020
},
2121
paramsMargin: {
22-
marginTop: theme.spacing.unit,
22+
marginTop: theme.spacing(2),
2323
},
2424
secondaryHeading: {
2525
alignSelf: "end",

0 commit comments

Comments
 (0)