UI: Initial render whitespace bug (#11159)

## Addresses #11088 
Updated solution:
https://www.loom.com/share/e3ca30bebde54df5b8cbd8cac6d26780
- First refresh displays the bug: a white bar at the top of the page as
the login page loads.
- Second refresh displays the login page with the bug gone
- Navigate at the end to an error page to confirm it is unaffected,
since the initial solution affected the background color of those pages

## Checklist for submitter
- [x] Changes file added for user-visible changes in `changes/` 
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
Jacob Shandling
2023-04-24 11:38:35 -07:00
committed by GitHub
co-authored by Jacob Shandling
parent 672c0d9239
commit d5c9ae2baf
4 changed files with 12 additions and 5 deletions
+1
View File
@@ -0,0 +1 @@
- Fix a bug where a white bar appears at the top of the login page before the app renders.
+3 -1
View File
@@ -49,6 +49,8 @@ const statusMessages: IStatusMessages = {
"There was an error with single sign-on. Please contact your Fleet administrator.",
};
const baseClass = "login-page";
const LoginPage = ({ router, location }: ILoginPageProps) => {
const {
availableTeams,
@@ -193,7 +195,7 @@ const LoginPage = ({ router, location }: ILoginPageProps) => {
}, [redirectLocation]);
if (isLoadingSSOSettings) {
return <Spinner />;
return <Spinner className={`${baseClass}__loading-spinner`} />;
}
return (
+8
View File
@@ -1,3 +1,11 @@
.login-page {
&__loading-spinner.centered {
margin: 0;
position: absolute;
left: 50vw;
top: 40vh;
}
}
.login-form-animation-leave {
transform: scale(1);
opacity: 1;
-4
View File
@@ -1,4 +0,0 @@
export interface IRequestCSRData {
email: string;
org_name: string;
}