Skip to content

Commit 78ce64a

Browse files
authored
Merge pull request #4 from treetips/feature/update_material_ui_to_v4
Update material-ui v3 to v4
2 parents f21a9d7 + 06f1113 commit 78ce64a

18 files changed

+7317
-5430
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ VSCode と prettier と TSLint によって、リアルタイムに整形と構
2222

2323
- [Google App Engine Node.js Standard Environment](https://cloud.google.com/appengine/docs/standard/nodejs/)
2424
- [Visual Studio Code](https://code.visualstudio.com/)
25-
- [yarn](https://yarnpkg.com/lang/ja/)
2625
- [Typescript v3](https://www.typescriptlang.org/)
2726
- [Next.js v8](https://nextjs.org/)
28-
- [MATERIAL-UI v3](https://material-ui.com/)
27+
- [MATERIAL-UI v4](https://material-ui.com/)
2928
- [Redux](https://redux.js.org/)
3029
- [TSLint](https://palantir.github.io/tslint/)
3130

@@ -53,20 +52,20 @@ VSCode と prettier と TSLint によって、リアルタイムに整形と構
5352
```bash
5453
git clone https://github.com/treetips/typescript-nextjs-redux-material-ui-example.git
5554
cd typescript-nextjs-redux-material-ui-example
56-
yarn
55+
npm i
5756
```
5857

5958
### Start local
6059

6160
```bash
62-
yarn dev
61+
npm run dev
6362
```
6463

6564
### Build and start production express server
6665

6766
```bash
68-
yarn build
69-
yarn start
67+
npm run build
68+
npm start
7069
```
7170

7271
## For google appengine

components/MuiColorPalette.ts

Lines changed: 0 additions & 23 deletions
This file was deleted.

components/MuiTheme.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import green from "@material-ui/core/colors/green"
2+
import grey from "@material-ui/core/colors/grey"
3+
import { createMuiTheme } from "@material-ui/core/styles"
4+
5+
/**
6+
* material-ui theme color pallete
7+
* @see https://material-ui.com/style/color/
8+
*/
9+
export const MuiTheme = createMuiTheme({
10+
palette: {
11+
primary: {
12+
light: grey[700],
13+
main: grey[800],
14+
dark: grey[900],
15+
},
16+
secondary: {
17+
light: green[300],
18+
main: green[500],
19+
dark: green[700],
20+
},
21+
},
22+
})

components/getPageContext.ts

Lines changed: 0 additions & 38 deletions
This file was deleted.

components/molecules/NextListItem.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { Avatar, ListItem, ListItemText } from "@material-ui/core"
1+
import {
2+
Avatar,
3+
ListItem,
4+
ListItemAvatar,
5+
ListItemText,
6+
} from "@material-ui/core"
27
import {
38
createStyles,
49
Theme,
@@ -12,7 +17,6 @@ const styles = (theme: Theme) =>
1217
createStyles({
1318
root: {},
1419
anchorLink: {
15-
display: "flex",
1620
width: "100%",
1721
textDecoration: "none",
1822
},
@@ -61,21 +65,23 @@ const NextListItemComponent = (props: IProps) => {
6165
const { classes, className, href, icon, primary, secondary, onClick } = props
6266
const AvatorIcon = () => icon
6367
return (
64-
<ListItem divider={true} className={className} onClick={onClick}>
65-
<Link href={href}>
66-
<a className={classes.anchorLink}>
67-
<Avatar>
68-
<AvatorIcon />
69-
</Avatar>
68+
<Link href={href}>
69+
<a className={classes.anchorLink} onClick={onClick}>
70+
<ListItem alignItems="center" divider={true} className={className}>
71+
<ListItemAvatar>
72+
<Avatar>
73+
<AvatorIcon />
74+
</Avatar>
75+
</ListItemAvatar>
7076
<ListItemText
7177
primary={<span className={classes.listItemPrimary}>{primary}</span>}
7278
secondary={
7379
<span className={classes.listItemSecondary}>{secondary}</span>
7480
}
7581
/>
76-
</a>
77-
</Link>
78-
</ListItem>
82+
</ListItem>
83+
</a>
84+
</Link>
7985
)
8086
}
8187

components/molecules/PageHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const styles = (theme: Theme) =>
1515
root: {
1616
backgroundColor: theme.palette.primary.main,
1717
color: theme.palette.primary.contrastText,
18-
padding: theme.spacing.unit * 2,
18+
padding: theme.spacing(2),
1919
textAlign: "center",
2020
},
2121
title: {
@@ -24,7 +24,7 @@ const styles = (theme: Theme) =>
2424
alignItems: "center",
2525
fontWeight: "bold",
2626
fontSize: "3em",
27-
padding: theme.spacing.unit * 2,
27+
padding: theme.spacing(2),
2828
},
2929
description: {},
3030
})

components/organisms/HeaderArticleContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const styles = (theme: Theme) =>
1010
createStyles({
1111
root: {},
1212
contentsContainer: {
13-
padding: theme.spacing.unit,
13+
padding: theme.spacing(1),
1414
},
1515
})
1616

components/organisms/Sidenavi.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ const styles = (theme: Theme) =>
3737
},
3838
listItem: {
3939
border: 0,
40-
fontSize: 40,
41-
padding: "15px 5px 15px 15px",
42-
boxShadow: theme.shadows[1],
40+
boxShadow: theme.shadows[3],
4341
},
4442
deactive: {
4543
transition: "background-color 1.2s", // mouse out

deploy-appengine.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ GAE_APP_YML="app.yaml"
44
GAE_DEPLOY_VERSION="<<DEPLOY_VERSION>>"
55
GAE_URL="https://${GAE_DEPLOY_VERSION}-dot-${GAE_PRJ_ID}.appspot.com"
66

7-
yarn build
7+
npm run build
88

99
if [ $? -ne 0 ]; then
10-
echo "yarn build failed."
10+
echo "npm build failed."
1111
exit 1
1212
fi
1313

0 commit comments

Comments
 (0)