Skip to content

Commit

Permalink
[Bootcamp] Add tooltips for semesters #105
Browse files Browse the repository at this point in the history
  • Loading branch information
debrinaangelica committed Sep 30, 2023
1 parent e965498 commit bf06786
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion frontend/src/components/CourseList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import Loading from "./Loading";
interface Props {
courseIDs: string[];
children: React.ReactNode;
numSaved?: number;
}

const CourseList = ({ courseIDs, children }: Props) => {
const CourseList = ({ courseIDs, children, numSaved}: Props) => {
const loggedIn = useAppSelector((state) => state.user.loggedIn);
const dispatch = useAppDispatch();

Expand All @@ -29,6 +30,13 @@ const CourseList = ({ courseIDs, children }: Props) => {
<div className="py-6 px-2 md:px-6">
{results.length > 0 ? (
<div className="space-y-4">
{numSaved === undefined ? (
<div></div>
) : (
<div className="text-gray-400 mt-6 text-center">
Total Courses Saved: {results.length}
</div>
)}
{/* We found less courses than what we search for, so put a Loading indicator */}
{courseIDs.length > results.length && <Loading />}
{results.map((course) => (
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/saved.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const SavedPage: NextPage = () => {
activePage="saved"
sidebar={<Aggregate />}
content={
<CourseList courseIDs={saved}>
<div className="text-gray-400 mt-6 text-center">
Nothing saved yet!
</div>
<CourseList courseIDs={saved} numSaved={saved.length}>
<div className="text-gray-400 mt-6 text-center">
Nothing saved yet!
</div>
</CourseList>
}
/>
Expand Down

0 comments on commit bf06786

Please sign in to comment.