fix: navbar issues
This commit is contained in:
parent
e95811474e
commit
4bca9a7376
@ -31,7 +31,6 @@ export function Navbar() {
|
|||||||
const _isDesktop = useMediaQuery("(min-width: 1024px)");
|
const _isDesktop = useMediaQuery("(min-width: 1024px)");
|
||||||
const [isDesktop, setIsDesktop] = useState(true);
|
const [isDesktop, setIsDesktop] = useState(true);
|
||||||
|
|
||||||
const pricingPlanFlagEnable = useFeatureFlagEnabled("pricing-plan");
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsDesktop(_isDesktop);
|
setIsDesktop(_isDesktop);
|
||||||
@ -53,13 +52,6 @@ export function Navbar() {
|
|||||||
</SheetHeader>
|
</SheetHeader>
|
||||||
<div className="grid h-full grid-rows-[1fr_auto]">
|
<div className="grid h-full grid-rows-[1fr_auto]">
|
||||||
<NavbarMenu className=" h-full" />
|
<NavbarMenu className=" h-full" />
|
||||||
{/* <OrganizationSwitcher
|
|
||||||
appearance={{
|
|
||||||
elements: {
|
|
||||||
rootBox: "flex items-center justify-center z-[50]",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button variant="outline">
|
<Button variant="outline">
|
||||||
@ -90,31 +82,13 @@ export function Navbar() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row items-center gap-2">
|
<div className="flex flex-row items-center gap-2">
|
||||||
{isDesktop && <NavbarMenu />}
|
{isDesktop && <NavbarMenu />}
|
||||||
{pricingPlanFlagEnable && (
|
{/* <Button
|
||||||
<>
|
|
||||||
<Button
|
|
||||||
asChild
|
|
||||||
variant="link"
|
|
||||||
className="rounded-full aspect-square p-2 mr-4"
|
|
||||||
>
|
|
||||||
<a href="/pricing">Pricing</a>
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
asChild
|
|
||||||
variant="link"
|
|
||||||
className="rounded-full aspect-square p-2 mr-4"
|
|
||||||
>
|
|
||||||
<a href="/usage">Usage</a>
|
|
||||||
</Button>
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
<Button
|
|
||||||
asChild
|
asChild
|
||||||
variant="link"
|
variant="link"
|
||||||
className="rounded-full aspect-square p-2 mr-4"
|
className="rounded-full aspect-square p-2 mr-4"
|
||||||
>
|
>
|
||||||
<a href="/docs">Docs</a>
|
<a href="/docs">Docs</a>
|
||||||
</Button>
|
</Button> */}
|
||||||
<UserButton
|
<UserButton
|
||||||
afterSignOutUrl="/"
|
afterSignOutUrl="/"
|
||||||
/>
|
/>
|
||||||
|
@ -6,6 +6,7 @@ import { cn } from "@/lib/utils";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useFeatureFlagEnabled } from "posthog-js/react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useMediaQuery } from "usehooks-ts";
|
import { useMediaQuery } from "usehooks-ts";
|
||||||
|
|
||||||
@ -21,6 +22,8 @@ export function NavbarMenu({ className }: { className?: string }) {
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
|
const pricingPlanFlagEnable = useFeatureFlagEnabled("pricing-plan");
|
||||||
|
|
||||||
const pages = [
|
const pages = [
|
||||||
{
|
{
|
||||||
name: "Workflows",
|
name: "Workflows",
|
||||||
@ -40,15 +43,31 @@ export function NavbarMenu({ className }: { className?: string }) {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
if (pricingPlanFlagEnable) {
|
||||||
|
pages.push({
|
||||||
|
name: "Pricing",
|
||||||
|
path: "/pricing",
|
||||||
|
})
|
||||||
|
pages.push({
|
||||||
|
name: "Usage",
|
||||||
|
path: "/usage",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pages.push({
|
||||||
|
name: "Docs",
|
||||||
|
path: "/docs",
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("mr-2", className)}>
|
<div className={cn("mr-2", className)}>
|
||||||
{/* <div className="w-full h-full absolute inset-x-0 top-0 flex items-center justify-center pointer-events-none"> */}
|
{/* <div className="w-full h-full absolute inset-x-0 top-0 flex items-center justify-center pointer-events-none"> */}
|
||||||
{isDesktop && (
|
{isDesktop && (
|
||||||
<Tabs
|
<Tabs
|
||||||
defaultValue={pathname}
|
defaultValue={pathname}
|
||||||
className="w-[400px] flex pointer-events-auto"
|
className="w-fit flex pointer-events-auto"
|
||||||
>
|
>
|
||||||
<TabsList className="grid w-full grid-cols-4">
|
<TabsList className=" w-full ">
|
||||||
{pages.map((page) => (
|
{pages.map((page) => (
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
key={page.name}
|
key={page.name}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user