Skip to content

Commit

Permalink
Added conditional Loading text to About Page and removed random debug…
Browse files Browse the repository at this point in the history
… logs
  • Loading branch information
rishit-singh committed Dec 28, 2023
1 parent 92ab2f6 commit 0e8716a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion frontend/src/app/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export default function NavBar({ Pages } : NavBarProps)
const navButtons: Array<JSX.Element> = new Array<JSX.Element>();

Pages.forEach((value, key, pageMap) => {
console.log(currentPage == value);
navButtons.push(<NavButton Label={key} Activated={currentPage == value} EndPoint={value} OnClick={onClickHandler}/>);
});

Expand Down
9 changes: 8 additions & 1 deletion frontend/src/app/about/AboutPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import {Component, useEffect} from "react";
import {Component, useEffect, useState} from "react";
import ExecProfiles from "../ExecProfiles";
import { useAppDispatch, useAppSelector } from "../hooks/hooks";
import { AddExecProfile, ExecProfileObject, selectProfile } from "../slices/execProfileSlice";
Expand All @@ -20,6 +20,8 @@ export default function AboutPage({} : AboutPageProps)

const mainDispatch = useAppDispatch();

const [loading, setLoading] = useState(true);

mainDispatch(SetCurrentPage("/about"));

// fetch the profiles if not done already
Expand All @@ -33,6 +35,8 @@ export default function AboutPage({} : AboutPageProps)
mainDispatch(AddExecProfile(element));
});
}

setLoading(false);
})();
});

Expand All @@ -55,6 +59,9 @@ export default function AboutPage({} : AboutPageProps)
</div>
<div className={"profileContainer"}>
<div className={"flex flex-col ml-5 mr-5 gap-3 items-center"}>
{
((): JSX.Element => { return (loading) ? <div>Loading</div> : <></>; })()
}
<ExecProfiles/>
</div>
</div>
Expand Down

0 comments on commit 0e8716a

Please sign in to comment.