Skip to content

Commit d9ac9a5

Browse files
author
Alex Patterson
committed
update for next 9
1 parent 1c6eb6e commit d9ac9a5

18 files changed

+2255
-2878
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["next/babel", "@zeit/next-typescript/babel"]
2+
"presets": ["next/babel"]
33
}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ node_modules
22
.next
33
out
44
hosting*
5-
dist/
5+
dist
6+
.firebase
7+
.next

components/BookCard.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const useStyles = makeStyles(theme => ({
6464
}
6565
}));
6666

67-
const BookCard = (prop: { book: Book }) => {
67+
const BookCard = ({ book }: { book: Book }) => {
6868
const classes = useStyles();
6969
const [expanded, setExpanded] = React.useState(false);
7070
const handleExpandClick = () => {
@@ -76,18 +76,18 @@ const BookCard = (prop: { book: Book }) => {
7676
Show this as an example of how we would use SSR
7777
<NextLink href={`/book?id=${book.id}`} as={`/book/${book.slug}`}>
7878
*/}
79-
<NextLink href={`/book?id=${prop.book.id}`}>
79+
<NextLink href={`/book?id=${book.id}`}>
8080
<CardActionArea>
8181
<CardMedia
8282
className={classes.cardMedia}
83-
image={prop.book.cover || '/static/images/cards/book.png'}
84-
title={prop.book.title}
83+
image={book.cover || '/static/images/cards/book.png'}
84+
title={book.title}
8585
/>
8686
<CardContent className={classes.cardContent}>
87-
<Typography component="h1">{prop.book.title}</Typography>
87+
<Typography component="h1">{book.title}</Typography>
8888
<Typography component="p">
8989
Author:
90-
{` ${prop.book.authorDisplayName}`}
90+
{` ${book.authorDisplayName}`}
9191
</Typography>
9292
</CardContent>
9393
</CardActionArea>
@@ -108,7 +108,7 @@ const BookCard = (prop: { book: Book }) => {
108108
<Collapse in={expanded} timeout="auto" unmountOnExit>
109109
<CardContent className={classes.cardContent}>
110110
<Typography paragraph className={classes.cardDescription}>
111-
{prop.book.description}
111+
{book.description}
112112
</Typography>
113113
</CardContent>
114114
</Collapse>

components/ChapterDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import BookModel from '../models/BookModel';
88
import Chapter from '../models/ChapterModel';
99
import PageModel from '../models/PageModel';
1010

11-
const useStyles = makeStyles(theme => ({
11+
const useStyles = makeStyles(() => ({
1212
card: {
1313
width: '100%',
1414
maxWidth: 400,

components/MenuAppBar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const useStyles = makeStyles(() =>
2525

2626
function MenuAppBar() {
2727
const classes = useStyles();
28-
const [auth, setAuth] = React.useState(false);
28+
const [auth] = React.useState(false);
2929
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
3030
const open = Boolean(anchorEl);
3131

components/MenuAppDrawer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function MenuAppDrawer() {
3535
right: false
3636
});
3737

38-
const toggleDrawer = (side, open) => event => {
38+
const toggleDrawer = (side: string, open: boolean) => (event: any) => {
3939
if (
4040
event.type === 'keydown' &&
4141
(event.key === 'Tab' || event.key === 'Shift')
@@ -46,7 +46,7 @@ function MenuAppDrawer() {
4646
setState({ ...state, [side]: open });
4747
};
4848

49-
const fullList = side => (
49+
const fullList = (side: string) => (
5050
<div
5151
className={classes.fullList}
5252
role="presentation"

firebase.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,6 @@
1515
{
1616
"source": "/book{,/**}",
1717
"function": "book"
18-
},
19-
{
20-
"source": "/books",
21-
"function": "books"
22-
},
23-
{
24-
"source": "**/**",
25-
"function": "index"
2618
}
2719
]
2820
}

0 commit comments

Comments
 (0)