2023-07-22 13:40:08 +04:00
|
|
|
'use client'
|
|
|
|
|
|
2021-09-21 21:28:04 +02:00
|
|
|
import {useState} from 'react'
|
2023-07-22 13:40:08 +04:00
|
|
|
import {usePathname} from 'next/navigation'
|
2022-01-19 06:35:04 +04:00
|
|
|
import {styled} from '@mui/material/styles'
|
2023-07-22 13:40:08 +04:00
|
|
|
import Box from '@mui/material/Box'
|
|
|
|
|
import Container from '@mui/material/Container'
|
|
|
|
|
import Typography from '@mui/material/Typography'
|
|
|
|
|
import Button from '@mui/material/Button'
|
|
|
|
|
import {useMediaQuery} from '@mui/material'
|
2022-01-23 21:47:22 +04:00
|
|
|
|
|
|
|
|
import {rezoLis} from '../lib/rezo-lis'
|
|
|
|
|
|
2021-06-14 23:30:00 +02:00
|
|
|
import CGUDialog from './cgu/cgu-dialog'
|
2022-01-23 21:47:22 +04:00
|
|
|
import Rezo from './rezo'
|
2021-06-14 23:30:00 +02:00
|
|
|
|
2022-01-19 06:35:04 +04:00
|
|
|
const PREFIX = 'footer'
|
|
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
|
footer: `${PREFIX}-footer`,
|
|
|
|
|
text: `${PREFIX}-text`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Root = styled('div')((
|
|
|
|
|
{
|
|
|
|
|
theme
|
|
|
|
|
}
|
|
|
|
|
) => ({
|
|
|
|
|
[`& .${classes.footer}`]: {
|
2022-01-26 22:58:09 +04:00
|
|
|
padding: theme.spacing(1, 2),
|
2021-06-14 23:30:00 +02:00
|
|
|
marginTop: 'auto',
|
2023-07-24 23:12:52 +04:00
|
|
|
backgroundColor: theme.palette.grey[100],
|
2024-10-21 15:18:37 +04:00
|
|
|
...theme.applyStyles('dark', {
|
2023-07-24 23:12:52 +04:00
|
|
|
backgroundColor: '#1E3526'
|
2024-10-21 15:18:37 +04:00
|
|
|
})
|
2021-06-14 23:30:00 +02:00
|
|
|
},
|
2022-01-19 06:35:04 +04:00
|
|
|
|
|
|
|
|
[`& .${classes.text}`]: {
|
2021-06-14 23:30:00 +02:00
|
|
|
fontWeight: 'bold'
|
|
|
|
|
}
|
|
|
|
|
}))
|
|
|
|
|
|
|
|
|
|
export default function Footer() {
|
2023-07-22 13:40:08 +04:00
|
|
|
const pathname = usePathname()
|
2021-06-14 23:30:00 +02:00
|
|
|
const [open, setOpen] = useState(false)
|
2022-01-23 21:47:22 +04:00
|
|
|
const isMobile = useMediaQuery('(max-width:527px)')
|
2023-07-22 13:40:08 +04:00
|
|
|
const selectedPath = pathname === '/' ? 'akey' : pathname.split('/')[1]
|
2021-06-14 23:30:00 +02:00
|
|
|
|
|
|
|
|
return (
|
2022-01-19 06:35:04 +04:00
|
|
|
(
|
|
|
|
|
<Root>
|
|
|
|
|
<CGUDialog open={open} setOpen={setOpen} />
|
2023-07-22 13:40:08 +04:00
|
|
|
<footer>
|
|
|
|
|
<Box sx={{ml: selectedPath === 'paroles' && !isMobile ? '240px' : ''}} id='cgu' className={classes.footer}>
|
|
|
|
|
<Container sx={{display: 'flex', justifyContent: isMobile ? 'center' : 'space-between', alignItems: 'center', flexDirection: isMobile ? 'column-reverse' : ''}}>
|
|
|
|
|
<Box sx={{textAlign: isMobile ? 'center' : '', marginTop: isMobile ? '1em' : ''}}>
|
|
|
|
|
<Button color='primary' onClick={() => setOpen(true)}>
|
|
|
|
|
<Typography variant='button' sx={{fontWeight: 'bold'}}>Voir les CGU et la politique de confidentialité</Typography>
|
|
|
|
|
</Button>
|
|
|
|
|
</Box>
|
|
|
|
|
<Box sx={{display: 'flex', justifyContent: 'center'}}>
|
|
|
|
|
{rezoLis.map(rezo => <Rezo key={rezo.tit} rezo={rezo} />)}
|
|
|
|
|
</Box>
|
|
|
|
|
</Container>
|
|
|
|
|
</Box>
|
2022-01-19 06:35:04 +04:00
|
|
|
</footer>
|
|
|
|
|
</Root>
|
|
|
|
|
)
|
2021-06-14 23:30:00 +02:00
|
|
|
)
|
|
|
|
|
}
|