keycloak_theme/src/pages/IdpReviewUserProfile.tsx

48 lines
2.1 KiB
TypeScript
Raw Normal View History

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";
import type { I18nBase } from "../i18n";
2022-09-09 12:55:57 +02:00
export default function IdpReviewUserProfile(props: PageProps<Extract<KcContextBase, { pageId: "idp-review-user-profile.ftl" }>, I18nBase>) {
const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props;
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">
<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)} />
</div>
2022-10-16 00:49:49 +02:00
<div id="kc-form-buttons" className={clsx(kcProps.kcFormButtonsClass)}>
<input
2022-10-16 00:49:49 +02:00
className={clsx(
kcProps.kcButtonClass,
kcProps.kcButtonPrimaryClass,
kcProps.kcButtonBlockClass,
kcProps.kcButtonLargeClass
)}
type="submit"
value={msgStr("doSubmit")}
disabled={!isFomSubmittable}
/>
2022-09-09 12:55:57 +02:00
</div>
</div>
</form>
}
/>
);
}