Skip to content

Commit cfaa9bd

Browse files
authored
Frontend/edwin/minor optimisations (#103)
1 parent a534775 commit cfaa9bd

File tree

3 files changed

+5
-45
lines changed

3 files changed

+5
-45
lines changed

frontend/src/app/page.tsx

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"use client";
22

3-
import { useFilterContext } from "@/context/filter/filter-context";
4-
import { CreateQueryString } from "@/lib/utils";
5-
import { JobFilters } from "@/types/filters";
63
import { Button } from "@mantine/core";
74
import { useRouter } from "next/navigation";
85
import { useEffect } from "react";
@@ -11,38 +8,20 @@ import { IconArrowRight } from "@tabler/icons-react";
118
import DotBackground from "@/components/ui/dot-background";
129

1310
export default function Page() {
14-
const { updateFilters, filters } = useFilterContext();
1511
const router = useRouter();
1612

1713
useEffect(() => {
1814
document.title = "Home | MAC Jobs Board";
1915
}, []);
2016

2117
const handleGradJobsClick = () => {
22-
const newFilters = {
23-
...filters.filters,
24-
jobTypes: ["GRADUATE"] as JobFilters["jobTypes"],
25-
page: 1,
26-
};
27-
28-
updateFilters({ filters: newFilters });
29-
30-
const queryParams = CreateQueryString({ filters: newFilters });
31-
router.push(`/jobs?${queryParams}`);
18+
router.push(`/jobs?jobTypes%5B%5D=GRADUATE&page=1&sortBy=recent`);
3219
};
3320

3421
const handleInternJobsClick = () => {
35-
const newFilters = {
36-
...filters.filters,
37-
jobTypes: ["INTERN"] as JobFilters["jobTypes"],
38-
page: 1,
39-
};
40-
41-
updateFilters({ filters: newFilters });
42-
43-
const queryParams = CreateQueryString({ filters: newFilters });
44-
router.push(`/jobs?${queryParams}`);
22+
router.push(`/jobs?jobTypes%5B%5D=INTERN&page=1&sortBy=recent`);
4523
};
24+
4625
return (
4726
<>
4827
<DotBackground />

frontend/src/assets/mac.svg

Lines changed: 1 addition & 14 deletions
Loading

frontend/src/components/layout/logo.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ import Link from "next/link";
55
export default function Logo() {
66
return (
77
<Link href="/" className="flex space-x-3 items-center h-8 cursor-pointer">
8-
<Image
9-
src={MacLogo}
10-
className="h-10 w-10"
11-
alt="MAC Logo"
12-
placeholder="blur"
13-
blurDataURL="iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8cEf3PwAHtwL6YluwEgAAAABJRU5ErkJggg=="
14-
/>
8+
<Image src={MacLogo} className="h-10 w-10" alt="MAC Logo" />
159
<span className="text-lg lg:text-xl">Jobs</span>
1610
</Link>
1711
);

0 commit comments

Comments
 (0)