Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 69399ac

Browse files
committed
3-end
1 parent 955d887 commit 69399ac

File tree

13 files changed

+1122
-1181
lines changed

13 files changed

+1122
-1181
lines changed

‎book/3-end/api/package.json‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
"lint": "eslint . --ext .ts,.tsx"
88
},
99
"dependencies": {
10-
"dotenv": "^16.3.1",
11-
"express": "^4.18.2",
12-
"typescript": "^5.3.2"
10+
"dotenv": "^16.4.7",
11+
"express": "^4.21.2",
12+
"typescript": "^5.8.2"
1313
},
1414
"devDependencies": {
15-
"@types/dotenv": "^8.2.0",
16-
"@types/express": "^4.17.21",
17-
"@types/node": "^20.10.1",
18-
"@typescript-eslint/eslint-plugin": "^6.13.1",
19-
"@typescript-eslint/parser": "^6.13.1",
20-
"eslint": "^8.54.0",
21-
"eslint-config-prettier": "^9.0.0",
22-
"eslint-plugin-prettier": "^5.0.1",
23-
"nodemon": "^3.0.1",
24-
"prettier": "^3.1.0",
25-
"ts-node": "^10.9.1"
15+
"@types/dotenv": "^8.2.3",
16+
"@types/express": "^5.0.1",
17+
"@types/node": "^22.13.10",
18+
"@typescript-eslint/eslint-plugin": "^8.27.0",
19+
"@typescript-eslint/parser": "^8.27.0",
20+
"eslint": "^9.22.0",
21+
"eslint-config-prettier": "^10.1.1",
22+
"eslint-plugin-prettier": "^5.2.3",
23+
"nodemon": "^3.1.9",
24+
"prettier": "^3.5.3",
25+
"ts-node": "^10.9.2"
2626
}
2727
}

‎book/3-end/api/yarn.lock‎

Lines changed: 551 additions & 833 deletions
Large diffs are not rendered by default.

‎book/3-end/app/components/common/Confirmer.tsx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import Button from '@material-ui/core/Button';
2-
import Dialog from '@material-ui/core/Dialog';
3-
import DialogActions from '@material-ui/core/DialogActions';
4-
import DialogContent from '@material-ui/core/DialogContent';
5-
import DialogContentText from '@material-ui/core/DialogContentText';
6-
import DialogTitle from '@material-ui/core/DialogTitle';
7-
import React from 'react';
1+
import Button from "@mui/material/Button";
2+
import Dialog from "@mui/material/Dialog";
3+
import DialogActions from "@mui/material/DialogActions";
4+
import DialogContent from "@mui/material/DialogContent";
5+
import DialogContentText from "@mui/material/DialogContentText";
6+
import DialogTitle from "@mui/material/DialogTitle";
7+
import React from "react";
88

99
export let openConfirmDialogExternal;
1010

@@ -21,8 +21,8 @@ class Confirmer extends React.Component<any, State> {
2121

2222
this.state = {
2323
open: false,
24-
title: 'Are you sure?',
25-
message: '',
24+
title: "Are you sure?",
25+
message: "",
2626
onAnswer: null,
2727
};
2828

@@ -41,7 +41,7 @@ class Confirmer extends React.Component<any, State> {
4141
<DialogContent>
4242
<DialogContentText id="alert-dialog-description">{this.state.message}</DialogContentText>
4343
</DialogContent>
44-
<DialogActions style={{ padding: '10px' }}>
44+
<DialogActions style={{ padding: "10px" }}>
4545
<Button onClick={this.handleClose} variant="contained" color="primary" autoFocus>
4646
Cancel
4747
</Button>

‎book/3-end/app/components/common/MenuWithLinks.tsx‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import Menu from '@material-ui/core/Menu';
2-
import MenuItem from '@material-ui/core/MenuItem';
3-
import Link from 'next/link';
4-
import { NextRouter, withRouter } from 'next/router';
5-
import React from 'react';
1+
import Menu from "@mui/material/Menu";
2+
import MenuItem from "@mui/material/MenuItem";
3+
import Link from "next/link";
4+
import { NextRouter, withRouter } from "next/router";
5+
import React from "react";
66

77
type Props = {
88
options: {
@@ -34,38 +34,32 @@ class MenuWithLinks extends React.PureComponent<Props, State> {
3434
const { anchorEl } = this.state;
3535

3636
return (
37-
<div style={{ textAlign: 'center' }}>
37+
<div style={{ textAlign: "center" }}>
3838
<div
39-
aria-controls={anchorEl ? 'simple-menu' : null}
39+
aria-controls={anchorEl ? "simple-menu" : null}
4040
aria-haspopup="true"
4141
onClick={this.handleClick}
4242
onKeyPress={this.handleClick}
4343
>
4444
{children}
4545
</div>
46-
<Menu
47-
id="simple-menu"
48-
anchorEl={anchorEl}
49-
open={Boolean(anchorEl)}
50-
onClose={this.handleClose}
51-
keepMounted
52-
>
46+
<Menu id="simple-menu" anchorEl={anchorEl} open={Boolean(anchorEl)} onClose={this.handleClose} keepMounted>
5347
{options.map((option, i) =>
5448
option.separator ? (
55-
<hr style={{ width: '85%', margin: '10px auto' }} key={`separated-${i}`} />
49+
<hr style={{ width: "85%", margin: "10px auto" }} key={`separated-${i}`} />
5650
) : (
5751
<Link key={option.href} href={option.href} as={option.as} passHref>
5852
<MenuItem
5953
key={option.href}
6054
style={{
6155
fontWeight: router.asPath.includes(option.highlighterSlug) ? 600 : 300,
62-
fontSize: '14px',
56+
fontSize: "14px",
6357
}}
6458
>
6559
{option.text}
6660
</MenuItem>
6761
</Link>
68-
),
62+
)
6963
)}
7064
</Menu>
7165
</div>

‎book/3-end/app/components/common/Notifier.tsx‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Snackbar from '@material-ui/core/Snackbar';
2-
import React from 'react';
1+
import Snackbar from "@mui/material/Snackbar";
2+
import React from "react";
33

44
export let openSnackbarExternal;
55

@@ -15,24 +15,22 @@ class Notifier extends React.PureComponent<any, State> {
1515

1616
this.state = {
1717
open: false,
18-
message: '',
18+
message: "",
1919
};
2020
}
2121

2222
public render() {
23-
const message = (
24-
<span id="snackbar-message-id" dangerouslySetInnerHTML={{ __html: this.state.message }} />
25-
);
23+
const message = <span id="snackbar-message-id" dangerouslySetInnerHTML={{ __html: this.state.message }} />;
2624

2725
return (
2826
<Snackbar
29-
anchorOrigin={{ vertical: 'top', horizontal: 'right' }}
27+
anchorOrigin={{ vertical: "top", horizontal: "right" }}
3028
message={message}
3129
autoHideDuration={5000}
3230
onClose={this.handleSnackbarClose}
3331
open={this.state.open}
3432
ContentProps={{
35-
'aria-describedby': 'snackbar-message-id',
33+
"aria-describedby": "snackbar-message-id",
3634
}}
3735
/>
3836
);
@@ -41,7 +39,7 @@ class Notifier extends React.PureComponent<any, State> {
4139
public handleSnackbarClose = () => {
4240
this.setState({
4341
open: false,
44-
message: '',
42+
message: "",
4543
});
4644
};
4745

‎book/3-end/app/components/layout/index.tsx‎

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import Avatar from '@material-ui/core/Avatar';
2-
import Grid from '@material-ui/core/Grid';
3-
import React from 'react';
4-
import MenuWithLinks from '../common/MenuWithLinks';
5-
import Confirmer from '../common/Confirmer';
6-
import Notifier from '../common/Notifier';
1+
import Avatar from "@mui/material/Avatar";
2+
import Grid from "@mui/material/Grid";
3+
import React from "react";
4+
import MenuWithLinks from "../common/MenuWithLinks";
5+
import Confirmer from "../common/Confirmer";
6+
import Notifier from "../common/Notifier";
77

88
const styleGrid = {
9-
width: '100%',
10-
height: '100vh',
11-
maxWidth: '100%',
12-
padding: '0px 10px',
13-
display: 'flex',
14-
overflow: 'hidden',
9+
width: "100%",
10+
height: "100vh",
11+
maxWidth: "100%",
12+
padding: "0px 10px",
13+
display: "flex",
14+
overflow: "hidden",
1515
};
1616

1717
const styleGridIsMobile = {
18-
width: '100%',
19-
height: '100vh',
20-
maxWidth: '100%',
21-
padding: '0px 0px 0px 10px',
22-
display: 'flex',
23-
overflow: 'hidden',
18+
width: "100%",
19+
height: "100vh",
20+
maxWidth: "100%",
21+
padding: "0px 0px 0px 10px",
22+
display: "flex",
23+
overflow: "hidden",
2424
};
2525

2626
type Props = {
@@ -51,21 +51,21 @@ class Layout extends React.Component<Props> {
5151
sm={2}
5252
xs={12}
5353
style={{
54-
borderRight: '1px #707070 solid',
55-
justifyContent: 'center',
56-
overflow: 'hidden',
54+
borderRight: "1px #707070 solid",
55+
justifyContent: "center",
56+
overflow: "hidden",
5757
}}
5858
>
59-
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
59+
<div style={{ display: "flex", justifyContent: "space-between" }}>
6060
<svg
6161
xmlns="http://www.w3.org/2000/svg"
6262
width="124"
6363
height="40"
6464
viewBox="0 0 124 40"
6565
style={{
66-
marginTop: '20px',
67-
display: 'inline-flex',
68-
height: '40px',
66+
marginTop: "20px",
67+
display: "inline-flex",
68+
height: "40px",
6969
}}
7070
>
7171
<g id="async-logo">
@@ -82,44 +82,44 @@ class Layout extends React.Component<Props> {
8282
id="path-async-text"
8383
d="M22.6251 11.928V24H20.7051V21.816C20.3531 22.568 19.8171 23.152 19.0971 23.568C18.3931 23.968 17.5691 24.168 16.6251 24.168C15.5531 24.168 14.6091 23.912 13.7931 23.4C12.9931 22.888 12.3691 22.168 11.9211 21.24C11.4891 20.296 11.2731 19.2 11.2731 17.952C11.2731 16.704 11.4971 15.608 11.9451 14.664C12.3931 13.704 13.0171 12.96 13.8171 12.432C14.6331 11.904 15.5691 11.64 16.6251 11.64C17.5691 11.64 18.3931 11.848 19.0971 12.264C19.8011 12.68 20.3371 13.264 20.7051 14.016V11.928H22.6251ZM17.0091 22.56C18.1931 22.56 19.1051 22.16 19.7451 21.36C20.3851 20.544 20.7051 19.392 20.7051 17.904C20.7051 16.416 20.3851 15.272 19.7451 14.472C19.1051 13.672 18.1931 13.272 17.0091 13.272C15.8251 13.272 14.8971 13.688 14.2251 14.52C13.5691 15.336 13.2411 16.48 13.2411 17.952C13.2411 19.424 13.5691 20.56 14.2251 21.36C14.8811 22.16 15.8091 22.56 17.0091 22.56ZM30.4637 24.168C28.4317 24.168 26.8237 23.648 25.6397 22.608L26.2877 21.168C26.9437 21.68 27.6077 22.048 28.2797 22.272C28.9517 22.496 29.7037 22.608 30.5357 22.608C31.4477 22.608 32.1357 22.456 32.5997 22.152C33.0797 21.832 33.3197 21.376 33.3197 20.784C33.3197 20.304 33.1597 19.92 32.8397 19.632C32.5197 19.344 31.9917 19.12 31.2557 18.96L29.2157 18.48C28.2077 18.256 27.4237 17.856 26.8637 17.28C26.3197 16.704 26.0477 16.016 26.0477 15.216C26.0477 14.16 26.4717 13.304 27.3197 12.648C28.1677 11.976 29.2877 11.64 30.6797 11.64C31.5277 11.64 32.3277 11.776 33.0797 12.048C33.8317 12.32 34.4637 12.712 34.9757 13.224L34.3277 14.64C33.1917 13.696 31.9757 13.224 30.6797 13.224C29.8157 13.224 29.1437 13.392 28.6637 13.728C28.1997 14.048 27.9677 14.504 27.9677 15.096C27.9677 15.592 28.1117 15.984 28.3997 16.272C28.7037 16.56 29.1837 16.784 29.8397 16.944L31.8797 17.448C32.9997 17.704 33.8317 18.104 34.3757 18.648C34.9197 19.176 35.1917 19.872 35.1917 20.736C35.1917 21.776 34.7677 22.608 33.9197 23.232C33.0717 23.856 31.9197 24.168 30.4637 24.168ZM48.687 11.928L43.047 25.104C42.455 26.48 41.711 27.488 40.815 28.128C39.919 28.768 38.815 29.208 37.503 29.448L37.095 27.936C38.231 27.68 39.087 27.336 39.663 26.904C40.255 26.488 40.743 25.84 41.127 24.96L41.607 23.88L36.495 11.928H38.535L42.615 21.888L46.743 11.928H48.687ZM56.853 11.64C59.749 11.64 61.197 13.232 61.197 16.416V24H59.253V16.512C59.253 15.392 59.029 14.576 58.581 14.064C58.133 13.536 57.429 13.272 56.469 13.272C55.349 13.272 54.453 13.616 53.781 14.304C53.109 14.992 52.773 15.92 52.773 17.088V24H50.829V15.312C50.829 14.064 50.765 12.936 50.637 11.928H52.485L52.677 14.088C53.045 13.304 53.597 12.704 54.333 12.288C55.069 11.856 55.909 11.64 56.853 11.64ZM69.9321 24.168C68.7641 24.168 67.7401 23.912 66.8601 23.4C65.9961 22.888 65.3241 22.168 64.8441 21.24C64.3801 20.296 64.1481 19.2 64.1481 17.952C64.1481 16.704 64.3881 15.608 64.8681 14.664C65.3481 13.704 66.0281 12.96 66.9081 12.432C67.8041 11.904 68.8441 11.64 70.0281 11.64C70.8441 11.64 71.6281 11.784 72.3801 12.072C73.1481 12.344 73.7801 12.728 74.2761 13.224L73.6281 14.664C73.0201 14.184 72.4281 13.832 71.8521 13.608C71.2921 13.384 70.7161 13.272 70.1241 13.272C68.8921 13.272 67.9241 13.688 67.2201 14.52C66.5161 15.336 66.1641 16.48 66.1641 17.952C66.1641 19.408 66.5081 20.544 67.1961 21.36C67.9001 22.16 68.8761 22.56 70.1241 22.56C70.7161 22.56 71.2921 22.448 71.8521 22.224C72.4281 22 73.0201 21.648 73.6281 21.168L74.2761 22.608C73.7641 23.088 73.1161 23.472 72.3321 23.76C71.5641 24.032 70.7641 24.168 69.9321 24.168Z"
8484
transform="translate(39 4)"
85-
fill={isThemeDark ? 'white' : 'black'}
85+
fill={isThemeDark ? "white" : "black"}
8686
/>
8787
</g>
8888
</svg>
8989
<MenuWithLinks
9090
options={[
9191
{
92-
text: 'Index page',
93-
href: '/',
94-
highlighterSlug: '/',
92+
text: "Index page",
93+
href: "/",
94+
highlighterSlug: "/",
9595
},
9696
{
97-
text: 'Your Settings',
98-
href: '/your-settings',
99-
highlighterSlug: '/your-settings',
97+
text: "Your Settings",
98+
href: "/your-settings",
99+
highlighterSlug: "/your-settings",
100100
},
101101
{
102102
separator: true,
103103
},
104104
{
105-
text: 'Log out',
106-
href: '/logout',
105+
text: "Log out",
106+
href: "/logout",
107107
},
108108
]}
109109
>
110110
<Avatar
111-
src={'https://storage.googleapis.com/async-await/default-user.png'}
111+
src={"https://storage.googleapis.com/async-await/default-user.png"}
112112
alt="Add username here later in the book"
113113
style={{
114-
margin: '20px auto',
115-
cursor: 'pointer',
116-
display: 'inline-flex',
117-
width: '40px',
118-
height: '40px',
114+
margin: "20px auto",
115+
cursor: "pointer",
116+
display: "inline-flex",
117+
width: "40px",
118+
height: "40px",
119119
}}
120120
/>
121121

122-
<i className="material-icons" color="action" style={{ verticalAlign: 'super' }}>
122+
<i className="material-icons" color="action" style={{ verticalAlign: "super" }}>
123123
arrow_drop_down
124124
</i>
125125
</MenuWithLinks>

‎book/3-end/app/lib/theme.ts‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
import { createMuiTheme } from '@material-ui/core/styles';
1+
import { createMuiTheme } from "@mui/material/styles";
22

33
const themeDark = createMuiTheme({
44
palette: {
5-
primary: { main: '#238636' },
6-
secondary: { main: '#b62324' },
7-
type: 'dark',
8-
background: { default: '#0d1117' },
5+
primary: { main: "#238636" },
6+
secondary: { main: "#b62324" },
7+
type: "dark",
8+
background: { default: "#0d1117" },
99
text: {
10-
primary: '#c9d1d9',
10+
primary: "#c9d1d9",
1111
},
1212
},
1313
typography: {
1414
button: {
15-
textTransform: 'none',
15+
textTransform: "none",
1616
},
1717
},
1818
});
1919

2020
const themeLight = createMuiTheme({
2121
palette: {
22-
primary: { main: '#238636' },
23-
secondary: { main: '#b62324' },
24-
type: 'light',
25-
background: { default: '#fff' },
22+
primary: { main: "#238636" },
23+
secondary: { main: "#b62324" },
24+
type: "light",
25+
background: { default: "#fff" },
2626
text: {
27-
primary: '#222',
27+
primary: "#222",
2828
},
2929
},
3030
typography: {
3131
button: {
32-
textTransform: 'none',
32+
textTransform: "none",
3333
},
3434
},
3535
});

‎book/3-end/app/package.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"lint": "eslint . --ext .ts,.tsx"
99
},
1010
"dependencies": {
11-
"@material-ui/core": "^4.12.4",
12-
"@material-ui/styles": "^4.11.5",
11+
"@emotion/react": "^11.14.0",
12+
"@emotion/styled": "^11.14.0",
13+
"@mui/material": "^6.4.8",
14+
"@mui/system": "^6.4.8",
1315
"dotenv": "^16.3.1",
1416
"express": "^4.18.2",
1517
"isomorphic-unfetch": "^4.0.2",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /