🔨 refactor(frontend): remove unnecessary empty object destructuring in LoadingSpinner component

🔨 refactor(frontend): simplify conditional rendering in InputFileComponent component
🔨 refactor(frontend): simplify arrow function in SupabaseIcon component
The empty object destructuring in the LoadingSpinner component is unnecessary and can be removed. The conditional rendering in the InputFileComponent component can be simplified by removing unnecessary parentheses. The arrow function in the SupabaseIcon component can be simplified by removing unnecessary parentheses.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-22 22:57:00 -03:00
commit 4dec5db45e
3 changed files with 11 additions and 16 deletions

View file

@ -2,8 +2,5 @@ import { useContext, useEffect, useRef, useState } from "react";
import { RadialProgressType } from "../../types/components";
export default function LoadingSpinner({}) {
return (
<></>
);
return <></>;
}

View file

@ -114,15 +114,12 @@ export default function InputFileComponent({
{myValue !== "" ? myValue : "No file"}
</span>
<button onClick={handleButtonClick}>
{(!editNode && !loading) && (
{!editNode && !loading && (
<DocumentMagnifyingGlassIcon className="w-8 h-8 hover:text-ring" />
)}
{
(!editNode && loading) && (
<span className="loading loading-spinner loading-sm pl-3 w-8 h-8 pointer-events-none"></span>
)
}
{!editNode && loading && (
<span className="loading loading-spinner loading-sm pl-3 w-8 h-8 pointer-events-none"></span>
)}
</button>
</div>
</div>

View file

@ -1,8 +1,9 @@
import React, { forwardRef } from "react";
import { ReactComponent as SupabaseSvg } from "./supabase-icon.svg";
export const SupabaseIcon = forwardRef<SVGSVGElement, React.PropsWithChildren<{}>>(
(props, ref) => {
return <SupabaseSvg ref={ref} {...props} />;
}
);
export const SupabaseIcon = forwardRef<
SVGSVGElement,
React.PropsWithChildren<{}>
>((props, ref) => {
return <SupabaseSvg ref={ref} {...props} />;
});