2026-03-07 13:20:43 -06:00

49 lines
1.5 KiB
JavaScript

(function () {
const RegistryApp = (window.RegistryApp = window.RegistryApp || {});
const { h } = RegistryApp.runtime;
const store = RegistryApp.store;
RegistryApp.components = RegistryApp.components || {};
RegistryApp.components.App = function App() {
const Navbar = RegistryApp.componentFns.Navbar;
const Header = RegistryApp.componentFns.Header;
const HomeView = RegistryApp.componentFns.HomeView;
const LoginForm = RegistryApp.componentFns.LoginForm;
const CreateOrgForm = RegistryApp.componentFns.CreateOrgForm;
const Footer = RegistryApp.componentFns.Footer;
const PortalApp =
window.OrgPortal && window.OrgPortal.components
? window.OrgPortal.components.App
: null;
const view = store.getView();
if (view === "portal" && PortalApp) {
return h("div", null, Navbar(), PortalApp());
}
let mainContent;
if (view === "home") {
mainContent = HomeView();
} else if (view === "login") {
mainContent = LoginForm();
} else if (view === "create") {
mainContent = CreateOrgForm();
}
return h(
"main",
null,
Navbar(),
h(
"div",
{ className: "container" },
Header({ title: "Global Organization Network" }),
mainContent,
),
Footer(),
);
};
})();