Skip to content

Commit

Permalink
feat: Info tooltip listing good first labels added
Browse files Browse the repository at this point in the history
  • Loading branch information
ipapandinas committed Jan 21, 2024
1 parent 6f2f11e commit e523779
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 9 deletions.
26 changes: 26 additions & 0 deletions assets/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,29 @@ export const FeedbackIcon: React.FC<IconSvgProps> = ({
</svg>
);
};

export const InfoIcon: React.FC<IconSvgProps> = ({
size = 24,
width,
height,
...props
}) => {
return (
<svg
height={size || height}
viewBox="0 0 24 24"
width={size || width}
xmlns="http://www.w3.org/2000/svg"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...props}
>
<circle cx="12" cy="12" r="10" />
<path d="M12 16v-4" />
<path d="M12 8h.01" />
</svg>
);
};
39 changes: 30 additions & 9 deletions components/filters/checkbox-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import React from "react";
import { usePathname, useRouter } from "next/navigation";
import { Checkbox } from "@nextui-org/checkbox";
import { Tooltip } from "@nextui-org/tooltip";
import { InfoIcon } from "@/assets/icons";
import { GOOD_FIRST_ISSUE_LABELS } from "@/data/filters";
import { createUrl } from "@/utils/url";

interface ICheckboxFilterProps {
Expand All @@ -28,16 +31,34 @@ export const CheckboxFilter = ({
};

return (
<Checkbox
classNames={{
wrapper: "before:border-default-200 before:border-medium",
label: "whitespace-nowrap",
}}
isSelected={isSelected}
onValueChange={handleValueChange}
<Tooltip
content={
<div className="px-1 py-2">
<div className="text-small font-bold">
Based on the following GitHub labels:
</div>
{GOOD_FIRST_ISSUE_LABELS.map((label, idx) => (
<div className="text-tiny" key={idx}>
{label}
</div>
))}
</div>
}
>
{placeholder}
</Checkbox>
<div className="flex">
<Checkbox
classNames={{
wrapper: "before:border-default-200 before:border-medium",
label: "flex gap-2 items-center whitespace-nowrap",
}}
isSelected={isSelected}
onValueChange={handleValueChange}
>
{placeholder}
<InfoIcon className="text-default-500" size={16} />
</Checkbox>
</div>
</Tooltip>
);
};

Expand Down

0 comments on commit e523779

Please sign in to comment.