mirror of
				https://github.com/gristlabs/grist-core.git
				synced 2025-06-13 20:53:59 +00:00 
			
		
		
		
	Add a fixture for the included component, to have something visible on the main page
This commit is contained in:
		
							parent
							
								
									ec182792be
								
							
						
					
					
						commit
						a5fbc8fcd2
					
				
							
								
								
									
										34
									
								
								app/client/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								app/client/index.ts
									
									
									
									
									
										Normal 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()); | ||||
| @ -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", | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user