Skip to content

Commit

Permalink
feat: add configurable size to CustomLoader component
Browse files Browse the repository at this point in the history
  • Loading branch information
deon-sanchez committed Feb 7, 2025
1 parent d994a73 commit d41b7b9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions src/frontend/src/customization/components/custom-loader.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import LoadingComponent from "@/components/common/loadingComponent";
import { ENABLE_DATASTAX_LANGFLOW } from "../feature-flags";

const CustomLoader = () => {
return ENABLE_DATASTAX_LANGFLOW ? <></> : <LoadingComponent remSize={30} />;
type CustomLoaderProps = {
remSize?: number;
};

const CustomLoader = ({ remSize = 30 }: CustomLoaderProps) => {
return ENABLE_DATASTAX_LANGFLOW ? (
<></>
) : (
<LoadingComponent remSize={remSize} />
);
};

export default CustomLoader;
2 changes: 1 addition & 1 deletion src/frontend/src/pages/AdminPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export default function AdminPage() {
</div>
{isPending || isIdle ? (
<div className="flex h-full w-full items-center justify-center">
<CustomLoader />
<CustomLoader remSize={12} />
</div>
) : userList.current.length === 0 && !isIdle ? (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ export default function Page({ view }: { view?: boolean }): JSX.Element {
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
<CustomLoader />
<CustomLoader remSize={30} />
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/pages/MainPage/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function CollectionPage(): JSX.Element {
</div>
) : (
<div className="flex h-full w-full items-center justify-center">
<CustomLoader />
<CustomLoader remSize={30} />
</div>
)}
</main>
Expand Down

0 comments on commit d41b7b9

Please sign in to comment.