Skip to content

Commit c4c1d2d

Browse files
Merge pull request #18 from abhitrueprogrammer/master
Search placeholder and layout fix
2 parents e08bd08 + c3cdd83 commit c4c1d2d

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

src/components/CatalogueContent.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ const CatalogueContent = () => {
6060
link.download = filename;
6161
link.click();
6262
window.URL.revokeObjectURL(link.href);
63-
} catch (error) {
64-
}
63+
} catch (error) {}
6564
}
6665

6766
const handleSelectPaper = (paper: Paper, isSelected: boolean) => {
@@ -159,29 +158,23 @@ const CatalogueContent = () => {
159158

160159
return (
161160
<div className="min-h-screen px-2 md:p-8">
162-
<div className="mb-4 flex w-full flex-row items-center md:justify-center md:gap-10">
163-
<div className="w-[120%] md:w-[576px]">
161+
<div className="mb-10 flex w-full flex-row items-center md:justify-between md:gap-10">
162+
<div className=" w-[120%] md:w-[576px]">
164163
<SearchBar />
165164
</div>
166-
{subject && filterOptions && (
167-
<FilterDialog
168-
subject={subject}
169-
filterOptions={filterOptions}
170-
initialExams={exams}
171-
initialSlots={slots}
172-
initialYears={years}
173-
onReset={handleResetFilters}
174-
onApplyFilters={handleApplyFilters}
175-
/>
176-
)}{" "}
177-
</div>
178-
179-
{error && <p className="text-red-500">{error}</p>}
180-
{loading ? (
181-
<Loader />
182-
) : papers.length > 0 ? (
183-
<>
184-
<div className="mb-4 hidden md:flex justify-center gap-2 md:justify-end 2xl:mr-4">
165+
<div className="flex gap-8">
166+
{subject && filterOptions && (
167+
<FilterDialog
168+
subject={subject}
169+
filterOptions={filterOptions}
170+
initialExams={exams}
171+
initialSlots={slots}
172+
initialYears={years}
173+
onReset={handleResetFilters}
174+
onApplyFilters={handleApplyFilters}
175+
/>
176+
)}{" "}
177+
<div className=" hidden items-center justify-center gap-2 md:flex md:justify-end 2xl:mr-4">
185178
<Button variant="outline" onClick={handleSelectAll}>
186179
Select All
187180
</Button>
@@ -196,6 +189,14 @@ const CatalogueContent = () => {
196189
Download All ({selectedPapers.length})
197190
</Button>
198191
</div>
192+
</div>
193+
</div>
194+
195+
{error && <p className="text-red-500">{error}</p>}
196+
{loading ? (
197+
<Loader />
198+
) : papers.length > 0 ? (
199+
<>
199200
<div className="mx-auto flex flex-col flex-wrap items-center justify-center gap-10 md:flex-row md:justify-normal">
200201
{papers.map((paper) => (
201202
<Card

src/components/searchbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function SearchBar() {
8484
type="text"
8585
value={searchText}
8686
onChange={handleSearchChange}
87-
placeholder="Search..."
87+
placeholder="Search by subject..."
8888
className={`w-full rounded-xl border bg-[#7480FF] px-4 py-6 pr-10 text-white shadow-sm placeholder:text-white focus:outline-none focus:ring-2 ${loading ? "opacity-70" : ""}`}
8989
/>
9090
<button

0 commit comments

Comments
 (0)