Skip to content

Commit

Permalink
Switch LoadingAnimation to use MUI style
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed Sep 14, 2024
1 parent 806972f commit d20de9d
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 68 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"prettier:check": "prettier --check . **/*.svg",
"check:spelling": "cspell --cache --no-progress '**/*'",
"testonly": "npm run build:demo && npm pack && docker-compose up --abort-on-container-exit --build test",
"declarations": "tsc --emitDeclarationOnly -p tsconfig.lib.json"
"declarations": "tsc --emitDeclarationOnly -p tsconfig.lib.json",
"update-snapshots": "docker-compose up --build update-snapshots"
},
"peerDependencies": {
"graphql": ">=16.5.0",
Expand Down
32 changes: 19 additions & 13 deletions src/components/GraphViewport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,33 @@ export default class GraphViewport extends Component<
render() {
const isLoading = this.state.svgViewport == null;
return (
<>
<Box
sx={(theme) => ({
flex: 1,
position: 'relative',
display: 'inline-block',
width: '100%',
height: '100%',
maxHeight: '100%',

[theme.breakpoints.down('md')]: {
height: '50%',
maxWidth: 'none',
},
})}
>
<Box
ref={this._containerRef}
sx={(theme) => ({
sx={{
height: '100%',
'& > svg': {
height: '100%',
width: '100%',
},
[theme.breakpoints.down('md')]: {
height: '50%',
width: '100%',
maxWidth: 'none',
},
[theme.breakpoints.up('md')]: {
flex: 1,
maxHeight: '100%',
},
})}
}}
/>
{isLoading && <LoadingAnimation />}
</>
</Box>
);
}

Expand Down
1 change: 1 addition & 0 deletions src/components/Voyager.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

& > .menu-content {
position: absolute;
z-index: 5;
bottom: var(--panel-spacing);
left: calc(var(--doc-panel-width) + var(--panel-spacing));
background: var(--doc-panel-bg-color);
Expand Down
47 changes: 0 additions & 47 deletions src/components/utils/LoadingAnimation.css

This file was deleted.

35 changes: 28 additions & 7 deletions src/components/utils/LoadingAnimation.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
import './LoadingAnimation.css';
import { SvgIcon, Typography } from '@mui/material';
import Stack from '@mui/material/Stack';

import VoyagerIcon from '../icons/logo-with-signals.svg';

export default function LoadingAnimation() {
return (
<div role="status" className="loading-box">
<span className="loading-animation">
<VoyagerIcon />
<h1> Transmitting... </h1>
</span>
</div>
<Stack
role="status"
alignItems="center"
justifyContent="center"
sx={{
position: 'absolute',
top: 0,
left: 0,
background: 'rgba(0, 0, 0, 0.8)',
zIndex: 10,

color: 'white',
height: '100%',
width: '100%',
}}
>
<SvgIcon
inheritViewBox
component={VoyagerIcon}
color="secondary"
sx={{ width: 180, height: 180 }}
/>
<Typography variant="h4" color="secondary" letterSpacing={4} fontWeight="medium">
Transmitting...
</Typography>
</Stack>
);
}
Binary file modified tests/demo.spec.ts-snapshots/loading-animation-Demo-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d20de9d

Please sign in to comment.