Skip to content

Commit caadcd1

Browse files
committed
feat: cocktail
1 parent 89035ee commit caadcd1

File tree

9 files changed

+119
-72
lines changed

9 files changed

+119
-72
lines changed

content/posts/chess-and-healthy-pot.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 象棋和养生锅更配噢 - 19.10.13
3-
categories: [life]
3+
categories: [life, foodie]
44
tags: [life]
55
date: 2019-12-21 22:50:27
6+
cover: https://static.wuyuying.com/5F783151-ED9D-483C-B2E2-80653034631E.jpeg
67
---
78

89
下午和小青、小十一下象棋,我和十一水平相当,对决了很久。小青比较犀利,在我没察觉的情况下,直接将军,太难了 😭

content/posts/meal-20191013.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 蘑菇肉酱 - 19.10.13
3-
categories: [life]
3+
categories: [life,foodie]
44
tags: [cooking]
55
date: 2019-10-13 18:32:27
6+
cover: https://static.wuyuying.com/mushroom-source-1.jpg
67
---
78

89
我的第一道蘑菇肉酱,拌面超好吃~

content/posts/meal-20191122.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 家常烤五花肉 - 19.11.22
3-
categories: [life]
3+
categories: [life,foodie]
44
tags: [cooking]
55
date: 2019-11-22 22:32:27
6+
cover: https://static.wuyuying.com/884D7280-B547-4BEC-B1C8-724DE1CA7315.jpeg
67
---
78

89
在家烤肉幸福感特强,就是在客厅搞,油烟比较大。

content/posts/meal-20191124.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 冬日烤盘 - 19.11.24
3-
categories: [life]
3+
categories: [life, foodie]
44
tags: [cooking]
55
date: 2019-11-24 13:32:27
6+
cover: https://static.wuyuying.com/life/IMG_20191123_134411-01.jpg
67
---
78

89
上周末做了个冬日烤盘,超好吃~

content/posts/meal-20191201.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 十二月的冬日火锅 - 19.12.01
3-
categories: [life]
3+
categories: [life, foodie]
44
tags: [cooking]
55
date: 2019-12-01 13:32:27
6+
cover: https://static.wuyuying.com/wucanrou.jpeg
67
---
78

89
饿不饿呀,煮个餐蛋面给你吃~

content/posts/meal-20191208.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
---
22
title: 十二月的冬日烤盘 - 大虾、茄子
3-
categories: [life]
3+
categories: [life, foodie]
44
tags: [cooking]
55
date: 2019-12-08 22:39:27
6+
cover: https://static.wuyuying.com/10491B2F-5839-47F2-B3EA-0897871039E0.jpeg
67
---
78

89
浮夸的蔬菜+大虾烤盘~ 这次的酱料很棒,可能是柠檬汁多了一些,大虾外壳的酱料的一点柠檬酸,简直完美 👍

content/posts/meals-2020.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
22
title: 2020年做的那些菜
3-
categories: [life]
3+
categories: [life, foodie]
44
tags: [cooking]
55
date: 2020-09-20 12:46:27
66
createDate: 2020-07-18 11:17:27
7+
cover: https://static.wuyuying.com/meal-2020/0918.jpg
78
---
89

910
下半年开始过上了要和室友一起做早餐、做正餐的生活……WHAT!? 以前都是不用做饭的么?真的,我以前都可以抱大厨大腿,要么点外卖,要么出去吃,不……用……做 Orz

src/components/cocktail-card/index.jsx

Lines changed: 39 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ import Card from '@material-ui/core/Card';
55
import CardHeader from '@material-ui/core/CardHeader';
66
import CardMedia from '@material-ui/core/CardMedia';
77
import CardContent from '@material-ui/core/CardContent';
8-
import CardActions from '@material-ui/core/CardActions';
9-
import Collapse from '@material-ui/core/Collapse';
10-
// import Avatar from '@material-ui/core/Avatar';
11-
import IconButton from '@material-ui/core/IconButton';
8+
// import CardActions from '@material-ui/core/CardActions';
9+
// import Collapse from '@material-ui/core/Collapse';
10+
import Avatar from '@material-ui/core/Avatar';
11+
// import IconButton from '@material-ui/core/IconButton';
1212
import Typography from '@material-ui/core/Typography';
13-
import { red } from '@material-ui/core/colors';
14-
import FavoriteIcon from '@material-ui/icons/Favorite';
13+
// import { red } from '@material-ui/core/colors';
14+
// import FavoriteIcon from '@material-ui/icons/Favorite';
1515
// import ShareIcon from '@material-ui/icons/Share';
16-
import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
16+
// import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
17+
// import { MDXRenderer } from "gatsby-plugin-mdx"
18+
import moment from 'moment'
1719
// import MoreVertIcon from '@material-ui/icons/MoreVert';
1820

1921
const useStyles = makeStyles((theme) => ({
@@ -34,12 +36,24 @@ const useStyles = makeStyles((theme) => ({
3436
expandOpen: {
3537
transform: 'rotate(180deg)',
3638
},
37-
avatar: {
38-
backgroundColor: red[500],
39+
excerpt: {
40+
height: 140,
3941
},
42+
title: {
43+
color: '#333',
44+
textDecoration: 'none',
45+
}
4046
}));
4147

42-
export default function RecipeReviewCard() {
48+
export default function RecipeReviewCard({
49+
slug,
50+
title,
51+
body,
52+
cover,
53+
// tags,
54+
date,
55+
excerpt,
56+
}) {
4357
const classes = useStyles();
4458
const [expanded, setExpanded] = React.useState(false);
4559

@@ -51,32 +65,30 @@ export default function RecipeReviewCard() {
5165
<Card className={classes.root}>
5266
<CardHeader
5367
avatar={
54-
<div aria-label="recipe" className={classes.avatar}>
55-
R
68+
<div aria-label="recipe">
69+
<Avatar alt="Yuying Wu" src="https://wuyuying.com/static/d07198b678ca849341724d014eb9a47e/eee8e/avatar.jpg" />
5670
</div>
5771
}
5872
action={null}
59-
title="Shrimp and Chorizo Paella"
60-
subheader="September 14, 2016"
73+
title={<a href={`https://wuyuying.com/${slug}`} target="_blank" className={classes.title}>{title}</a>}
74+
subheader={moment(date).format('YY/MM/DD')}
6175
/>
6276
<CardMedia
6377
className={classes.media}
64-
image="https://material-ui.com/static/images/cards/paella.jpg"
65-
title="Paella dish"
78+
image={cover || 'https://material-ui.com/static/images/cards/paella.jpg'}
79+
title={title}
6680
/>
6781
<CardContent>
68-
<Typography variant="body2" color="textSecondary" component="p">
69-
This impressive paella is a perfect party dish and a fun meal to cook together with your
70-
guests. Add 1 cup of frozen peas along with the mussels, if you like.
82+
<Typography variant="body2" color="textSecondary" component="p" className={classes.excerpt}>{ excerpt }
7183
</Typography>
7284
</CardContent>
73-
<CardActions disableSpacing>
85+
{/* <CardActions disableSpacing>
7486
<IconButton aria-label="add to favorites">
7587
<FavoriteIcon />
7688
</IconButton>
77-
{/* <IconButton aria-label="share">
89+
<IconButton aria-label="share">
7890
<ShareIcon />
79-
</IconButton> */}
91+
</IconButton>
8092
<IconButton
8193
className={classes.expand}
8294
onClick={handleExpandClick}
@@ -85,34 +97,14 @@ export default function RecipeReviewCard() {
8597
>
8698
<ExpandMoreIcon />
8799
</IconButton>
88-
</CardActions>
89-
<Collapse in={expanded} timeout="auto" unmountOnExit>
100+
</CardActions> */}
101+
{/* <Collapse in={expanded} timeout="auto" unmountOnExit>
90102
<CardContent>
91-
<Typography paragraph>Method:</Typography>
92-
<Typography paragraph>
93-
Heat 1/2 cup of the broth in a pot until simmering, add saffron and set aside for 10
94-
minutes.
95-
</Typography>
96-
<Typography paragraph>
97-
Heat oil in a (14- to 16-inch) paella pan or a large, deep skillet over medium-high
98-
heat. Add chicken, shrimp and chorizo, and cook, stirring occasionally until lightly
99-
browned, 6 to 8 minutes. Transfer shrimp to a large plate and set aside, leaving chicken
100-
and chorizo in the pan. Add pimentón, bay leaves, garlic, tomatoes, onion, salt and
101-
pepper, and cook, stirring often until thickened and fragrant, about 10 minutes. Add
102-
saffron broth and remaining 4 1/2 cups chicken broth; bring to a boil.
103-
</Typography>
104-
<Typography paragraph>
105-
Add rice and stir very gently to distribute. Top with artichokes and peppers, and cook
106-
without stirring, until most of the liquid is absorbed, 15 to 18 minutes. Reduce heat to
107-
medium-low, add reserved shrimp and mussels, tucking them down into the rice, and cook
108-
again without stirring, until mussels have opened and rice is just tender, 5 to 7
109-
minutes more. (Discard any mussels that don’t open.)
110-
</Typography>
111-
<Typography>
112-
Set aside off of the heat to let rest for 10 minutes, and then serve.
103+
<Typography variant="caption" color="textSecondary" component="p">
104+
<MDXRenderer>{body}</MDXRenderer>
113105
</Typography>
114106
</CardContent>
115-
</Collapse>
107+
</Collapse> */}
116108
</Card>
117109
);
118110
}

src/pages/cocktail.js

Lines changed: 66 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import CssBaseline from '@material-ui/core/CssBaseline';
44
import Container from '@material-ui/core/Container';
55
import Grid from '@material-ui/core/Grid';
66
import Hidden from '@material-ui/core/Hidden';
7+
import { graphql } from "gatsby";
8+
import Typography from '@material-ui/core/Typography';
79
import CocktailCard from '../components/cocktail-card';
810

9-
const HEADER_HEIGHT = '40vh';
11+
const HEADER_HEIGHT = '20vh';
1012
const styles = {
1113
root: {
1214
backgroundColor: '#E2DDCC',
@@ -19,7 +21,7 @@ const styles = {
1921
headerContainer: {
2022
height: HEADER_HEIGHT,
2123
backgroundColor: '#000',
22-
// fontSize: 30,
24+
marginBottom: 16,
2325
},
2426
header: {
2527
display: 'flex',
@@ -33,50 +35,96 @@ const styles = {
3335
width: 120,
3436
height: 120,
3537
},
38+
logoSmall: {
39+
display: 'inline-block',
40+
width: 100,
41+
height: 100,
42+
},
3643
headerTitle: {
3744
textAlign: 'left',
3845
color: '#C93801',
3946
// lineHeight: HEADER_HEIGHT,
4047
margin: 0,
48+
fontSize: 60,
49+
},
50+
headerTitleSmall: {
51+
color: '#C93801',
52+
lineHeight: 1,
53+
fontSize: 24,
54+
},
55+
footer: {
56+
backgroundColor: '#000',
57+
padding: '20px 0',
58+
textAlign: 'center',
59+
color: '#fff',
60+
marginTop: '16px',
4161
}
4262
};
4363

4464

4565
class App extends Component {
66+
constructor(props) {
67+
super(props);
68+
}
69+
4670
render() {
47-
const { classes } = this.props;
71+
const { classes, data } = this.props;
72+
const { allMdx: { edges: list = [] } = {} } = data;
4873

4974
return (
5075
<div className={classes.root}>
5176
<CssBaseline />
5277
<header className={classes.headerContainer}>
5378
<Container maxWidth="md" className={classes.header}>
54-
<img className={classes.logo} src="https://static.wuyuying.com/cocktail-logo.png" />
55-
<Hidden xsUp>
79+
<Hidden only={['sm', 'xs']}>
80+
<img className={classes.logo} src="https://static.wuyuying.com/cocktail-logo.png" />
5681
<h1 className={classes.headerTitle}>Home Bar Cocktail</h1>
5782
</Hidden>
83+
<Hidden only={['md', 'lg', 'xl']}>
84+
<img className={classes.logoSmall} src="https://static.wuyuying.com/cocktail-logo.png" />
85+
<h1 className={classes.headerTitleSmall}>Home Bar Cocktail</h1>
86+
</Hidden>
5887
</Container>
5988
</header>
6089

6190
<Container maxWidth="lg">
6291
<Grid container spacing={2}>
63-
<Grid item lg={3} md={4} sm={6} xs={12}>
64-
<CocktailCard />
65-
</Grid>
66-
<Grid item lg={3} md={4} sm={6} xs={12}>
67-
<CocktailCard />
68-
</Grid>
69-
<Grid item lg={3} md={4} sm={6} xs={12}>
70-
<CocktailCard />
71-
</Grid>
72-
<Grid item lg={3} md={4} sm={6} xs={12}>
73-
<CocktailCard />
74-
</Grid>
92+
{ list.map(card => (
93+
<Grid item lg={3} md={4} sm={6} xs={12} key={card.node.slug}>
94+
<CocktailCard body={card.node.body} excerpt={card.node.excerpt} slug={card.node.slug} {...card.node.frontmatter} />
95+
</Grid>
96+
))}
7597
</Grid>
7698
</Container>
99+
100+
<footer>
101+
<Typography variant="body2" color="textSecondary" component="p" className={classes.footer}>Power by <a href="https://wuyuying.com/" target="_blank" style={{ color: '#fff' }}>wuyuying.com.</a>
102+
</Typography>
103+
</footer>
77104
</div>
78105
)
79106
}
80107
}
81108

82-
export default withStyles(styles)(App);
109+
export default withStyles(styles)(App);
110+
111+
export const pageQuery = graphql`
112+
{
113+
allMdx(filter: {frontmatter: {categories: {in: "foodie"}}}) {
114+
edges {
115+
node {
116+
frontmatter {
117+
title
118+
categories
119+
cover
120+
tags
121+
date
122+
}
123+
excerpt(truncate: true)
124+
slug
125+
body
126+
}
127+
}
128+
}
129+
}
130+
`;

0 commit comments

Comments
 (0)