Fix user session error

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-03-18 08:11:04 +04:00
parent f018c9419c
commit 1f6671e647
2 changed files with 27 additions and 10 deletions
+7 -10
View File
@@ -1,7 +1,7 @@
import {useCallback, useEffect, useState} from 'react'
import {useCallback, useEffect, forwardRef, useState} from 'react'
import {styled} from '@mui/material/styles'
import PropTypes from 'prop-types'
import axios from 'axios'
import {useSession} from 'next-auth/react'
import {
Box,
Button,
@@ -56,13 +56,14 @@ const textLabels = {
}
}
function Alert(props) {
return <MuiAlert elevation={6} variant='filled' {...props} />
}
const Alert = forwardRef(function Alert(props, ref) {
return <MuiAlert ref={ref} elevation={6} variant='filled' {...props} />
})
const RemoveTooltip = Tooltip
function EkriTeks({session}) {
function EkriTeks() {
const {data: session} = useSession()
const {jwt, user} = session
const [teksEkri, setTeksEkri] = useState({awtis: '', tit: '', transkripsyon: ''})
const [tradiksyon, setTradiksyon] = useState({fr: '', en: '', es: ''})
@@ -289,8 +290,4 @@ function EkriTeks({session}) {
)
}
EkriTeks.propTypes = {
session: PropTypes.object.isRequired
}
export default EkriTeks