Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/components/CatalogueContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import JSZip from "jszip";
import { toast } from "react-hot-toast";
import { useCourses } from "@/context/courseContext";
import EmptyState from "./ui/EmptyState";
import SidebarButton from "./SidebarButton";

const CatalogueContent = () => {
const router = useRouter();
Expand Down Expand Up @@ -417,6 +418,22 @@ const CatalogueContent = () => {
</button>
</div>
</div>


{/* Select/Deselect/Download All Buttons */}

<div className="mb-8 flex w-full items-center justify-end gap-4">
<SidebarButton onClick={handleSelectAll}>
Select All
</SidebarButton>
<SidebarButton onClick={handleDeselectAll}>
Deselect All
</SidebarButton>
<SidebarButton onClick={handleDownloadSelected}>
Download Selected
</SidebarButton>
</div>

{relatedSubjects.length > 0 && (
<div className="mt-3 flex flex-wrap items-center gap-2">
<span className="mr-2 text-sm font-medium text-gray-500 dark:text-gray-300">
Expand Down
15 changes: 5 additions & 10 deletions src/components/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function SideBar({
filterOptions,
filtersNotPulled,
handleApplyFilters,
handleSelectAll,
handleDeselectAll,
handleDownloadSelected: handleDownloadAll,
handleSelectAll,
handleDeselectAll,
handleDownloadSelected
}: {
loading: boolean;
selectedExams: string[];
Expand All @@ -41,8 +41,8 @@ function SideBar({
semester: string[],
anskey: boolean
) => void;
handleSelectAll: () => void;
handleDeselectAll: () => void;
handleSelectAll: () => void;
handleDeselectAll: () => void;
handleDownloadSelected: () => void;
}) {
const exams =
Expand Down Expand Up @@ -146,11 +146,6 @@ function SideBar({
</SidebarButton>
</div>

<div className="flex w-full flex-wrap justify-between gap-2 border-b-2 border-[#36266d] px-[10px] py-4">
<SidebarButton onClick={handleSelectAll}>Select All</SidebarButton>
<SidebarButton onClick={handleDeselectAll}>Deselect All</SidebarButton>
<SidebarButton onClick={handleDownloadAll}>Download Selected</SidebarButton>
</div>

{filtersForSidebar.map((section) => (
<SidebarSection
Expand Down