Add a fixture for the included component, to have something visible on the main page

This commit is contained in:
Dmitry S 2020-05-20 01:04:54 -04:00
parent ec182792be
commit a5fbc8fcd2
2 changed files with 35 additions and 1 deletions

34
app/client/index.ts Normal file
View File

@ -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<number>(240),
panelOpen: leftPanelOpen,
hideOpener: false,
header: testContent('LEFT HEADER'),
content: testContent('LEFT PANEL'),
},
rightPanel: {
panelWidth: observable<number>(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());

View File

@ -7,7 +7,7 @@ const path = require('path');
module.exports = { module.exports = {
target: 'web', target: 'web',
entry: { entry: {
main: "./build/app/client/ui/PagePanels.js", main: "./build/app/client/index.js",
}, },
output: { output: {
filename: "[name].bundle.js", filename: "[name].bundle.js",