Skip to content

Commit 5a5d365

Browse files
committed
typescript update to app graphContainer and sidebarContainer
1 parent eac7709 commit 5a5d365

File tree

7 files changed

+79
-72
lines changed

7 files changed

+79
-72
lines changed

package-lock.json

Lines changed: 22 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
import React, { Component } from "react";
1+
import * as React from "react";
22
import "../../../assets/style/App.scss";
3-
import { ContentsContainer } from "./ContentsContainer.tsx";
4-
import SidebarContainer from "./SidebarContainer.jsx";
3+
import { ContentsContainer } from "./ContentsContainer";
4+
import { SidebarContainer } from "./SidebarContainer";
55
import UpdatePopUpContainer from "./UpdatePopUpContainer.jsx";
66
import historyController from "../../controllers/historyController";
77
import collectionsController from "../../controllers/collectionsController";
88
// import ReqResCtrl from '../../controllers/reqResController';
99

10-
const { api } = window;
10+
//const { api } = window;
11+
declare global {
12+
interface Window {
13+
api: any;
14+
}
15+
}
16+
17+
let api = window.api;
1118
// const EventEmitter = require('events');
1219
// const {dialog} = require('electron').remote
13-
class App extends Component {
14-
constructor(props) {
20+
export class App extends React.Component<any, any> {
21+
constructor(props: any) {
1522
super(props);
1623
}
1724

@@ -30,7 +37,7 @@ class App extends Component {
3037
// window on error fires for any error in program, opens a dialog allowing
3138
// user to continue or refresh.
3239
// refresh sends to ipcMain
33-
let errorCount = 0;
40+
let errorCount: number = 0;
3441
// window.onerror = (error, url, line) => {
3542
// // implement an error counter and a check for odd numbered errors due to
3643
// // behavior of react cross origin error in electron. This attempts to ignore
@@ -51,7 +58,7 @@ class App extends Component {
5158
}
5259

5360
render() {
54-
api.receive("fromMain", (data) => console.log(data));
61+
api.receive("fromMain", (data: {}) => console.log(data));
5562
api.send("toMain", "MEAT WITH SAUCE");
5663
return (
5764
<div id="app">
@@ -63,4 +70,4 @@ class App extends Component {
6370
}
6471
}
6572

66-
export default App;
73+
//export default App;

src/client/components/containers/GraphContainer.jsx

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import * as React from "react";
2+
import Graph from "../display/Graph.jsx";
3+
4+
export class GraphContainer extends React.Component<any, any> {
5+
constructor(props: any) {
6+
super(props);
7+
}
8+
9+
render() {
10+
return (
11+
<div>
12+
<Graph />
13+
</div>
14+
);
15+
}
16+
}
17+
18+
//export default GraphContainer;

src/client/components/containers/SidebarContainer.jsx

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as React from "react";
2+
import ComposerContainer from "../composer/ComposerContainer.jsx";
3+
import HistoryContainer from "./HistoryContainer.jsx";
4+
import CollectionsContainer from "./CollectionsContainer.jsx";
5+
6+
export class SidebarContainer extends React.Component<any, any> {
7+
constructor(props: any) {
8+
super(props);
9+
}
10+
11+
render() {
12+
return (
13+
<div className="sidebar_composer-console">
14+
<ComposerContainer />
15+
<CollectionsContainer />
16+
<HistoryContainer />
17+
</div>
18+
);
19+
}
20+
}
21+
22+
//export default SidebarContainer;

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { render } from "react-dom";
33
import { Provider } from "react-redux";
4-
import App from "./client/components/containers/App.jsx";
4+
import { App } from "./client/components/containers/App";
55
import store from "./client/store";
66
//import ReactModal from "react-modal";
77

0 commit comments

Comments
 (0)