This repository was archived by the owner on Mar 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathProjects.js
More file actions
executable file
·82 lines (75 loc) · 1.61 KB
/
Projects.js
File metadata and controls
executable file
·82 lines (75 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import React from 'react';
import PropTypes from 'prop-types';
import { Container, Typography, makeStyles, Box } from '@material-ui/core';
const useStyles = makeStyles(theme => ({
root: {
backgroundColor: '#F2F7FF',
paddingTop: theme.spacing(1),
borderRadius: '5px'
},
centerCls: {
paddingLeft: '5px',
paddingRight: '5px'
}
}));
function Projects({ title, projects, flat }) {
const classes = useStyles();
return (
<div className={classes.root}>
<Container
maxWidth="lg"
style={{
width: flat ? '100%' : '360px'
}}
>
<Box
display="flex"
flexDirection="column"
style={{
flexWrap: flat ? 'nowrap' : 'wrap'
}}
>
<Typography
variant="h4"
style={{
margin: '12px 0px 12px 8px'
}}
>
{title}
</Typography>
{projects.map((project, index) => {
return <Project project={project} />;
})}
</Box>
</Container>
</div>
);
}
function Project({ project }) {
return (
<Box
display="inline-flex"
flexDirection="column"
width="300px"
style={{
margin: '8px',
padding: '8px 0px'
}}
>
<img
alt={project.title}
src={project.img}
style={{
width: '100%',
height: '100%',
marginBottom: '8px'
}}
/>
<Typography>{project.title}</Typography>
</Box>
);
}
Projects.propTypes = {
className: PropTypes.string
};
export default Projects;