-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathindex.js
More file actions
61 lines (58 loc) · 1.71 KB
/
index.js
File metadata and controls
61 lines (58 loc) · 1.71 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
import * as React from "react"
import { useEffect, useState } from "react";
import { Helmet } from "react-helmet";
import { makeStyles } from '@material-ui/core/styles';
import { Box, Typography } from '@material-ui/core';
import theme from '../../../theme';
import ContribModule from '../../../components/contrib-module';
import Grid from '@material-ui/core/Grid';
const useStyles = makeStyles({
main: {
'& h1': {
color: theme.palette.text.secondary,
fontWeight: 300,
fontSize: '2rem',
lineHeight: 1.3,
letterSpacing: '-.01em',
margin: '0 0 1.25rem',
},
'& h2': {
margin: '1.6rem 0 0.64rem',
fontSize: '1.5625rem',
fontWeight: 300,
lineHeight: 1.4,
letterSpacing: '-.01em',
}
},
modules: {
flexGrow: 1,
}
});
const ProjectsPage = () => {
const classes = useStyles();
const [contribModules, setContribModules] = useState([]);
useEffect(() => {
async function fetchData() {
const response = await fetch(`https://raw.githubusercontent.com/wotnak/farmos-community-projects/main/projects.json`)
const data = await response.json();
if (data.projects) {
setContribModules(data.projects)
}
}
fetchData();
}, []);
return (
<>
<Helmet title="Contrib modules"></Helmet>
<Box component='main' className={classes.main}>
<Typography variant='h1'>Contrib modules</Typography>
<Grid container className={classes.modules} spacing={2}>
{contribModules.length > 0 && contribModules.map(module => {
return (<Grid item xs={12} md={6}><ContribModule module={module} /></Grid>)
})}
</Grid>
</Box>
</>
);
};
export default ProjectsPage;