Skip to content

Commit

Permalink
Merge pull request #523 from pankona/fix-glitch-in-header
Browse files Browse the repository at this point in the history
Fix glitch in header
  • Loading branch information
pankona committed May 6, 2022
2 parents 08178ce + ad23608 commit 77b7eed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
6 changes: 4 additions & 2 deletions hashira-web/src/AccessToken.tsx
Expand Up @@ -22,8 +22,10 @@ const AccessToken: React.FC<{ user: firebase.User | null | undefined }> = ({

return (
<div>
<Header user={user} isLoading={!user} />
{user && accesstokens && (
<Header user={user} />
{!user || !accesstokens ? (
<div>Loading...</div>
) : (
<>
<button
onClick={async () => {
Expand Down
2 changes: 1 addition & 1 deletion hashira-web/src/App.tsx
Expand Up @@ -145,7 +145,7 @@ const App: React.FC<{ user: firebase.User | null | undefined }> = ({

return (
<div>
<Header user={user} isLoading={!user || !tasksAndPriorities} />
<Header user={user} />
<StyledBody>
{user !== null && (
<TaskInput
Expand Down
6 changes: 1 addition & 5 deletions hashira-web/src/Header.tsx
Expand Up @@ -32,8 +32,7 @@ const StyledLoginLogout = styled.div`

const Header: React.FC<{
user: firebase.User | null | undefined;
isLoading: boolean;
}> = ({ user, isLoading }) => {
}> = ({ user }) => {
const navigate = useNavigate();

return (
Expand Down Expand Up @@ -63,9 +62,6 @@ const Header: React.FC<{
</div>
);
default:
if (isLoading) {
return <div></div>;
}
return (
<>
<div
Expand Down

0 comments on commit 77b7eed

Please sign in to comment.