Skip to content

Commit

Permalink
Merge pull request #31 from joshsoftware/conditional-render-links
Browse files Browse the repository at this point in the history
conditional btns in nav bar
  • Loading branch information
sourabh-josh authored Oct 1, 2024
2 parents c143b95 + edf8455 commit acd9db8
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 acd9db8

Please sign in to comment.