forked from github/plane
style: disabled state for buttons (#724)
This commit is contained in:
parent
c9d8a8dbd1
commit
65037b5031
@ -13,7 +13,7 @@ export const DangerButton: React.FC<ButtonProps> = ({
|
|||||||
}) => (
|
}) => (
|
||||||
<button
|
<button
|
||||||
type={type}
|
type={type}
|
||||||
className={`${className} border font-medium duration-300 ${
|
className={`${className} border border-red-500 font-medium duration-300 ${
|
||||||
size === "sm"
|
size === "sm"
|
||||||
? "rounded px-3 py-2 text-xs"
|
? "rounded px-3 py-2 text-xs"
|
||||||
: size === "md"
|
: size === "md"
|
||||||
@ -21,13 +21,13 @@ export const DangerButton: React.FC<ButtonProps> = ({
|
|||||||
: "rounded-lg px-4 py-2 text-base"
|
: "rounded-lg px-4 py-2 text-base"
|
||||||
} ${
|
} ${
|
||||||
disabled
|
disabled
|
||||||
? "cursor-not-allowed border-gray-300 bg-gray-300 text-black hover:border-gray-300 hover:border-opacity-100 hover:bg-gray-300 hover:bg-opacity-100 hover:text-black"
|
? "cursor-not-allowed bg-opacity-70 border-opacity-70 hover:bg-opacity-70 hover:border-opacity-70"
|
||||||
: "border-red-500"
|
: ""
|
||||||
} ${
|
} ${
|
||||||
outline
|
outline
|
||||||
? "bg-transparent hover:bg-red-500 hover:text-white"
|
? "bg-transparent text-red-500 hover:bg-red-500 hover:text-white"
|
||||||
: "bg-red-500 hover:border-opacity-90 hover:bg-opacity-90"
|
: "text-white bg-red-500 hover:border-opacity-90 hover:bg-opacity-90"
|
||||||
} ${!disabled && !outline ? "text-white" : ""} ${loading ? "cursor-wait" : ""}`}
|
} ${loading ? "cursor-wait" : ""}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
>
|
>
|
||||||
|
@ -13,7 +13,7 @@ export const PrimaryButton: React.FC<ButtonProps> = ({
|
|||||||
}) => (
|
}) => (
|
||||||
<button
|
<button
|
||||||
type={type}
|
type={type}
|
||||||
className={`${className} border font-medium duration-300 ${
|
className={`${className} border border-theme font-medium duration-300 ${
|
||||||
size === "sm"
|
size === "sm"
|
||||||
? "rounded px-3 py-2 text-xs"
|
? "rounded px-3 py-2 text-xs"
|
||||||
: size === "md"
|
: size === "md"
|
||||||
@ -21,13 +21,13 @@ export const PrimaryButton: React.FC<ButtonProps> = ({
|
|||||||
: "rounded-lg px-4 py-2 text-base"
|
: "rounded-lg px-4 py-2 text-base"
|
||||||
} ${
|
} ${
|
||||||
disabled
|
disabled
|
||||||
? "cursor-not-allowed border-gray-300 bg-gray-300 text-black hover:border-gray-300 hover:border-opacity-100 hover:bg-gray-300 hover:bg-opacity-100 hover:text-black"
|
? "cursor-not-allowed bg-opacity-70 border-opacity-70 hover:bg-opacity-70 hover:border-opacity-70"
|
||||||
: "border-theme"
|
: ""
|
||||||
} ${
|
} ${
|
||||||
outline
|
outline
|
||||||
? "bg-transparent hover:bg-theme hover:text-white"
|
? "bg-transparent text-theme hover:bg-theme hover:text-white"
|
||||||
: "bg-theme hover:border-opacity-90 hover:bg-opacity-90"
|
: "text-white bg-theme hover:border-opacity-90 hover:bg-opacity-90"
|
||||||
} ${!disabled && !outline ? "text-white" : ""} ${loading ? "cursor-wait" : ""}`}
|
} ${loading ? "cursor-wait" : ""}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled || loading}
|
disabled={disabled || loading}
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user