Edit TeksDrawer component and adapt pages/paroles
This commit is contained in:
@@ -9,7 +9,8 @@ import {
|
||||
CssBaseline,
|
||||
Drawer,
|
||||
Hidden,
|
||||
IconButton
|
||||
IconButton,
|
||||
Box
|
||||
} from '@mui/material'
|
||||
|
||||
import KeyboardBackspaceIcon from '@mui/icons-material/KeyboardBackspace'
|
||||
@@ -116,7 +117,7 @@ const Root = styled('div')((
|
||||
|
||||
const drawerWidth = 240
|
||||
|
||||
export default function TeksDrawer({teks, anTeks, komante}) {
|
||||
export default function TeksDrawer({teks, anTeks, komante, denyeTeks}) {
|
||||
const theme = useTheme()
|
||||
const [esMobilOuve, meteEsMobilOuve] = useState(false)
|
||||
const [open, setOpen] = useState(false)
|
||||
@@ -228,7 +229,9 @@ export default function TeksDrawer({teks, anTeks, komante}) {
|
||||
handleClose={handleClose}
|
||||
/>
|
||||
) : (
|
||||
<DenyeTeks {...teks} />
|
||||
<Box sx={{marginTop: '5em'}}>
|
||||
<DenyeTeks {...denyeTeks} />
|
||||
</Box>
|
||||
)}
|
||||
</main>
|
||||
</Root>
|
||||
@@ -238,10 +241,12 @@ export default function TeksDrawer({teks, anTeks, komante}) {
|
||||
TeksDrawer.propTypes = {
|
||||
teks: PropTypes.array.isRequired,
|
||||
anTeks: PropTypes.object,
|
||||
komante: PropTypes.array
|
||||
komante: PropTypes.array,
|
||||
denyeTeks: PropTypes.array
|
||||
}
|
||||
|
||||
TeksDrawer.defaultProps = {
|
||||
anTeks: null,
|
||||
komante: null
|
||||
komante: null,
|
||||
denyeTeks: null
|
||||
}
|
||||
|
||||
@@ -1,28 +1,31 @@
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import {jwennTeks} from '../../lib/oki-api'
|
||||
import {jwennDenyeTeks, jwennTeks} from '../../lib/oki-api'
|
||||
|
||||
import TeksDrawer from '../../components/teks/teks-drawer'
|
||||
import HeadLayout from '../../components/head-layout'
|
||||
|
||||
export default function Teks({teks}) {
|
||||
export default function Teks({teks, denyeTeks}) {
|
||||
return (
|
||||
<HeadLayout title='Paroles et Traductions' tab={1} slug='paroles'>
|
||||
<TeksDrawer teks={teks} />
|
||||
<TeksDrawer teks={teks} denyeTeks={denyeTeks} />
|
||||
</HeadLayout>
|
||||
)
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
const teks = await jwennTeks()
|
||||
const denyeTeks = await jwennDenyeTeks()
|
||||
|
||||
return {
|
||||
props: {
|
||||
teks
|
||||
teks,
|
||||
denyeTeks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Teks.propTypes = {
|
||||
teks: PropTypes.array.isRequired
|
||||
teks: PropTypes.array.isRequired,
|
||||
denyeTeks: PropTypes.array.isRequired
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user