Skip to content

Commit

Permalink
chore(ui): copy style from public/index.html to keep consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
ourai authored and robinv8 committed Oct 22, 2024
1 parent 8753716 commit 9fa6ef6
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
35 changes: 35 additions & 0 deletions ui/src/components/InitialLoadingPlaceholder/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Same as spin in `public/index.html`

@keyframes _initial-loading-spin {
to { transform: rotate(360deg) }
}

.InitialLoadingPlaceholder {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: white;
z-index: 9999;

&-spinnerContainer {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

&-spinner {
box-sizing: border-box;
display: inline-block;
width: 2rem;
height: 2rem;
vertical-align: -.125em;
border: .25rem solid currentColor;
border-right-color: transparent;
color: rgba(108, 117, 125, .75);
border-radius: 50%;
animation: 0.75s linear infinite _initial-loading-spin;
}
}
17 changes: 7 additions & 10 deletions ui/src/components/InitialLoadingPlaceholder/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { Spinner } from 'react-bootstrap';
// Same as spin in `public/index.html`

import './index.scss';

function InitialLoadingPlaceholder() {
return (
<div
style={{
flexGrow: 1,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}>
<Spinner />
<span style={{ marginLeft: 8 }}>Initializing</span>
<div className="InitialLoadingPlaceholder">
<div className="InitialLoadingPlaceholder-spinnerContainer">
<div className="InitialLoadingPlaceholder-spinner" />
</div>
</div>
);
}
Expand Down

0 comments on commit 9fa6ef6

Please sign in to comment.