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:
parent
24adddd29f
commit
c36c98476c
11 changed files with 24 additions and 28 deletions
29
packages/ui/src/favorite-star.tsx
Normal file
29
packages/ui/src/favorite-star.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue