|
| 1 | +import { getKcClsx } from "keycloakify/login/lib/kcClsx"; |
| 2 | +import type { PageProps } from "keycloakify/login/pages/PageProps"; |
| 3 | +import type { KcContext } from "../KcContext"; |
| 4 | +import type { I18n } from "../i18n"; |
| 5 | +import Alert from "@codegouvfr/react-dsfr/Alert"; |
| 6 | +import { fr } from "@codegouvfr/react-dsfr"; |
| 7 | + |
| 8 | +export default function LoginVerifyEmail(props: PageProps<Extract<KcContext, { pageId: "login-verify-email.ftl" }>, I18n>) { |
| 9 | + const { kcContext, i18n, doUseDefaultCss, Template, classes } = props; |
| 10 | + |
| 11 | + const { kcClsx } = getKcClsx({ |
| 12 | + doUseDefaultCss, |
| 13 | + classes |
| 14 | + }); |
| 15 | + |
| 16 | + const { url, user } = kcContext; |
| 17 | + |
| 18 | + const { msg, msgStr } = i18n; |
| 19 | + |
| 20 | + return ( |
| 21 | + <Template |
| 22 | + kcContext={kcContext} |
| 23 | + i18n={i18n} |
| 24 | + doUseDefaultCss={doUseDefaultCss} |
| 25 | + classes={classes} |
| 26 | + displayMessage={false} |
| 27 | + headerNode={msg("emailVerifyTitle")} |
| 28 | + > |
| 29 | + <Alert |
| 30 | + severity="info" |
| 31 | + description={msgStr("emailVerifyInstruction1", user?.email ?? "")} |
| 32 | + className={fr.cx("fr-mb-4w")} |
| 33 | + small |
| 34 | + /> |
| 35 | + |
| 36 | + <div className={kcClsx("kcFormGroupClass")}> |
| 37 | + <p className={fr.cx("fr-text--sm", "fr-mb-3w")}> |
| 38 | + {msgStr("emailVerifyInstruction2")}{" "} |
| 39 | + <form action={url.loginAction} method="post" style={{ display: "inline" }}> |
| 40 | + <input type="hidden" name="email" value={user?.email ?? ""} /> |
| 41 | + <button |
| 42 | + type="submit" |
| 43 | + className={fr.cx("fr-link")} |
| 44 | + style={{ |
| 45 | + background: "none", |
| 46 | + border: "none", |
| 47 | + padding: 0, |
| 48 | + cursor: "pointer" |
| 49 | + }} |
| 50 | + > |
| 51 | + {msgStr("doClickHere")} {msgStr("emailVerifyInstruction3")} |
| 52 | + </button> |
| 53 | + </form> |
| 54 | + </p> |
| 55 | + </div> |
| 56 | + |
| 57 | + <div className={kcClsx("kcFormGroupClass")} style={{ display: "flex", justifyContent: "flex-end" }}> |
| 58 | + <a className={fr.cx("fr-link")} href={url.loginUrl}> |
| 59 | + {msg("backToLogin")} |
| 60 | + </a> |
| 61 | + </div> |
| 62 | + </Template> |
| 63 | + ); |
| 64 | +} |
0 commit comments