Skip to content

Commit

Permalink
#5 - The App component is now the main entry point and renders to the…
Browse files Browse the repository at this point in the history
… page
  • Loading branch information
murt committed Apr 26, 2017
1 parent 763d7dd commit 7841027
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
13 changes: 5 additions & 8 deletions src/main/pug/index.pug
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@ html(lang="en")
title mop
link(rel="stylesheet", type="text/css", href="style.css")
body
nav.nav.has-shadow
div.nav-left
a#mop-logo.nav-item MOP

div.container.is-fluid
div.notification
| This is the main mop container
div#content

script(type="text/javascript").
require('./app.js');
const React = require('react');
const reactDOM = require('react-dom');
const { App } = require('./app.js');
reactDOM.render(React.createElement(App), document.getElementById('content'));
15 changes: 13 additions & 2 deletions src/main/ts/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ import * as React from 'react';

interface AppProps {}

export default class App extends React.Component<AppProps, {}> {
export class App extends React.Component<AppProps, {}> {

render () {
return (
<span>Application Code</span>
<div>
<nav className="nav has-shadow">
<div className="nav-left">
<a id="mop-logo" className="nav-item">MOP</a>
</div>
</nav>
<div className="container is-fluid">
<div className="notification">
This is the main mop container created by react
</div>
</div>
</div>
);
}

Expand Down
6 changes: 2 additions & 4 deletions src/main/ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ function createWindow ({width=800, height=600}:{width?:number, height?:number}={
}));

if (true) {
//require('devtron').install();
// TODO: Get details of windows in the specs and check if ANY of them have coverage
// otherwise the dev tools window will be counted
//win.webContents.openDevTools();
require('devtron').install();
win.webContents.openDevTools();
}

win.on('closed', () => {
Expand Down

0 comments on commit 7841027

Please sign in to comment.