Skip to content

Commit

Permalink
conditional btns in nav bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitatjosh committed Oct 1, 2024
1 parent c143b95 commit edf8455
Showing 1 changed file with 19 additions and 26 deletions.
45 changes: 19 additions & 26 deletions app/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
"use client";
import { primaryFont } from "@/fonts";
import { cn } from "@/lib/utils";
import { FileIcon } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { Button, buttonVariants } from "./ui/button";
import { usePathname } from "next/navigation";

const Header = () => {
const pathName = usePathname();
return (
<div
className={cn(
Expand All @@ -26,31 +27,23 @@ const Header = () => {
/>
</div>
<div className="flex gap-2 min-w-fit justify-end">
<Link
href={"/new"}
className="text-white hover:underline"
// className={cn(
// buttonVariants({
// className: "text-white text-xs w-full text-nowrap ",
// })
// )}
>
Take A Demo
</Link>
<Link
href={"/transcriptions"}
className="text-white hover:underline"
// className={cn(
// buttonVariants({
// className: "text-white text-xs w-full text-nowrap ",
// })
// )}
>
View Records

</Link>
{pathName !== "/" && pathName !== "/new" && (
<Link
href={"/new"}
className="text-white hover:underline"
>
Take A Demo
</Link>
)}
{pathName !== "/" && pathName !== "/transcriptions" && (
<Link
href={"/transcriptions"}
className="text-white hover:underline"
>
View Records
</Link>
)}
</div>

</div>
);
};
Expand Down

0 comments on commit edf8455

Please sign in to comment.