2023-03-18 06:14:05 +01:00
|
|
|
import { useState } from "react";
|
|
|
|
import { clsx } from "keycloakify/tools/clsx";
|
2023-03-24 04:12:52 +01:00
|
|
|
import { UserProfileFormFields } from "keycloakify/login/pages/shared/UserProfileFormFields";
|
2023-03-21 05:27:31 +01:00
|
|
|
import type { PageProps } from "keycloakify/login/pages/PageProps";
|
|
|
|
import { useGetClassName } from "keycloakify/login/lib/useGetClassName";
|
2023-03-18 18:27:50 +01:00
|
|
|
import type { KcContext } from "../kcContext";
|
2023-03-18 18:54:33 +01:00
|
|
|
import type { I18n } from "../i18n";
|
2022-09-09 12:55:57 +02:00
|
|
|
|
2023-03-18 06:14:05 +01:00
|
|
|
export default function IdpReviewUserProfile(props: PageProps<Extract<KcContext, { pageId: "idp-review-user-profile.ftl" }>, I18n>) {
|
|
|
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
|
|
|
|
|
|
|
const { getClassName } = useGetClassName({
|
2023-03-21 05:27:31 +01:00
|
|
|
doUseDefaultCss,
|
2023-03-18 06:14:05 +01:00
|
|
|
classes
|
|
|
|
});
|
2022-10-13 11:58:31 +02:00
|
|
|
|
|
|
|
const { msg, msgStr } = i18n;
|
|
|
|
|
|
|
|
const { url } = kcContext;
|
|
|
|
|
|
|
|
const [isFomSubmittable, setIsFomSubmittable] = useState(false);
|
|
|
|
|
|
|
|
return (
|
2023-03-21 02:36:13 +01:00
|
|
|
<Template {...{ kcContext, i18n, doUseDefaultCss, classes }} headerNode={msg("loginIdpReviewProfileTitle")}>
|
|
|
|
<form id="kc-idp-review-profile-form" className={getClassName("kcFormClass")} action={url.loginAction} method="post">
|
|
|
|
<UserProfileFormFields
|
|
|
|
kcContext={kcContext}
|
|
|
|
onIsFormSubmittableValueChange={setIsFomSubmittable}
|
|
|
|
i18n={i18n}
|
|
|
|
getClassName={getClassName}
|
|
|
|
/>
|
|
|
|
<div className={getClassName("kcFormGroupClass")}>
|
|
|
|
<div id="kc-form-options" className={getClassName("kcFormOptionsClass")}>
|
|
|
|
<div className={getClassName("kcFormOptionsWrapperClass")} />
|
2022-10-13 11:58:31 +02:00
|
|
|
</div>
|
2023-03-21 02:36:13 +01:00
|
|
|
<div id="kc-form-buttons" className={getClassName("kcFormButtonsClass")}>
|
|
|
|
<input
|
|
|
|
className={clsx(
|
|
|
|
getClassName("kcButtonClass"),
|
|
|
|
getClassName("kcButtonPrimaryClass"),
|
|
|
|
getClassName("kcButtonBlockClass"),
|
|
|
|
getClassName("kcButtonLargeClass")
|
|
|
|
)}
|
|
|
|
type="submit"
|
|
|
|
value={msgStr("doSubmit")}
|
|
|
|
disabled={!isFomSubmittable}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</Template>
|
2022-10-13 11:58:31 +02:00
|
|
|
);
|
2023-02-25 18:11:23 +01:00
|
|
|
}
|