Use codemod preset-safe
This commit is contained in:
@@ -8,8 +8,8 @@ import {
|
||||
Snackbar,
|
||||
LinearProgress,
|
||||
Typography
|
||||
} from '@material-ui/core'
|
||||
import MuiAlert from '@material-ui/lab/Alert'
|
||||
} from '@mui/material'
|
||||
import MuiAlert from '@mui/material/Alert'
|
||||
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import PropTypes from 'prop-types'
|
||||
import {format} from 'date-fns'
|
||||
import {fr} from 'date-fns/locale'
|
||||
import {styled} from '@material-ui/core/styles'
|
||||
import {styled} from '@mui/material/styles'
|
||||
|
||||
import {
|
||||
Typography,
|
||||
Divider,
|
||||
List,
|
||||
ListItemText
|
||||
} from '@material-ui/core'
|
||||
} from '@mui/material'
|
||||
|
||||
import {formatJsonString} from '../../lib/utils/format'
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
Typography,
|
||||
Tooltip,
|
||||
Zoom
|
||||
} from '@material-ui/core'
|
||||
import AddCommentIcon from '@material-ui/icons/AddComment'
|
||||
} from '@mui/material'
|
||||
import AddCommentIcon from '@mui/icons-material/AddComment'
|
||||
import {useRouter} from 'next/router'
|
||||
import Koneksyon from '../sesyon/koneksyon'
|
||||
import KomanteList from './komante-list'
|
||||
@@ -70,75 +70,80 @@ export default function VweKomante({komante, teks}) {
|
||||
}, [esOuve])
|
||||
|
||||
return (
|
||||
(
|
||||
<Root>
|
||||
<KomanteTooltip
|
||||
title='Komantè'
|
||||
placement='bottom'
|
||||
TransitionComponent={Zoom}
|
||||
classes={{
|
||||
tooltip: classes.tooltip
|
||||
}}
|
||||
<Root>
|
||||
<KomanteTooltip
|
||||
title='Komantè'
|
||||
placement='bottom'
|
||||
TransitionComponent={Zoom}
|
||||
classes={{
|
||||
tooltip: classes.tooltip
|
||||
}}
|
||||
>
|
||||
<IconButton
|
||||
className={classes.margin}
|
||||
color='primary'
|
||||
aria-label='commentaire'
|
||||
component='span'
|
||||
size='large'
|
||||
onClick={handleClick}
|
||||
>
|
||||
<IconButton className={classes.margin} color='primary' aria-label='commentaire' component='span' onClick={handleClick}>
|
||||
<AddCommentIcon />
|
||||
</IconButton>
|
||||
</KomanteTooltip>
|
||||
<Dialog
|
||||
open={esOuve}
|
||||
scroll='paper'
|
||||
aria-labelledby='scroll-dialog-title'
|
||||
aria-describedby='scroll-dialog-description'
|
||||
onClose={handleClose}
|
||||
>
|
||||
<DialogTitle align='center' id='scroll-dialog-title'>Kòmantè</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<Typography
|
||||
ref={descriptionElementRef}
|
||||
variant='inherit'
|
||||
id='scroll-dialog-description'
|
||||
tabIndex={-1}
|
||||
>
|
||||
{komante.length > 0 ? (
|
||||
<KomanteList komante={komante} />
|
||||
) : (
|
||||
<Typography align='center'>
|
||||
Aucun
|
||||
</Typography>
|
||||
)}
|
||||
</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions align='center' >
|
||||
{session && session.user && !esKomenteOuve && (
|
||||
<Button fullWidth color='primary' onClick={() => meteEsKomanteOuve(true)}>
|
||||
Ajouter un commentaire
|
||||
</Button>
|
||||
<AddCommentIcon />
|
||||
</IconButton>
|
||||
</KomanteTooltip>
|
||||
<Dialog
|
||||
open={esOuve}
|
||||
scroll='paper'
|
||||
aria-labelledby='scroll-dialog-title'
|
||||
aria-describedby='scroll-dialog-description'
|
||||
onClose={handleClose}
|
||||
>
|
||||
<DialogTitle align='center' id='scroll-dialog-title'>Kòmantè</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<Typography
|
||||
ref={descriptionElementRef}
|
||||
variant='inherit'
|
||||
id='scroll-dialog-description'
|
||||
tabIndex={-1}
|
||||
>
|
||||
{komante.length > 0 ? (
|
||||
<KomanteList komante={komante} />
|
||||
) : (
|
||||
<Typography align='center'>
|
||||
Aucun
|
||||
</Typography>
|
||||
)}
|
||||
{!session && !esKoneksyonOuve && (
|
||||
<Button fullWidth color='primary' onClick={() => meteEsKoneksyonOuve(true)}>
|
||||
Se connecter pour commenter
|
||||
</Button>
|
||||
)}
|
||||
{!session && esKoneksyonOuve && (
|
||||
<Koneksyon chimen={router.asPath} />
|
||||
)}
|
||||
</DialogActions>
|
||||
{!session && esKoneksyonOuve && (
|
||||
<Button style={{marginBottom: 10}} color='primary' onClick={() => meteEsKoneksyonOuve(false)}>
|
||||
Annuler
|
||||
</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions align='center' >
|
||||
{session && session.user && !esKomenteOuve && (
|
||||
<Button fullWidth color='primary' onClick={() => meteEsKomanteOuve(true)}>
|
||||
Ajouter un commentaire
|
||||
</Button>
|
||||
)}
|
||||
{session && session.user && esKomenteOuve && (
|
||||
<>
|
||||
<EkriKomante session={session} teks={teks} meteEsKomanteOuve={meteEsKomanteOuve} />
|
||||
<Button fullWidth style={{marginBottom: 10}} color='primary' onClick={() => meteEsKomanteOuve(false)}>
|
||||
Fermer
|
||||
</Button>
|
||||
</>
|
||||
{!session && !esKoneksyonOuve && (
|
||||
<Button fullWidth color='primary' onClick={() => meteEsKoneksyonOuve(true)}>
|
||||
Se connecter pour commenter
|
||||
</Button>
|
||||
)}
|
||||
</Dialog>
|
||||
</Root>
|
||||
)
|
||||
{!session && esKoneksyonOuve && (
|
||||
<Koneksyon chimen={router.asPath} />
|
||||
)}
|
||||
</DialogActions>
|
||||
{!session && esKoneksyonOuve && (
|
||||
<Button style={{marginBottom: 10}} color='primary' onClick={() => meteEsKoneksyonOuve(false)}>
|
||||
Annuler
|
||||
</Button>
|
||||
)}
|
||||
{session && session.user && esKomenteOuve && (
|
||||
<>
|
||||
<EkriKomante session={session} teks={teks} meteEsKomanteOuve={meteEsKomanteOuve} />
|
||||
<Button fullWidth style={{marginBottom: 10}} color='primary' onClick={() => meteEsKomanteOuve(false)}>
|
||||
Fermer
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</Dialog>
|
||||
</Root>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user