2023-02-25 18:11:23 +01:00
|
|
|
import React, { useState } from "react";
|
2022-10-16 00:49:49 +02:00
|
|
|
import { clsx } from "../tools/clsx";
|
2022-09-09 12:55:57 +02:00
|
|
|
import { UserProfileFormFields } from "./shared/UserProfileCommons";
|
2023-02-25 18:26:39 +01:00
|
|
|
import type { PageProps } from "../KcProps";
|
2023-03-16 23:02:06 +01:00
|
|
|
import type { KcContextBase } from "../kcContext";
|
2023-02-25 18:11:23 +01:00
|
|
|
import type { I18nBase } from "../i18n";
|
2022-09-09 12:55:57 +02:00
|
|
|
|
2023-02-27 11:55:25 +01:00
|
|
|
export default function IdpReviewUserProfile(props: PageProps<Extract<KcContextBase, { pageId: "idp-review-user-profile.ftl" }>, I18nBase>) {
|
2023-02-25 18:11:23 +01:00
|
|
|
const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
|
2022-10-13 11:58:31 +02:00
|
|
|
|
|
|
|
const { msg, msgStr } = i18n;
|
|
|
|
|
|
|
|
const { url } = kcContext;
|
|
|
|
|
|
|
|
const [isFomSubmittable, setIsFomSubmittable] = useState(false);
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Template
|
|
|
|
{...{ kcContext, i18n, doFetchDefaultThemeResources, ...kcProps }}
|
|
|
|
headerNode={msg("loginIdpReviewProfileTitle")}
|
|
|
|
formNode={
|
2022-10-16 00:49:49 +02:00
|
|
|
<form id="kc-idp-review-profile-form" className={clsx(kcProps.kcFormClass)} action={url.loginAction} method="post">
|
2022-10-13 11:58:31 +02:00
|
|
|
<UserProfileFormFields kcContext={kcContext} onIsFormSubmittableValueChange={setIsFomSubmittable} i18n={i18n} {...kcProps} />
|
|
|
|
|
2022-10-16 00:49:49 +02:00
|
|
|
<div className={clsx(kcProps.kcFormGroupClass)}>
|
|
|
|
<div id="kc-form-options" className={clsx(kcProps.kcFormOptionsClass)}>
|
|
|
|
<div className={clsx(kcProps.kcFormOptionsWrapperClass)} />
|
2022-10-13 11:58:31 +02:00
|
|
|
</div>
|
2022-10-16 00:49:49 +02:00
|
|
|
<div id="kc-form-buttons" className={clsx(kcProps.kcFormButtonsClass)}>
|
2022-10-13 11:58:31 +02:00
|
|
|
<input
|
2022-10-16 00:49:49 +02:00
|
|
|
className={clsx(
|
2022-10-13 11:58:31 +02:00
|
|
|
kcProps.kcButtonClass,
|
|
|
|
kcProps.kcButtonPrimaryClass,
|
|
|
|
kcProps.kcButtonBlockClass,
|
|
|
|
kcProps.kcButtonLargeClass
|
|
|
|
)}
|
|
|
|
type="submit"
|
|
|
|
value={msgStr("doSubmit")}
|
|
|
|
disabled={!isFomSubmittable}
|
|
|
|
/>
|
2022-09-09 12:55:57 +02:00
|
|
|
</div>
|
2022-10-13 11:58:31 +02:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
2023-02-25 18:11:23 +01:00
|
|
|
}
|