Skip to content

Commit

Permalink
small UI improvement to keycloak loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Luu committed Sep 6, 2023
1 parent a1bac7d commit 0bb98a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/components/src/utils/KeyCloak/KeyCloakMiddleware.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import React, { useState, useEffect } from 'react';
import { ReactKeycloakProvider as KeycloakProvider } from '@react-keycloak/web';
import { Spin } from 'antd';
import './keycloak.css';

import { keycloak } from './config';
import { tokenTimer } from './tokenTimer';
Expand Down Expand Up @@ -62,7 +64,11 @@ const KeyCloakMiddleWare = ({ children }) => {
checkLoginIframe: false,
}}
>
{!isKeycloakReady ? <div>Loading Keycloak...</div> : children}
{!isKeycloakReady ? (
<Spin className="keycloak__loading" tip="Loading Keycloak" size="large" />
) : (
children
)}
</KeycloakProvider>
);
};
Expand Down
8 changes: 8 additions & 0 deletions modules/components/src/utils/KeyCloak/keycloak.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.keycloak__loading {
display: block;
margin: 35vh auto 0 auto;
}

.keycloak__loading .ant-spin-text {
margin-top: 4px;
}

0 comments on commit 0bb98a4

Please sign in to comment.