From 256918df264300c575f3773ef6ffd59858b85825 Mon Sep 17 00:00:00 2001 From: garronej Date: Tue, 15 Aug 2023 20:24:23 +0200 Subject: [PATCH] Update keycloakify --- package.json | 2 +- .../login/pages/Login.stories.tsx | 8 ++- src/keycloak-theme/login/pages/Login.tsx | 68 +++++++++---------- yarn.lock | 8 +-- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 1b423ac..be2a35b 100755 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "evt": "^2.4.15", "jwt-decode": "^3.1.2", "keycloak-js": "^21.0.1", - "keycloakify": "^7.15.3", + "keycloakify": "^7.15.9", "powerhooks": "^0.26.8", "react": "18.1.0", "react-dom": "18.1.0", diff --git a/src/keycloak-theme/login/pages/Login.stories.tsx b/src/keycloak-theme/login/pages/Login.stories.tsx index fd1a295..66c474b 100644 --- a/src/keycloak-theme/login/pages/Login.stories.tsx +++ b/src/keycloak-theme/login/pages/Login.stories.tsx @@ -63,8 +63,12 @@ export const WithPresetUsername: ComponentStory = () => ( export const WithImmutablePresetUsername: ComponentStory = () => ( ); diff --git a/src/keycloak-theme/login/pages/Login.tsx b/src/keycloak-theme/login/pages/Login.tsx index 4d2de20..1de3f27 100644 --- a/src/keycloak-theme/login/pages/Login.tsx +++ b/src/keycloak-theme/login/pages/Login.tsx @@ -1,4 +1,3 @@ -// ejected using 'npx eject-keycloak-page' import { useState, type FormEventHandler } from "react"; import { clsx } from "keycloakify/tools/clsx"; import { useConstCallback } from "keycloakify/tools/useConstCallback"; @@ -15,7 +14,7 @@ export default function Login(props: PageProps
- {(() => { - const label = !realm.loginWithEmailAllowed - ? "username" - : realm.registrationEmailAsUsername - ? "email" - : "usernameOrEmail"; + {!usernameHidden && + (() => { + const label = !realm.loginWithEmailAllowed + ? "username" + : realm.registrationEmailAsUsername + ? "email" + : "usernameOrEmail"; - const autoCompleteHelper: typeof label = label === "usernameOrEmail" ? "username" : label; + const autoCompleteHelper: typeof label = label === "usernameOrEmail" ? "username" : label; - return ( - <> - - - - ); - })()} + return ( + <> + + + + ); + })()}