Skip to content

Commit

Permalink
[#681] add loader in drep details
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Apr 11, 2024
1 parent 5f6cbc4 commit 3d82281
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions govtool/frontend/src/pages/DRepDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,20 @@ export const DRepDetails = ({ isConnected }: DRepDetailsProps) => {
const { data, isLoading } = useGetDRepListQuery({ drepView: dRepParam });
const dRep = data?.[0];

if (!dRep && isLoading)
return <CircularProgress sx={{ display: "block", mx: "auto", mt: 4 }} />;
if (!dRep || isLoading)
return (
<Box
sx={{
display: "flex",
flex: 1,
height: "100%",
alignItems: "center",
justifyContent: "center",
}}
>
<CircularProgress />
</Box>
);

if (!dRep) return <Navigate to={PATHS.error} />;

Expand Down

0 comments on commit 3d82281

Please sign in to comment.