Replace links by RezoMenu component

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2021-07-19 23:41:59 +02:00
parent e4056b1a1d
commit b1e3be2702
+51 -64
View File
@@ -1,19 +1,53 @@
import {useState} from 'react' import {useState} from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import Image from 'next/image' import Image from 'next/image'
import {Button, Container, Grid, Typography, useMediaQuery, Link} from '@material-ui/core' import {Button, Container, Grid, Typography, useMediaQuery} from '@material-ui/core'
import {makeStyles} from '@material-ui/core/styles'
import HelpIcon from '@material-ui/icons/Help' import HelpIcon from '@material-ui/icons/Help'
import ChatIcon from '@material-ui/icons/Chat' import GroupIcon from '@material-ui/icons/Group'
import GroupAddIcon from '@material-ui/icons/GroupAdd' import MusicNoteIcon from '@material-ui/icons/MusicNote'
import OndemandVideoIcon from '@material-ui/icons/OndemandVideo' import {Pleroma, Peertube} from '@icons-pack/react-simple-icons'
import KatKayLa from '../components/kat-kay-la' import KatKayLa from '../components/kat-kay-la'
import HeadLayout from '../components/head-layout' import HeadLayout from '../components/head-layout'
import Carousel from '../components/carousel' import Carousel from '../components/carousel'
import Footer from '../components/footer' import Footer from '../components/footer'
import {jwennTeksKantite, jwennAwtisKantite} from '../lib/oki-api' import {jwennTeksKantite, jwennAwtisKantite} from '../lib/oki-api'
import RezoMenu from '../components/rezo-menu'
const useStyles = makeStyles(theme => ({
root: {
'& > *': {
margin: theme.spacing(2)
}
}
}))
const REZO = [
{
id: 'mizik',
tit: 'Mizik',
icon: <MusicNoteIcon />
},
{
id: 'pale',
tit: 'Palé',
icon: <Pleroma />
},
{
id: 'gade',
tit: 'Gadé',
icon: <Peertube />
},
{
id: 'mobilize',
tit: 'Mobilizé',
icon: <GroupIcon />
}
]
export default function Home({kantiteAwtis, kantiteTeks}) { export default function Home({kantiteAwtis, kantiteTeks}) {
const classes = useStyles()
const [handleOpen, setHandleOpen] = useState(false) const [handleOpen, setHandleOpen] = useState(false)
const handleClick = () => { const handleClick = () => {
setHandleOpen(true) setHandleOpen(true)
@@ -40,70 +74,23 @@ export default function Home({kantiteAwtis, kantiteTeks}) {
Organisation KA Internationale Organisation KA Internationale
</Typography> </Typography>
</Container> </Container>
<Container style={{marginTop: '1.5em'}}> <Container className={classes.root} align='center'>
<RezoMenu data={REZO} />
<Button
startIcon={<HelpIcon style={{fontSize: 25}} />}
size='large'
variant='contained'
color='primary'
onClick={handleClick}
>
Èd
</Button>
</Container>
<Container style={{marginBlock: '1.5em'}}>
<Grid container spacing={3}> <Grid container spacing={3}>
{kantite.map(k => <KatKayLa key={k.id} tit={k.tit} kantite={k.kantite} route={k.route} />)} {kantite.map(k => <KatKayLa key={k.id} tit={k.tit} kantite={k.kantite} route={k.route} />)}
</Grid> </Grid>
</Container> </Container>
<Container style={{marginBlock: '1.5em'}} align='center'>
<Grid container spacing={2}>
<Grid item xs={12} md={3}>
<Button
startIcon={<HelpIcon size='large' style={{fontSize: 40}} />}
size='small'
variant='contained'
color='primary'
onClick={handleClick}
>
<Typography style={{fontSize: '2em'}} variant='subtitle1' component='span'>
Guide
</Typography>
</Button>
</Grid>
<Grid item xs={12} md={3}>
<Link href='https://pale.o-k-i.net'>
<Button
startIcon={<ChatIcon size='large' style={{fontSize: 40}} />}
size='small'
variant='contained'
color='primary'
>
<Typography style={{fontSize: '2em'}} variant='subtitle1' component='span'>
Palé
</Typography>
</Button>
</Link>
</Grid>
<Grid item xs={12} md={3}>
<Link href='https://gade.o-k-i.net'>
<Button
startIcon={<OndemandVideoIcon size='large' style={{fontSize: 40}} />}
size='small'
variant='contained'
color='primary'
>
<Typography style={{fontSize: '2em'}} variant='subtitle1' component='span'>
Gadé
</Typography>
</Button>
</Link>
</Grid>
<Grid item xs={12} md={3}>
<Link href='https://www.helloasso.com/associations/organisation-ka-internationale/adhesions/adhesion-oki'>
<Button
startIcon={<GroupAddIcon size='large' style={{fontSize: 40}} />}
size='small'
variant='contained'
color='primary'
>
<Typography style={{fontSize: '2em'}} variant='subtitle1' component='span'>
Adhérer
</Typography>
</Button>
</Link>
</Grid>
</Grid>
</Container>
<Carousel <Carousel
isMobile={matches} isMobile={matches}
handleOpen={handleOpen} handleOpen={handleOpen}