Skip to content

Commit

Permalink
[web] Remove layout slot no longer needed
Browse files Browse the repository at this point in the history
At #781, the Sidebar was created
directly from the Layout by using a slot for teleporting its content
from outside. That was needed because the Layout was moved to a
provider. Later, #796 restored the
previous behavior of mounting both, the Sidebar and the Layout, from
src/App.jsx instead of having "content components" in the providers,
which was  weird if not wrong.

However, the slot created for the Sidebar content was not removed and it
was creating an empty div node between the sidebar and the main content.
Although it wasn't producing any visible side effect in the UI, it has
been removed since it is actually no longer needed.
  • Loading branch information
dgdavid committed Oct 20, 2023
1 parent fa7037f commit 3a0d2f8
Showing 1 changed file with 26 additions and 33 deletions.
59 changes: 26 additions & 33 deletions web/src/components/layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const HeaderActions = createTeleporter();
const HeaderIcon = createTeleporter();
const FooterActions = createTeleporter();
const FooterInfoArea = createTeleporter();
const Sidebar = createTeleporter();

/**
*
Expand Down Expand Up @@ -65,35 +64,32 @@ const Sidebar = createTeleporter();
*/
function Layout({ children }) {
return (
<>
<Sidebar.Target as="div" />
<div id="agama-main-wrapper" className="wrapper shadow">
<header className="split justify-between bottom-shadow">
<h1 className="split">
<HeaderIcon.Target as="span" />
<PageTitle.Target as="span" />
</h1>

<div className="split">
<PageActions.Target as="div" />
<HeaderActions.Target as="div" />
</div>

</header>

<main className="stack">
{children}
</main>

<footer className="split justify-between top-shadow" data-state="reversed">
<FooterActions.Target
role="navigation"
aria-label="Installer Actions"
/>
<img src={logoUrl} alt="Logo of SUSE" />
</footer>
</div>
</>
<div id="agama-main-wrapper" className="wrapper shadow">
<header className="split justify-between bottom-shadow">
<h1 className="split">
<HeaderIcon.Target as="span" />
<PageTitle.Target as="span" />
</h1>

<div className="split">
<PageActions.Target as="div" />
<HeaderActions.Target as="div" />
</div>

</header>

<main className="stack">
{children}
</main>

<footer className="split justify-between top-shadow" data-state="reversed">
<FooterActions.Target
role="navigation"
aria-label="Installer Actions"
/>
<img src={logoUrl} alt="Logo of SUSE" />
</footer>
</div>
);
}

Expand Down Expand Up @@ -171,8 +167,6 @@ const MainActions = FooterActions.Source;
*/
const AdditionalInfo = FooterInfoArea.Source;

const SidebarArea = Sidebar.Source;

export {
Layout as default,
Title,
Expand All @@ -181,5 +175,4 @@ export {
PageOptions,
MainActions,
AdditionalInfo,
SidebarArea
};

0 comments on commit 3a0d2f8

Please sign in to comment.