Skip to content

Commit

Permalink
fix: add loading screen for user context
Browse files Browse the repository at this point in the history
  • Loading branch information
sheensantoscapadngan committed Sep 18, 2024
1 parent 5740d2b commit bd9c9ea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions frontend/src/context/UserContext/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ export const UserProvider = ({ children }: Props): JSX.Element => {
};
}, [data, isLoading]);

if (isLoading) {
return (
<div className="flex h-screen w-screen items-center justify-center bg-bunker-800">
<img
src="/images/loading/loading.gif"
height={70}
width={120}
decoding="async"
loading="lazy"
alt="infisical loading indicator"
/>
</div>
);
}

return <UserContext.Provider value={value}>{children}</UserContext.Provider>;
};

Expand Down

0 comments on commit bd9c9ea

Please sign in to comment.