-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.js
More file actions
64 lines (59 loc) · 2.07 KB
/
app.js
File metadata and controls
64 lines (59 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import Loading from '@/src/Loading';
import injectTapEventPlugin from 'react-tap-event-plugin';
import darkBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import Controls from 'zcontrol';
import validation from './validation';
import '@/app.css';
let theme = darkBaseTheme;
injectTapEventPlugin();
class App extends Component {
state = {
show: true,
name: 'line-scale-pulse-out-rapid',
color: '#5282ef',
metadata: validation
};
onChange(values, changed, metadata) {
this.setState({ ...values });
this.setState({ metadata });
}
render() {
const { show, name, color, metadata } = this.state;
return (
<div style={{ height: '100vh', width: '100vw', display: 'flex'}}>
<div style={{ width: '80%',}}>
<Loading
show={show}
width="100%"
name={name}
color={color}
/>
</div>
<div style={{ background: '#d1b8b026', width: '20%', display: 'flex', flexDirection: 'column', justifyContent: 'center' }}>
<p style={{ textAlign: 'center', paddingTop: '100px' }}>Props Controls</p>
<MuiThemeProvider muiTheme={getMuiTheme(theme)}>
<Controls
data={metadata}
editable={false}
onChange={::this.onChange}
/>
</MuiThemeProvider>
<div className="props">
<p><span className="p_label">show:</span><span>{show.toString()}</span></p>
<p><span className="p_label">name:</span><span>{name}</span></p>
<p><span className="p_label">color:</span><span>{color}</span></p>
</div>
<p className="footer">props controls pannel power by <a href="https://www.npmjs.com/package/zcontrol" target="_blank">zcontrol</a></p>
</div>
</div>
);
}
}
ReactDOM.render(
<App />,
document.querySelector('.app'),
);