mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge pull request #360 from makeplane/style/button
style: new primary button design
This commit is contained in:
commit
032f39d9ec
1
apps/app/components/ui/button/index.ts
Normal file
1
apps/app/components/ui/button/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from "./primary-button";
|
32
apps/app/components/ui/button/primary-button.tsx
Normal file
32
apps/app/components/ui/button/primary-button.tsx
Normal file
@ -0,0 +1,32 @@
|
||||
type TButtonProps = {
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
type?: "button" | "submit" | "reset";
|
||||
disabled?: boolean;
|
||||
loading?: boolean;
|
||||
size?: "sm" | "md" | "lg";
|
||||
};
|
||||
|
||||
export const PrimaryButton: React.FC<TButtonProps> = (props) => {
|
||||
const { children, className, onClick, type, disabled, loading, size = "md" } = props;
|
||||
|
||||
return (
|
||||
<button
|
||||
type={type}
|
||||
className={`hover:bg-opacity-90 transition-colors text-white rounded-lg ${
|
||||
size === "sm"
|
||||
? "px-2.5 py-1.5 text-sm"
|
||||
: size === "md"
|
||||
? "px-3 py-2 text-base"
|
||||
: "px-4 py-3 text-lg"
|
||||
} ${disabled ? "bg-gray-400 cursor-not-allowed" : "bg-theme"} ${className || ""} ${
|
||||
loading ? "cursor-wait" : ""
|
||||
}`}
|
||||
onClick={onClick}
|
||||
disabled={disabled || loading}
|
||||
>
|
||||
<div className="flex items-center">{children}</div>
|
||||
</button>
|
||||
);
|
||||
};
|
Loading…
Reference in New Issue
Block a user