Skip to content

Commit d3da25e

Browse files
Add UI lib
1 parent 4e35f08 commit d3da25e

7 files changed

Lines changed: 4246 additions & 17 deletions

File tree

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@
1010
"start:server": "nodemon --inspect ./src/server/index.js"
1111
},
1212
"dependencies": {
13+
"antd": "^3.5.0",
1314
"babel-core": "^6.26.3",
1415
"babel-generator": "^6.26.1",
1516
"babel-loader": "^7.1.4",
17+
"babel-plugin-import": "^1.7.0",
1618
"babel-plugin-transform-react-jsx": "^6.24.1",
1719
"babel-traverse": "^6.26.0",
1820
"babylon": "^6.18.0",
21+
"css-loader": "^0.28.11",
1922
"d3-flextree": "^2.1.1",
2023
"directory-tree": "^2.1.0",
2124
"react": "^16.3.2",
2225
"react-dom": "^16.3.2",
26+
"style-loader": "^0.21.0",
2327
"svg.js": "^2.6.4",
2428
"webpack": "^4.6.0",
2529
"websocket": "^1.0.26"

src/public/bundle.js

Lines changed: 2965 additions & 0 deletions
Large diffs are not rendered by default.

src/public/bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/public/js/App.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import devProcessTesting from './utils/dev-test';
33
import { createConnection } from './connection';
4+
import ViewsSwitchList from './components/controls/ViewsSwitchList';
45
import SourceTree from './components/tree-diagram/SourceTree';
56

67
class App extends React.Component {
@@ -23,6 +24,9 @@ class App extends React.Component {
2324
render() {
2425
return (
2526
<div>
27+
<div>
28+
<ViewsSwitchList />
29+
</div>
2630
<SourceTree treeData={this.state.sourceTreeData} />
2731
</div>
2832
);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import { Switch, Row, Col } from 'antd';
3+
4+
class ViewsSwitchList extends React.Component {
5+
onChange = checked => {
6+
console.log(`switch to ${checked}`);
7+
};
8+
9+
render() {
10+
return (
11+
<Row>
12+
<Col span={6}>
13+
<h3>module dependencies</h3>
14+
</Col>
15+
<Col span={6}>
16+
<Switch defaultChecked onChange={this.onChange} />
17+
</Col>
18+
</Row>
19+
);
20+
}
21+
}
22+
23+
export default ViewsSwitchList;

src/public/webpack.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,15 @@ const config = {
2424
exclude: /(node_modules)/,
2525
query: {
2626
presets: ['es2015', 'stage-2'],
27-
plugins: ['transform-react-jsx']
27+
plugins: [
28+
'transform-react-jsx',
29+
["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }]
30+
]
2831
}
32+
},
33+
{
34+
test: /\.css$/,
35+
use: [ 'style-loader', 'css-loader' ]
2936
}
3037
]
3138
},

0 commit comments

Comments
 (0)