Add disabled state to buttons
This commit is contained in:
parent
09e3ab3247
commit
79552da372
@ -5,12 +5,18 @@ export function button({
|
||||
text,
|
||||
href,
|
||||
variant,
|
||||
disabled = false,
|
||||
}: {
|
||||
text: string;
|
||||
href: string;
|
||||
variant: variant;
|
||||
disabled?: boolean;
|
||||
}): JSX.Element {
|
||||
return /* HTML */ `<a class="button button--color-${variant}" href="${href}">
|
||||
return /* HTML */ `<a
|
||||
class="button button--color-${variant}"
|
||||
${disabled ? "" : `href="${href}"`}
|
||||
${disabled ? "disabled" : ""}
|
||||
>
|
||||
${text}
|
||||
</a>`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user