Skip to content

Commit 9ad004a

Browse files
upload button -> home button on /upload
1 parent ffb1713 commit 9ad004a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/components/Navbar.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
"use client"
12
import ccLogo from "../assets/codechef_logo.svg";
23
import Image from "next/image";
34
import { Button } from "@/components/ui/button";
45
import ModeToggle from "@/components/toggle-theme";
56
import { ArrowUpToLine } from "lucide-react";
67
import Link from "next/link";
8+
import { usePathname } from "next/navigation";
79

810
function Navbar() {
11+
const pathname = usePathname();
12+
913
return (
1014
<div className="flex items-center justify-between gap-x-3 w-[90%] md:w-full overflow-x-hidden px-2 py-6 md:px-12">
1115
<div className="hidden w-[20%] md:block">
@@ -31,10 +35,10 @@ function Navbar() {
3135
<ModeToggle />
3236
</div>
3337

34-
<Link href="/upload">
38+
<Link href={pathname == "/upload" ? "/" :"/upload"}>
3539
<div className="md:p-[2px] bg-gradient-to-r from-[#562EE7] to-[#bd21b4] rounded-full">
3640
<div className="whitespace-nowrap rounded-full font-bold text-xs md:text-sm mt-2 md:mt-0 bg-slate-200 dark:bg-black px-4 md:px-6 py-3 tracking-wider text-black dark:text-white font-sans hover:bg-white dark:hover:bg-slate-700">
37-
UPLOAD PAPERS
41+
{pathname == "/upload" ? "⇱ SEARCH PAPERS": "⇱ UPLOAD PAPERS"}
3842
</div>
3943
</div>
4044
</Link>

src/components/searchbarSubjectList.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function SearchbarSubjectList({
8484
value={searchText}
8585
onChange={handleSearchChange}
8686
placeholder="Search for subject..."
87+
className=" pr-10"
8788
// className={`text-md w-fuyll rounded-full border bg-[#434dba] px-4 py-6 pr-10 font-sans tracking-wider text-white shadow-sm placeholder:text-white focus:outline-none focus:ring-2 ${loading ? "opacity-70" : ""}`}
8889
/>
8990
<button

0 commit comments

Comments
 (0)