-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from DISIC/feat/domains-white-list
feat: domains white list
- Loading branch information
Showing
10 changed files
with
6,721 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { fr } from '@codegouvfr/react-dsfr'; | ||
import Link from 'next/link'; | ||
|
||
export type RegisterValidationMessage = 'classic' | 'from_otp' | undefined; | ||
|
||
type Props = { | ||
mode: RegisterValidationMessage; | ||
}; | ||
|
||
export const RegisterValidationMessage = (props: Props) => { | ||
const { mode } = props; | ||
|
||
if (!mode) return; | ||
|
||
return ( | ||
<div> | ||
<h5>Se créer un compte</h5> | ||
{mode === 'classic' ? ( | ||
<p> | ||
Votre compte a été créé avec succès. <br /> | ||
<br /> | ||
Vous allez recevoir un email contenant un lien de validation dans les | ||
prochaines minutes. | ||
</p> | ||
) : ( | ||
<p> | ||
Votre ancien compte de l'observatoire a été configuré avec | ||
succès. <br /> | ||
<br /> | ||
<Link className={fr.cx('fr-link')} href="/login"> | ||
Connectez-vous dès maintenant | ||
</Link>{' '} | ||
pour gérer vos boutons Je donne mon avis dans ce nouvel espace. | ||
</p> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { useState } from 'react'; | ||
import { UserInfos } from './RegisterForm'; | ||
import { tss } from 'tss-react/dsfr'; | ||
import { Input } from '@codegouvfr/react-dsfr/Input'; | ||
import { Button } from '@codegouvfr/react-dsfr/Button'; | ||
|
||
type Props = { | ||
userInfos: UserInfos; | ||
}; | ||
|
||
export const RegisterNotWhiteListed = (props: Props) => { | ||
const { userInfos } = props; | ||
|
||
const { classes, cx } = useStyles(); | ||
|
||
const [reason, setReason] = useState<string | undefined>(); | ||
|
||
const validateRequest = () => { | ||
// create user & user request | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h5>Demande de création de compte</h5> | ||
<form | ||
onSubmit={e => { | ||
e.preventDefault(); | ||
}} | ||
> | ||
<Input | ||
label="Votre situation" | ||
textArea | ||
nativeTextAreaProps={{ | ||
onChange: e => { | ||
setReason(e.target.value); | ||
}, | ||
value: reason, | ||
name: 'reason' | ||
}} | ||
state={reason === '' ? 'error' : 'default'} | ||
stateRelatedMessage={ | ||
"L'explication de votre situation est obligatoire." | ||
} | ||
/> | ||
<Button className={cx(classes.button)} type="submit"> | ||
Valider | ||
</Button> | ||
</form> | ||
</div> | ||
); | ||
}; | ||
|
||
const useStyles = tss | ||
.withName(RegisterNotWhiteListed.name) | ||
.withParams() | ||
.create(() => ({ | ||
button: { | ||
display: 'block', | ||
marginLeft: 'auto' | ||
} | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.