fix(dashboard): allow style overrides on primary and secondary buttons
This commit is contained in:
@@ -291,6 +291,7 @@ type BtnProps = {
|
|||||||
type?: "button" | "submit";
|
type?: "button" | "submit";
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
danger?: boolean;
|
danger?: boolean;
|
||||||
|
style?: React.CSSProperties;
|
||||||
};
|
};
|
||||||
|
|
||||||
const btnBase: React.CSSProperties = {
|
const btnBase: React.CSSProperties = {
|
||||||
@@ -313,6 +314,7 @@ export function PrimaryButton({
|
|||||||
onClick,
|
onClick,
|
||||||
type = "button",
|
type = "button",
|
||||||
disabled,
|
disabled,
|
||||||
|
style,
|
||||||
}: BtnProps) {
|
}: BtnProps) {
|
||||||
const [hover, setHover] = useState(false);
|
const [hover, setHover] = useState(false);
|
||||||
return (
|
return (
|
||||||
@@ -328,6 +330,7 @@ export function PrimaryButton({
|
|||||||
color: THEME.accentText,
|
color: THEME.accentText,
|
||||||
border: `1px solid ${hover ? THEME.accentHover : THEME.accent}`,
|
border: `1px solid ${hover ? THEME.accentHover : THEME.accent}`,
|
||||||
opacity: disabled ? 0.5 : 1,
|
opacity: disabled ? 0.5 : 1,
|
||||||
|
...style,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
@@ -343,6 +346,7 @@ export function SecondaryButton({
|
|||||||
type = "button",
|
type = "button",
|
||||||
disabled,
|
disabled,
|
||||||
danger,
|
danger,
|
||||||
|
style,
|
||||||
}: BtnProps) {
|
}: BtnProps) {
|
||||||
const [hover, setHover] = useState(false);
|
const [hover, setHover] = useState(false);
|
||||||
const color = danger ? THEME.danger : THEME.ink;
|
const color = danger ? THEME.danger : THEME.ink;
|
||||||
@@ -364,6 +368,7 @@ export function SecondaryButton({
|
|||||||
color,
|
color,
|
||||||
border: `1px solid ${borderColor}`,
|
border: `1px solid ${borderColor}`,
|
||||||
opacity: disabled ? 0.5 : 1,
|
opacity: disabled ? 0.5 : 1,
|
||||||
|
...style,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
|
|||||||
Reference in New Issue
Block a user