Skip to content

Commit

Permalink
refactor(web) migrate Loading component to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
dgdavid committed Dec 10, 2024
1 parent 7cbed6d commit ccc3e34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web/src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Header, { HeaderProps } from "~/components/layout/Header";
import { Loading, Sidebar } from "~/components/layout";
import { IssuesDrawer } from "~/components/core";

type LayoutProps = React.PropsWithChildren<{
export type LayoutProps = React.PropsWithChildren<{
mountHeader?: boolean;
mountSidebar?: boolean;
headerOptions?: HeaderProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jest.mock("~/components/layout/Layout", () => {

return {
...layout,
Plain: (props) => (
Plain: ({ ...props }) => (
<>
<div>PlainLayout Mock</div>
<OriginalPlainLayout {...props} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@
import React from "react";
import { EmptyState, EmptyStateIcon, EmptyStateHeader, Spinner } from "@patternfly/react-core";
import { Center, PlainLayout } from "~/components/layout";
import { LayoutProps } from "~/components/layout/Layout";
import { _ } from "~/i18n";

const LoadingIcon = () => <Spinner size="xl" />;
const Layout = (props) => <PlainLayout mountHeader={false} mountSidebar={false} {...props} />;
const Layout = (props: LayoutProps) => (
<PlainLayout mountHeader={false} mountSidebar={false} {...props} />
);

function Loading({
text = _("Loading installation environment, please wait."),
Expand Down

0 comments on commit ccc3e34

Please sign in to comment.