Use NewPassword to soumet
This commit is contained in:
+25
-1
@@ -1,4 +1,5 @@
|
|||||||
import {useState, useEffect, forwardRef} from 'react'
|
import {useState, useEffect, forwardRef} from 'react'
|
||||||
|
import PropTypes from 'prop-types'
|
||||||
import {useSession} from 'next-auth/react'
|
import {useSession} from 'next-auth/react'
|
||||||
import MuiAlert from '@mui/material/Alert'
|
import MuiAlert from '@mui/material/Alert'
|
||||||
import Snackbar from '@mui/material/Snackbar'
|
import Snackbar from '@mui/material/Snackbar'
|
||||||
@@ -9,12 +10,13 @@ import Dekoneksyon from '../components/sesyon/dekoneksyon'
|
|||||||
import EkriTeks from '../components/soumet/ekri-teks'
|
import EkriTeks from '../components/soumet/ekri-teks'
|
||||||
|
|
||||||
import {jwennTeksEpiUserId, jwennUser} from '../lib/oki-api'
|
import {jwennTeksEpiUserId, jwennUser} from '../lib/oki-api'
|
||||||
|
import NewPassword from '../components/password/new-password'
|
||||||
|
|
||||||
const Alert = forwardRef(function Alert(props, ref) {
|
const Alert = forwardRef(function Alert(props, ref) {
|
||||||
return <MuiAlert ref={ref} elevation={6} variant='filled' {...props} />
|
return <MuiAlert ref={ref} elevation={6} variant='filled' {...props} />
|
||||||
})
|
})
|
||||||
|
|
||||||
export default function Soumet() {
|
export default function Soumet({code}) {
|
||||||
const {data: session} = useSession()
|
const {data: session} = useSession()
|
||||||
const [teksEpiUserId, setTeksEpiUserId] = useState([])
|
const [teksEpiUserId, setTeksEpiUserId] = useState([])
|
||||||
const [userId, setUserId] = useState(null)
|
const [userId, setUserId] = useState(null)
|
||||||
@@ -67,10 +69,15 @@ export default function Soumet() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<HeadLayout title='Soumèt - Soumettre un texte' tab={3} slug='soumet'>
|
<HeadLayout title='Soumèt - Soumettre un texte' tab={3} slug='soumet'>
|
||||||
|
{!session && !code && (
|
||||||
<Koneksyon
|
<Koneksyon
|
||||||
chimen='/soumet'
|
chimen='/soumet'
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{!session && code && (
|
||||||
|
<NewPassword code={code} />
|
||||||
|
)}
|
||||||
{session && session.user && (
|
{session && session.user && (
|
||||||
<>
|
<>
|
||||||
<Dekoneksyon position='absolute' top={95} left={5} chimen='/soumet' />
|
<Dekoneksyon position='absolute' top={95} left={5} chimen='/soumet' />
|
||||||
@@ -92,3 +99,20 @@ export default function Soumet() {
|
|||||||
</HeadLayout>
|
</HeadLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Soumet.defaultProps = {
|
||||||
|
code: null
|
||||||
|
}
|
||||||
|
|
||||||
|
Soumet.propTypes = {
|
||||||
|
code: PropTypes.string
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getServerSideProps({query}) {
|
||||||
|
const {code} = query
|
||||||
|
return {
|
||||||
|
props: {
|
||||||
|
code: code || null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user