Skip to content

Commit

Permalink
fix: Add animated progress indicator to object- and variogram result …
Browse files Browse the repository at this point in the history
…pages
  • Loading branch information
o-jorgensen committed Dec 27, 2024
1 parent 0daea46 commit 2dfba0c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
17 changes: 16 additions & 1 deletion src/pages/ModelPages/Results/ObjectResult/ObjectResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { NoResults } from '../../../../features/Results/NoResults/NoResults';
import { useFetchObjectResults } from '../../../../hooks/useFetchChannelResults';
import { usePepmContextStore } from '../../../../hooks/GlobalState';
import { useEffect } from 'react';
import { CircularProgress, Typography } from '@equinor/eds-core-react';
import * as Styled from '../../Model/Model.styled';

export const ObjectResult = () => {
const { computeCases, objectResults, setObjectEstimationResults } =
Expand All @@ -13,7 +15,20 @@ export const ObjectResult = () => {
if (data) setObjectEstimationResults(data.data);
}, [data, setObjectEstimationResults]);

if (isLoading) return <>Loading ...</>;
if (isLoading)
return (
<Styled.EmptyPage>
<div className="loading">
<CircularProgress
color="primary"
size={24}
value={100}
variant="indeterminate"
/>
<Typography variant="body_short">Loading, please wait…</Typography>
</div>
</Styled.EmptyPage>
);

return (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { CaseResultView } from '../../../../features/Results/CaseResult/CaseResu
import { NoResults } from '../../../../features/Results/NoResults/NoResults';
import { usePepmContextStore } from '../../../../hooks/GlobalState';
import { useFetchVariogramResults } from '../../../../hooks/useFetchVariogramResults';
import { CircularProgress, Typography } from '@equinor/eds-core-react';
import * as Styled from '../../Model/Model.styled';

export const VariogramResults = () => {
const { data, isLoading } = useFetchVariogramResults();
Expand All @@ -13,7 +15,20 @@ export const VariogramResults = () => {
if (data) setVariogramResults(data.data);
}, [data, setVariogramResults]);

if (isLoading) return <>Loading ...</>;
if (isLoading)
return (
<Styled.EmptyPage>
<div className="loading">
<CircularProgress
color="primary"
size={24}
value={100}
variant="indeterminate"
/>
<Typography variant="body_short">Loading, please wait…</Typography>
</div>
</Styled.EmptyPage>
);

return (
<>
Expand Down

0 comments on commit 2dfba0c

Please sign in to comment.