chore: move FavoriteStar component to ui package (#4834)

* chore: move favorite star to ui package

* Update yarn.lock

---------

Co-authored-by: Satish Gandham <satish.iitg@gmail.com>
This commit is contained in:
Aaryan Khandelwal 2024-06-20 16:26:21 +05:30 committed by GitHub
parent 24adddd29f
commit c36c98476c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 24 additions and 28 deletions

View file

@ -0,0 +1,29 @@
import React from "react";
import { Star } from "lucide-react";
// helpers
import { cn } from "../helpers";
type Props = {
buttonClassName?: string;
iconClassName?: string;
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
selected: boolean;
};
export const FavoriteStar: React.FC<Props> = (props) => {
const { buttonClassName, iconClassName, onClick, selected } = props;
return (
<button type="button" className={cn("h-4 w-4 grid place-items-center", buttonClassName)} onClick={onClick}>
<Star
className={cn(
"h-4 w-4 text-custom-text-300 transition-all",
{
"fill-yellow-500 stroke-yellow-500": selected,
},
iconClassName
)}
/>
</button>
);
};

View file

@ -1,21 +1,22 @@
export * from "./avatar";
export * from "./breadcrumbs";
export * from "./badge";
export * from "./breadcrumbs";
export * from "./button";
export * from "./emoji";
export * from "./dropdowns";
export * from "./control-link";
export * from "./dropdown";
export * from "./dropdowns";
export * from "./emoji";
export * from "./form-fields";
export * from "./hooks";
export * from "./icons";
export * from "./modals";
export * from "./progress";
export * from "./spinners";
export * from "./tooltip";
export * from "./loader";
export * from "./control-link";
export * from "./toast";
export * from "./drag-handle";
export * from "./typography";
export * from "./drop-indicator";
export * from "./sortable";
export * from "./hooks";
export * from "./spinners";
export * from "./toast";
export * from "./tooltip";
export * from "./typography";
export * from "./drag-handle";
export * from "./drop-indicator";
export * from "./favorite-star";
export * from "./loader";