Skip to content
Snippets Groups Projects
Commit e2def5ca authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Fix modal

parent b4111e73
Branches
Tags
1 merge request!286Fix modal
import React, { useEffect } from 'react'
import React from 'react'
import { useI18n } from 'cozy-ui/transpiled/react/I18n'
import Modal from 'components/CommonKit/Modal/Modal'
......@@ -15,25 +15,18 @@ import './modalGRDF.scss'
interface ModalGRDFProps {
isWaiting?: boolean
status: string
handleCloseClick: () => void
handleSubmit: () => void
handleCloseClick: () => void
}
const ModalGRDF: React.FC<ModalGRDFProps> = ({
handleCloseClick,
handleSubmit,
handleCloseClick,
isWaiting,
status,
}: ModalGRDFProps) => {
const { t } = useI18n()
const { screenType } = useSelector((state: AppStore) => state.ecolyo.global)
useEffect(() => {
if (status && status === 'idle') {
handleCloseClick()
}
}, [status, handleCloseClick])
return (
<Modal handleCloseClick={handleCloseClick}>
{screenType === ScreenType.MOBILE ? (
......
......@@ -37,6 +37,7 @@ const OAuthForm: React.FC<OAuthFormProps> = ({
}, [])
const endOAuth = () => {
setOpenGRDFModal(false)
setStatus(IDLE)
}
const startOAuth = () => {
......@@ -107,10 +108,9 @@ const OAuthForm: React.FC<OAuthFormProps> = ({
)}
{openGRDFModal && (
<ModalGRDF
handleCloseClick={toggleGRDFModal}
handleSubmit={handleSubmit}
handleCloseClick={toggleGRDFModal}
isWaiting={isWaiting}
status={status}
/>
)}
</>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment