-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from Hexastack/215-bug-ui-freeze-for-public-a…
…fter-authentication fix(frontend): public pages extra rendering
- Loading branch information
Showing
5 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
frontend/src/components/anonymous/PublicContentWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { CircularProgress, Grid } from "@mui/material"; | ||
import { FC } from "react"; | ||
|
||
import { useAuth } from "@/hooks/useAuth"; | ||
|
||
export type PublicContentWrapperProps = { children: React.ReactNode }; | ||
export const PublicContentWrapper: FC<PublicContentWrapperProps> = ({ | ||
children, | ||
}) => { | ||
const { isAuthenticated } = useAuth(); | ||
|
||
return ( | ||
<Grid container justifyContent="center"> | ||
{isAuthenticated ? <CircularProgress /> : children} | ||
</Grid> | ||
); | ||
}; |