Skip to content

Commit 6d56b47

Browse files
committed
feat: update MGP to latest
1 parent f8058f8 commit 6d56b47

18 files changed

+358
-346
lines changed

material-go-playground/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material-go-playground/runtime.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material-go-playground/vendors.js

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

material-go-playground/website/GettingStarted.jsx

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
import React from 'react';
22
import Typography from '@material-ui/core/Typography';
3-
import SimpleSource from './examples/Simple'
3+
import SimpleSource from './examples/Simple';
44

55
export default function GettingStarted() {
66
return (
77
<div>
8-
<Typography variant="body" color="textSecondary">Flexible, lightweight sandbox client for <a
9-
href="https://go.googlesource.com/playground">goland playground </a></Typography>
8+
<Typography variant="body" color="textSecondary">
9+
Flexible, modern, lightweight UI for
10+
{' '}
11+
<a href="https://go.googlesource.com/playground">golang playground</a>
12+
</Typography>
1013

11-
<Typography variant="h4" style={{marginTop: 30}}>Install</Typography>
14+
<Typography variant="h4" style={{ marginTop: 30 }}>Install</Typography>
1215

13-
<pre><code className="language-bash">
16+
<pre>
17+
<code className="language-bash">
1418
npm -i material-go-playground
15-
</code></pre>
19+
</code>
20+
</pre>
1621
or
17-
<pre><code class="language-bash">
22+
<pre>
23+
<code className="language-bash">
1824
yarn add material-go-playground
19-
</code></pre>
25+
</code>
26+
</pre>
2027

2128
<Typography variant="h4">Example</Typography>
2229

@@ -47,4 +54,4 @@ export default function GettingStarted() {
4754
</TableRow>
4855
4956
</TableBody>
50-
</Table>*/
57+
</Table> */

material-go-playground/website/Menu.jsx

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,48 +59,50 @@ export default function AppMenu() {
5959
<img
6060
src="https://golang.org/lib/godoc/images/go-logo-blue.svg"
6161
height={40}
62-
style={{ position: 'relative', top: 3, marginLeft: 12, left: 12 }}
62+
style={{
63+
position: 'relative', top: 3, marginLeft: 12, left: 12
64+
}}
6365
/>
6466
</div>
6567
<div>
66-
<Divider/>
68+
<Divider />
6769
<List className={classes.list}>
68-
<ListItem button dense component={AdapterLink} to={"/"}>
69-
<ListItemText primary="Getting started"/>
70+
<ListItem button dense component={AdapterLink} to="/">
71+
<ListItemText primary="Getting started" />
7072
</ListItem>
7173
<ListSubheader className={classes.group}>Examples</ListSubheader>
72-
<ListItem button divider dense component={AdapterLink} to={"/light"}>
73-
<ListItemText primary="Light mode"/>
74+
<ListItem button divider dense component={AdapterLink} to="/light">
75+
<ListItemText primary="Light mode" />
7476
</ListItem>
75-
<ListItem button divider dense component={AdapterLink} to={"/minimal"}>
76-
<ListItemText primary="Minimal"/>
77+
<ListItem button divider dense component={AdapterLink} to="/minimal">
78+
<ListItemText primary="Minimal" />
7779
</ListItem>
78-
<ListItem button divider dense component={AdapterLink} to={"/theming"}>
79-
<ListItemText primary="Theming"/>
80+
<ListItem button divider dense component={AdapterLink} to="/theming">
81+
<ListItemText primary="Theming" />
8082
</ListItem>
81-
<ListItem button divider dense component={AdapterLink} to={"/tests"}>
82-
<ListItemText primary="Tests"/>
83+
<ListItem button divider dense component={AdapterLink} to="/tests">
84+
<ListItemText primary="Tests" />
8385
</ListItem>
84-
<ListItem button divider dense component={AdapterLink} to={"/with-title"}>
85-
<ListItemText primary="With title"/>
86+
<ListItem button divider dense component={AdapterLink} to="/with-title">
87+
<ListItemText primary="With title" />
8688
</ListItem>
87-
<ListItem button divider dense component={AdapterLink} to={"/errors"}>
88-
<ListItemText primary="Errors"/>
89+
<ListItem button divider dense component={AdapterLink} to="/errors">
90+
<ListItemText primary="Errors" />
8991
</ListItem>
90-
{/*<ListItem button divider component={AdapterLink} to={"/multiple-code"}>*/}
91-
{/* <ListItemText primary="Multiple code"/>*/}
92-
{/*</ListItem>*/}
93-
<ListItem button divider dense component={AdapterLink} to={"/headless"}>
94-
<ListItemText primary="Headless & readonly"/>
92+
{/* <ListItem button divider component={AdapterLink} to={"/multiple-code"}> */}
93+
{/* <ListItemText primary="Multiple code"/> */}
94+
{/* </ListItem> */}
95+
<ListItem button divider dense component={AdapterLink} to="/headless">
96+
<ListItemText primary="Headless & readonly" />
9597
</ListItem>
96-
<ListItem button divider dense component={Link} target={"_blank"} href={"/material-go-playground/example"}>
97-
<ListItemText primary="Full feature"/>
98-
<ListItemAvatar className={classes.blank}><ExitLink /></ListItemAvatar>
98+
<ListItem button divider dense component={Link} target="_blank" href="/material-go-playground/example">
99+
<ListItemText primary="Full feature" />
100+
<ListItemAvatar className={classes.blank}><ExitLink /></ListItemAvatar>
99101
</ListItem>
100102
<ListSubheader className={classes.group}>Widgets</ListSubheader>
101-
<ListItem button divider dense component={Link} target={"_blank"} href={"/material-go-playground/widget"}>
102-
<ListItemText primary="Simple"/>
103-
<ListItemAvatar className={classes.blank}><ExitLink /></ListItemAvatar>
103+
<ListItem button divider dense component={Link} target="_blank" href="/material-go-playground/widget">
104+
<ListItemText primary="Simple" />
105+
<ListItemAvatar className={classes.blank}><ExitLink /></ListItemAvatar>
104106
</ListItem>
105107
</List>
106108
</div>

material-go-playground/website/examples/Headless.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Headless() {
1717
<div>
1818
<GoPlayGround
1919
code={code}
20-
color={"light"}
20+
color="light"
2121
hideHeader
2222
readOnly
2323
resultHeight={0}

material-go-playground/website/examples/Light.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Light() {
1717
<div>
1818
<GoPlayGround
1919
code={code}
20-
color={"light"}
20+
color="light"
2121
/>
2222
</div>
2323
);

material-go-playground/website/examples/Minimal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Minimal() {
1818
code={code}
1919
useTextOnButton={false}
2020
hideFormat
21-
settingsIconStyle={{display: 'none'}}
21+
settingsIconStyle={{ display: 'none' }}
2222
/>
2323
</div>
2424
);

material-go-playground/website/examples/MultipleCodes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function Minimal() {
1818
code={code}
1919
useTextOnButton={false}
2020
hideFormat
21-
settingsIconStyle={{display: 'none'}}
21+
settingsIconStyle={{ display: 'none' }}
2222
/>
2323
</div>
2424
);

material-go-playground/website/examples/Simple.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import GoPlayground from "material-go-playground";
2+
import GoPlayground from 'material-go-playground';
33

44
const code = `package main
55
@@ -17,6 +17,5 @@ func main() {
1717
}`;
1818

1919
export default function Simple() {
20-
return <GoPlayground code={code}/>
20+
return <GoPlayground code={code} />;
2121
}
22-

material-go-playground/website/examples/Tests.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function Tests() {
2727
<Grid container spacing={2}>
2828
<Grid item sm={6} xs={12}>
2929
<GoPlayGround
30-
title={'Test success'}
30+
title="Test success"
3131
code={`
3232
package main
3333
@@ -52,7 +52,7 @@ func TestAbs(t *testing.T) {
5252
</Grid>
5353
<Grid item sm={6} xs={12}>
5454
<GoPlayGround
55-
title={'Test fail'}
55+
title="Test fail"
5656
code={codeTestFail}
5757
hideFormat
5858
useTextOnButton={false}
Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from "react";
2-
import Grid from "@material-ui/core/Grid"
3-
import Typography from "@material-ui/core/Typography"
4-
import GoPlayGround from "material-go-playground";
5-
import orange from "@material-ui/core/colors/orange";
6-
import green from "@material-ui/core/colors/green";
1+
import React from 'react';
2+
import Grid from '@material-ui/core/Grid';
3+
import Typography from '@material-ui/core/Typography';
4+
import GoPlayGround from 'material-go-playground';
5+
import orange from '@material-ui/core/colors/orange';
6+
import green from '@material-ui/core/colors/green';
77

88
const code = `package main
99
@@ -16,56 +16,58 @@ func main() {
1616
}`;
1717

1818
export default function Themes() {
19-
return <div>
20-
<Grid container spacing={2}>
21-
<Grid item sm={6} xs={12}>
22-
<Typography variant="h6" style={{fontWeight: 400, marginTop: -6}}>Custom colors</Typography>
23-
<GoPlayGround
24-
code={code}
25-
theme={{
26-
palette: {
27-
primary: {
28-
main: orange[500],
19+
return (
20+
<div>
21+
<Grid container spacing={2}>
22+
<Grid item sm={6} xs={12}>
23+
<Typography variant="h6" style={{ fontWeight: 400, marginTop: -6 }}>Custom colors</Typography>
24+
<GoPlayGround
25+
code={code}
26+
theme={{
27+
palette: {
28+
primary: {
29+
main: orange[500],
30+
},
2931
},
30-
},
31-
overrides: {
32-
MuiButton: {
33-
root: {
34-
borderRadius: '20px !important',
32+
overrides: {
33+
MuiButton: {
34+
root: {
35+
borderRadius: '20px !important',
36+
},
3537
},
3638
},
37-
},
38-
}}
39-
/>
40-
</Grid>
41-
<Grid item sm={6} xs={12}>
42-
<Typography variant="h6" style={{fontFamily: 'monospace'}}>With font</Typography>
43-
<GoPlayGround
44-
title={'Monospace'}
45-
code={code}
46-
color="light"
47-
theme={{
48-
palette: {
49-
primary: {
50-
main: green[500],
39+
}}
40+
/>
41+
</Grid>
42+
<Grid item sm={6} xs={12}>
43+
<Typography variant="h6" style={{ fontFamily: 'monospace' }}>With font</Typography>
44+
<GoPlayGround
45+
title="Monospace"
46+
code={code}
47+
color="light"
48+
theme={{
49+
palette: {
50+
primary: {
51+
main: green[500],
52+
},
53+
secondary: {
54+
main: orange[500],
55+
},
5156
},
52-
secondary: {
53-
main: orange[500],
57+
typography: {
58+
fontFamily: 'monospace',
5459
},
55-
},
56-
typography: {
57-
fontFamily: 'monospace',
58-
},
59-
overrides: {
60-
MuiButton: {
61-
root: {
62-
borderRadius: '20px !important',
60+
overrides: {
61+
MuiButton: {
62+
root: {
63+
borderRadius: '20px !important',
64+
},
6365
},
6466
},
65-
},
66-
}}
67-
/>
67+
}}
68+
/>
69+
</Grid>
6870
</Grid>
69-
</Grid>
70-
</div>
71-
}
71+
</div>
72+
);
73+
}

material-go-playground/website/examples/WithTitle.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default function WIthTitle() {
2828
<img
2929
src="https://golang.org/lib/godoc/images/go-logo-blue.svg"
3030
height={33}
31-
style={{ position: 'relative', top: 3, marginRight: 12, left: 12 }}
31+
style={{
32+
position: 'relative', top: 3, marginRight: 12, left: 12
33+
}}
3234
/>
3335
)}
3436
theme={{

0 commit comments

Comments
 (0)