Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigation spacing fix #133

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/navigation/navigation-disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@ import { Disclosure } from "@headlessui/react";
import React from "react";
import { NavigationDisclosurePanel } from "./navigation-disclosure-panel";
import { NavigationGroupItemTag } from "./navigation-group-item-tag";
import { classNames } from "../../util/class-names";

export interface NavigationDisclosureButtonProps {
children: React.ReactNode;
LeftIcon?: React.ElementType;
onClick?: () => void;
tag?: string;
className?: string;
}

const NavigationDisclosureButton = ({
children,
LeftIcon,
onClick,
tag,
className,
}: NavigationDisclosureButtonProps) => {
return (
<Disclosure.Button
className="flex w-full cursor-pointer items-center gap-x-3 px-4 py-3 text-left text-sm text-neutral-0 hover:bg-primary-900+10 ui-open:bg-primary-900+8 ui-open:font-semibold"
className={classNames(
"flex w-full cursor-pointer items-center gap-x-2 px-4 py-3 text-left text-sm text-neutral-0 hover:bg-primary-900+10 ui-open:bg-primary-900+8 ui-open:font-semibold",
className
)}
onClick={onClick}
>
{LeftIcon ? <LeftIcon className="h-4 w-4" /> : null}
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/navigation-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const NavigationGroupItem = ({
return (
<div
className={classNames(
"relative flex cursor-pointer items-center gap-x-3 px-4 py-3 text-sm text-neutral-0 hover:bg-primary-900+10",
"relative flex cursor-pointer items-center gap-x-2 px-4 py-3 text-sm text-neutral-0 hover:bg-primary-900+10",
isActive && "bg-primary-900+20 font-semibold hover:bg-primary-900+20"
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion src/components/navigation/navigation.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const Default: Story = {
<Navigation.Group.Item>Mail Intelligence</Navigation.Group.Item>
<Navigation.Disclosure>
<Navigation.Disclosure.Button tag="Beta">
AbuseHQ 2
Guardian Ops
</Navigation.Disclosure.Button>
<Navigation.Disclosure.Panel>
<Navigation.Disclosure.Panel.Item>
Expand Down
Loading