From 53c007965654fa9f7af8b2244ea7cc3a85dbcb3e Mon Sep 17 00:00:00 2001 From: garronej Date: Mon, 27 Feb 2023 11:55:25 +0100 Subject: [PATCH] Use extract instead of subtype to ease copy paste into theme repo --- src/lib/pages/Error.tsx | 4 ++-- src/lib/pages/IdpReviewUserProfile.tsx | 4 ++-- src/lib/pages/Info.tsx | 4 ++-- src/lib/pages/Login.tsx | 4 ++-- src/lib/pages/LoginConfigTotp.tsx | 4 ++-- src/lib/pages/LoginIdpLinkConfirm.tsx | 4 ++-- src/lib/pages/LoginIdpLinkEmail.tsx | 2 +- src/lib/pages/LoginOtp.tsx | 4 ++-- src/lib/pages/LoginPageExpired.tsx | 4 ++-- src/lib/pages/LoginPassword.tsx | 4 ++-- src/lib/pages/LoginResetPassword.tsx | 4 ++-- src/lib/pages/LoginUpdatePassword.tsx | 4 ++-- src/lib/pages/LoginUpdateProfile.tsx | 4 ++-- src/lib/pages/LoginUsername.tsx | 4 ++-- src/lib/pages/LoginVerifyEmail.tsx | 4 ++-- src/lib/pages/LogoutConfirm.tsx | 4 ++-- src/lib/pages/Register.tsx | 4 ++-- src/lib/pages/RegisterUserProfile.tsx | 4 ++-- src/lib/pages/Terms.tsx | 4 ++-- src/lib/pages/UpdateUserProfile.tsx | 4 ++-- src/lib/pages/WebauthnAuthenticate.tsx | 4 ++-- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/lib/pages/Error.tsx b/src/lib/pages/Error.tsx index b13cd4a4..eb2bf86f 100644 --- a/src/lib/pages/Error.tsx +++ b/src/lib/pages/Error.tsx @@ -1,9 +1,9 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function Error(props: PageProps) { +export default function Error(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { message, client } = kcContext; diff --git a/src/lib/pages/IdpReviewUserProfile.tsx b/src/lib/pages/IdpReviewUserProfile.tsx index e7d455c2..c485c1ec 100644 --- a/src/lib/pages/IdpReviewUserProfile.tsx +++ b/src/lib/pages/IdpReviewUserProfile.tsx @@ -1,11 +1,11 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function IdpReviewUserProfile(props: PageProps) { +export default function IdpReviewUserProfile(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg, msgStr } = i18n; diff --git a/src/lib/pages/Info.tsx b/src/lib/pages/Info.tsx index a863e54c..5df78d9d 100644 --- a/src/lib/pages/Info.tsx +++ b/src/lib/pages/Info.tsx @@ -1,10 +1,10 @@ import React from "react"; import { assert } from "../tools/assert"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function Info(props: PageProps) { +export default function Info(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msgStr, msg } = i18n; diff --git a/src/lib/pages/Login.tsx b/src/lib/pages/Login.tsx index 3ce22a06..587729b0 100644 --- a/src/lib/pages/Login.tsx +++ b/src/lib/pages/Login.tsx @@ -1,11 +1,11 @@ import React, { useState, type FormEventHandler } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function Login(props: PageProps) { +export default function Login(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { social, realm, url, usernameEditDisabled, login, auth, registrationDisabled } = kcContext; diff --git a/src/lib/pages/LoginConfigTotp.tsx b/src/lib/pages/LoginConfigTotp.tsx index 297c115f..5a48eef9 100644 --- a/src/lib/pages/LoginConfigTotp.tsx +++ b/src/lib/pages/LoginConfigTotp.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginConfigTotp(props: PageProps) { +export default function LoginConfigTotp(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, isAppInitiatedAction, totp, mode, messagesPerField } = kcContext; diff --git a/src/lib/pages/LoginIdpLinkConfirm.tsx b/src/lib/pages/LoginIdpLinkConfirm.tsx index 999092f9..01324460 100644 --- a/src/lib/pages/LoginIdpLinkConfirm.tsx +++ b/src/lib/pages/LoginIdpLinkConfirm.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginIdpLinkConfirm(props: PageProps) { +export default function LoginIdpLinkConfirm(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, idpAlias } = kcContext; diff --git a/src/lib/pages/LoginIdpLinkEmail.tsx b/src/lib/pages/LoginIdpLinkEmail.tsx index 9bf0fc7a..345b6ac7 100644 --- a/src/lib/pages/LoginIdpLinkEmail.tsx +++ b/src/lib/pages/LoginIdpLinkEmail.tsx @@ -3,7 +3,7 @@ import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; import type { I18nBase } from "../i18n"; -export default function LoginIdpLinkEmail(props: PageProps) { +export default function LoginIdpLinkEmail(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, realm, brokerContext, idpAlias } = kcContext; diff --git a/src/lib/pages/LoginOtp.tsx b/src/lib/pages/LoginOtp.tsx index 50c041f5..99ab4ebb 100644 --- a/src/lib/pages/LoginOtp.tsx +++ b/src/lib/pages/LoginOtp.tsx @@ -2,11 +2,11 @@ import React, { useEffect } from "react"; import { headInsert } from "../tools/headInsert"; import { pathJoin } from "../../bin/tools/pathJoin"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginOtp(props: PageProps) { +export default function LoginOtp(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { otpLogin, url } = kcContext; diff --git a/src/lib/pages/LoginPageExpired.tsx b/src/lib/pages/LoginPageExpired.tsx index 479e4566..84b11a67 100644 --- a/src/lib/pages/LoginPageExpired.tsx +++ b/src/lib/pages/LoginPageExpired.tsx @@ -1,9 +1,9 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginPageExpired(props: PageProps) { +export default function LoginPageExpired(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url } = kcContext; diff --git a/src/lib/pages/LoginPassword.tsx b/src/lib/pages/LoginPassword.tsx index 90a27e7d..e94fb73f 100644 --- a/src/lib/pages/LoginPassword.tsx +++ b/src/lib/pages/LoginPassword.tsx @@ -2,11 +2,11 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginPassword(props: PageProps) { +export default function LoginPassword(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { realm, url, login } = kcContext; diff --git a/src/lib/pages/LoginResetPassword.tsx b/src/lib/pages/LoginResetPassword.tsx index 5b0e23f4..8725ac11 100644 --- a/src/lib/pages/LoginResetPassword.tsx +++ b/src/lib/pages/LoginResetPassword.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginResetPassword(props: PageProps) { +export default function LoginResetPassword(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, realm, auth } = kcContext; diff --git a/src/lib/pages/LoginUpdatePassword.tsx b/src/lib/pages/LoginUpdatePassword.tsx index e183a854..7081d6c5 100644 --- a/src/lib/pages/LoginUpdatePassword.tsx +++ b/src/lib/pages/LoginUpdatePassword.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginUpdatePassword(props: PageProps) { +export default function LoginUpdatePassword(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg, msgStr } = i18n; diff --git a/src/lib/pages/LoginUpdateProfile.tsx b/src/lib/pages/LoginUpdateProfile.tsx index 3c985006..b1aa5119 100644 --- a/src/lib/pages/LoginUpdateProfile.tsx +++ b/src/lib/pages/LoginUpdateProfile.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginUpdateProfile(props: PageProps) { +export default function LoginUpdateProfile(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg, msgStr } = i18n; diff --git a/src/lib/pages/LoginUsername.tsx b/src/lib/pages/LoginUsername.tsx index 614a918b..11a3e35b 100644 --- a/src/lib/pages/LoginUsername.tsx +++ b/src/lib/pages/LoginUsername.tsx @@ -2,11 +2,11 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { useConstCallback } from "../tools/useConstCallback"; import type { FormEventHandler } from "react"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginUsername(props: PageProps) { +export default function LoginUsername(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { social, realm, url, usernameHidden, login, registrationDisabled } = kcContext; diff --git a/src/lib/pages/LoginVerifyEmail.tsx b/src/lib/pages/LoginVerifyEmail.tsx index 97c7e065..164612e9 100644 --- a/src/lib/pages/LoginVerifyEmail.tsx +++ b/src/lib/pages/LoginVerifyEmail.tsx @@ -1,9 +1,9 @@ import React from "react"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LoginVerifyEmail(props: PageProps) { +export default function LoginVerifyEmail(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg } = i18n; diff --git a/src/lib/pages/LogoutConfirm.tsx b/src/lib/pages/LogoutConfirm.tsx index a3e33e0d..024286da 100644 --- a/src/lib/pages/LogoutConfirm.tsx +++ b/src/lib/pages/LogoutConfirm.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function LogoutConfirm(props: PageProps) { +export default function LogoutConfirm(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, client, logoutConfirm } = kcContext; diff --git a/src/lib/pages/Register.tsx b/src/lib/pages/Register.tsx index 5ffcb581..a5d7774f 100644 --- a/src/lib/pages/Register.tsx +++ b/src/lib/pages/Register.tsx @@ -1,10 +1,10 @@ import React from "react"; import { clsx } from "../tools/clsx"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function Register(props: PageProps) { +export default function Register(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, messagesPerField, register, realm, passwordRequired, recaptchaRequired, recaptchaSiteKey } = kcContext; diff --git a/src/lib/pages/RegisterUserProfile.tsx b/src/lib/pages/RegisterUserProfile.tsx index 6b72d474..1f0f7362 100644 --- a/src/lib/pages/RegisterUserProfile.tsx +++ b/src/lib/pages/RegisterUserProfile.tsx @@ -1,11 +1,11 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function RegisterUserProfile(props: PageProps) { +export default function RegisterUserProfile(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url, messagesPerField, recaptchaRequired, recaptchaSiteKey } = kcContext; diff --git a/src/lib/pages/Terms.tsx b/src/lib/pages/Terms.tsx index 9a749915..f4c8d59b 100644 --- a/src/lib/pages/Terms.tsx +++ b/src/lib/pages/Terms.tsx @@ -9,11 +9,11 @@ import { useConst } from "../tools/useConst"; import { useConstCallback } from "../tools/useConstCallback"; import { Markdown } from "../tools/Markdown"; import type { Extends } from "tsafe"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function Terms(props: PageProps) { +export default function Terms(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg, msgStr } = i18n; diff --git a/src/lib/pages/UpdateUserProfile.tsx b/src/lib/pages/UpdateUserProfile.tsx index d87496d3..364c5958 100644 --- a/src/lib/pages/UpdateUserProfile.tsx +++ b/src/lib/pages/UpdateUserProfile.tsx @@ -1,11 +1,11 @@ import React, { useState } from "react"; import { clsx } from "../tools/clsx"; import { UserProfileFormFields } from "./shared/UserProfileCommons"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function UpdateUserProfile(props: PageProps) { +export default function UpdateUserProfile(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { msg, msgStr } = i18n; diff --git a/src/lib/pages/WebauthnAuthenticate.tsx b/src/lib/pages/WebauthnAuthenticate.tsx index 544f0d1a..c2e9a51f 100644 --- a/src/lib/pages/WebauthnAuthenticate.tsx +++ b/src/lib/pages/WebauthnAuthenticate.tsx @@ -3,11 +3,11 @@ import { clsx } from "../tools/clsx"; import type { MessageKeyBase } from "../i18n"; import { base64url } from "rfc4648"; import { useConstCallback } from "../tools/useConstCallback"; -import type { KcContextBase } from "../getKcContext"; import type { PageProps } from "../KcProps"; +import type { KcContextBase } from "../getKcContext"; import type { I18nBase } from "../i18n"; -export default function WebauthnAuthenticate(props: PageProps) { +export default function WebauthnAuthenticate(props: PageProps, I18nBase>) { const { kcContext, i18n, doFetchDefaultThemeResources = true, Template, ...kcProps } = props; const { url } = kcContext;