mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
chore: update Button component
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import react, { JSX } from 'react';
|
import react from 'react';
|
||||||
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
@@ -17,11 +17,12 @@ const Button = ({
|
|||||||
type,
|
type,
|
||||||
href,
|
href,
|
||||||
variant,
|
variant,
|
||||||
color,
|
color = 'primary',
|
||||||
isLoading,
|
isLoading,
|
||||||
className,
|
className,
|
||||||
disabled,
|
disabled,
|
||||||
onClick,
|
onClick,
|
||||||
|
...props
|
||||||
}: ButtonProps) => {
|
}: ButtonProps) => {
|
||||||
const btnBaseClassName = cn(
|
const btnBaseClassName = cn(
|
||||||
'btn',
|
'btn',
|
||||||
@@ -49,6 +50,7 @@ const Button = ({
|
|||||||
<>
|
<>
|
||||||
{!href && (
|
{!href && (
|
||||||
<button
|
<button
|
||||||
|
{...props}
|
||||||
type={type}
|
type={type}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
@@ -59,7 +61,7 @@ const Button = ({
|
|||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{!isLoading && children}
|
{!isLoading && children}
|
||||||
{isLoading && <span className='loading loading-dots loading-md' />}
|
{isLoading && <span className='loading loading-dots loading-xl' />}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user