Fixed loading on file component and unstyled buttons not having nocopy and nopan classes

This commit is contained in:
Lucas Oliveira 2024-06-17 23:11:03 -03:00
commit 6f34e039eb
3 changed files with 16 additions and 15 deletions

View file

@ -8,6 +8,7 @@ import useAlertStore from "../../stores/alertStore";
import useFlowsManagerStore from "../../stores/flowsManagerStore";
import { FileComponentType } from "../../types/components";
import IconComponent from "../genericIconComponent";
import { Button } from "../ui/button";
export default function InputFileComponent({
value,
@ -111,20 +112,20 @@ export default function InputFileComponent({
>
{myValue !== "" ? myValue : "No file"}
</span>
<button onClick={handleButtonClick}>
{!editNode && !loading && (
{!editNode && (
<Button
unstyled
className="ml-3 inline-flex items-center justify-center"
onClick={handleButtonClick}
loading={loading}
disabled={disabled}
>
<IconComponent
name="FileSearch2"
className={
"icons-parameters-comp" +
(disabled ? " text-ring" : " hover:text-accent-foreground")
}
className={"icons-parameters-comp"}
/>
)}
{!editNode && loading && (
<span className="loading loading-spinner loading-sm pointer-events-none h-8 pl-3"></span>
)}
</button>
</Button>
)}
</div>
</div>
);

View file

@ -76,7 +76,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
<>
<Comp
className={
!unstyled ? buttonVariants({ variant, size, className }) : className
!unstyled ? buttonVariants({ variant, size, className }) : cn(className, "nocopy nowheel nopan nodelete nodrag noundo")
}
disabled={loading || disabled}
{...(asChild ? {} : { type: type || "button" })}
@ -86,10 +86,10 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
{loading ? (
<span className="relative">
<span className="invisible">{newChildren}</span>
<span className="absolute inset-0 flex items-center justify-center">
<span className="absolute inset-0">
<ForwardedIconComponent
name={"Loader2"}
className={"animate-spin"}
className={"animate-spin m-auto h-full"}
/>
</span>
</span>

View file

@ -931,7 +931,7 @@
}
.icons-parameters-comp {
@apply ml-3 h-6 w-6;
@apply h-6 w-6;
}
.form-modal-lock-true {