Skip to content

Commit

Permalink
feat: bare bones poc layout demo on page FUI-1814
Browse files Browse the repository at this point in the history
  • Loading branch information
matteematt committed Feb 14, 2024
1 parent daf44ec commit e3278ce
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/04_web/10_dynamic-layout/10_foundation-layout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ tags:
- golden layout
---

import Highlight from './layout-example.js';

<Highlight color="#25c2a0">Docusaurus green</Highlight>

# Genesis Foundation UI App Layout

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
Expand Down
47 changes: 47 additions & 0 deletions docs/04_web/10_dynamic-layout/layout-example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import React from "react";

function loadFuiFallback() {
return import(
/* webpackMode: "lazy" */
"@genesislcap/foundation-ui"
);
}

function loadFoundationLayoutFallback() {
return import(
/* webpackMode: "lazy" */
"@genesislcap/foundation-layout"
);
}

async function loadRemotes(options) {
const { registerFoundationDesignSystem } = await loadFuiFallback();

const { foundationLayoutComponents } = await loadFoundationLayoutFallback();

return {
FoundationDesignSystem: registerFoundationDesignSystem().register(
foundationLayoutComponents,
),
};
}

loadRemotes({});

/**
* Ensure tree shaking doesn't remove these
* Perhaps we keep these MFs style free, ie. they need to get wrapped to have style applied. Keeping it simple for now.
*/
export { LoadRemotesOptions, loadRemotes };

export default function Highlight({ children, color }) {
return (
<div style={{ width: "500px", height: "500px" }}>
<foundation-layout>
<foundation-layout-item title="test">
<p>Test Item</p>
</foundation-layout-item>
</foundation-layout>
</div>
);
}

0 comments on commit e3278ce

Please sign in to comment.