diff --git a/app/client/index.ts b/app/client/index.ts new file mode 100644 index 00000000..8dfca7e3 --- /dev/null +++ b/app/client/index.ts @@ -0,0 +1,34 @@ +import {PageContents, pagePanels} from 'app/client/ui/PagePanels'; +import {cssRootVars} from 'app/client/ui2018/cssVars'; +import {dom, observable, styled} from "grainjs"; + +function renderPage(): Element { + const leftPanelOpen = observable(true); + const page: PageContents = { + leftPanel: { + panelWidth: observable(240), + panelOpen: leftPanelOpen, + hideOpener: false, + header: testContent('LEFT HEADER'), + content: testContent('LEFT PANEL'), + }, + rightPanel: { + panelWidth: observable(240), + panelOpen: observable(true), + header: testContent('RIGHT HEADER'), + content: testContent('RIGHT PANEL'), + }, + headerMain: testContent('Header'), + contentMain: testContent('Welcome to a tiny bit of Grist'), + }; + return pagePanels(page); +} + +const testContent = styled('div', ` + padding: 5px; + text-align: center; + flex: 1 1 0px; +`); + +// Load icons.css, wait for it to load, then build the page. +dom.update(document.body, dom.cls(cssRootVars), renderPage()); diff --git a/buildtools/webpack.config.js b/buildtools/webpack.config.js index 6155515b..6f2eace6 100644 --- a/buildtools/webpack.config.js +++ b/buildtools/webpack.config.js @@ -7,7 +7,7 @@ const path = require('path'); module.exports = { target: 'web', entry: { - main: "./build/app/client/ui/PagePanels.js", + main: "./build/app/client/index.js", }, output: { filename: "[name].bundle.js",