Skip to content

Commit

Permalink
[web] Stop mounting Sidebar from the Layout component
Browse files Browse the repository at this point in the history
Mount it from App instead.
  • Loading branch information
dgdavid committed Apr 25, 2023
1 parent 0801870 commit 6c00c8c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
13 changes: 8 additions & 5 deletions web/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { STARTUP, INSTALL } from "~/client/phase";
import { BUSY } from "~/client/status";

import { Layout, Title, DBusError } from "~/components/layout";
import { Installation, LoadingEnvironment } from "~/components/core";
import { Installation, LoadingEnvironment, Sidebar } from "~/components/core";

function App() {
const client = useInstallerClient();
Expand Down Expand Up @@ -71,10 +71,13 @@ function App() {
};

return (
<Layout>
<Title>Agama</Title>
<Content />
</Layout>
<>
<Sidebar />
<Layout>
<Title>Agama</Title>
<Content />
</Layout>
</>
);
}

Expand Down
1 change: 1 addition & 0 deletions web/src/App.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jest.mock("~/components/layout/DBusError", () => mockComponent("D-BusError Mock"
jest.mock("~/components/core/LoadingEnvironment", () => mockComponent("LoadingEnvironment Mock"));
jest.mock("~/components/questions/Questions", () => mockComponent("Questions Mock"));
jest.mock("~/components/core/Installation", () => mockComponent("Installation Mock"));
jest.mock("~/components/core/Sidebar", () => mockComponent("Sidebar Mock"));

// this object holds the mocked callbacks
const callbacks = {};
Expand Down
2 changes: 0 additions & 2 deletions web/src/components/layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import React from "react";

import logoUrl from "~/assets/suse-horizontal-logo.svg";
import { createTeleporter } from "react-teleporter";
import { Sidebar } from "~/components/core";

const PageTitle = createTeleporter();
const PageActions = createTeleporter();
Expand Down Expand Up @@ -83,7 +82,6 @@ function Layout({ children }) {

</header>

<Sidebar />
<main className="stack">
{children}
</main>
Expand Down

0 comments on commit 6c00c8c

Please sign in to comment.