1
1
import * as React from 'react' ;
2
2
import * as ReactDOM from 'react-dom' ;
3
- import { observable } from 'mobx' ;
4
- import { observer } from 'mobx-react' ;
5
- import DevTools from 'mobx-react-devtools' ;
3
+ import Toolbar from './app/toolbar' ;
6
4
7
- class AppState {
8
- @observable timer = 0 ;
9
-
10
- constructor ( ) {
11
- setInterval ( ( ) => {
12
- this . timer += 1 ;
13
- } , 1000 ) ;
14
- }
15
-
16
- resetTimer ( ) {
17
- this . timer = 0 ;
18
- }
19
- }
20
-
21
- @observer
22
- class TimerView extends React . Component < { appState : AppState } , { } > {
23
- render ( ) {
24
- return null ;
25
- }
26
-
27
- onReset = ( ) => {
28
- this . props . appState . resetTimer ( ) ;
29
- }
30
- }
31
-
32
- class Toolbar extends React . Component < { } , { } > {
33
- render ( ) {
34
- return (
35
- < div className = "cy-panzoom" style = { { position : 'absolute' } } >
36
- < Pan />
37
- < Slider />
38
- </ div >
39
- ) ;
40
- }
41
- }
42
-
43
- class Slider extends React . Component < { } , { } > {
44
- render ( ) {
45
- return (
46
- < div >
47
- < div className = "cy-panzoom-reset cy-panzoom-zoom-button" > < span className = "icon fa fa-expand" /> </ div >
48
- < div className = "cy-panzoom-zoom-in cy-panzoom-zoom-button" > < span className = "icon fa fa-plus" /> </ div >
49
- < div className = "cy-panzoom-zoom-out cy-panzoom-zoom-button" > < span className = "icon fa fa-minus" /> </ div >
50
- < div className = "cy-panzoom-slider" >
51
- < div className = "cy-panzoom-slider-background" />
52
- < div className = "cy-panzoom-slider-handle" style = { { top : '32.2203px' } } > < span className = "icon fa fa-minus" />
53
- </ div >
54
- < div className = "cy-panzoom-no-zoom-tick" style = { { top : 43 } } />
55
- </ div >
56
- </ div >
57
- )
58
- }
59
- }
60
-
61
- class Pan extends React . Component < { } , { } > {
62
- render ( ) {
63
- return (
64
- < div className = "cy-panzoom-panner" >
65
- < div className = "cy-panzoom-panner-handle" />
66
- < div className = "cy-panzoom-pan-up cy-panzoom-pan-button" />
67
- < div className = "cy-panzoom-pan-down cy-panzoom-pan-button" />
68
- < div className = "cy-panzoom-pan-left cy-panzoom-pan-button" />
69
- < div className = "cy-panzoom-pan-right cy-panzoom-pan-button" />
70
- < div className = "cy-panzoom-pan-indicator" style = { { display : 'none' } } />
71
- </ div >
72
- )
73
- }
74
- }
75
-
76
-
77
- ReactDOM . render ( < Toolbar /> , document . getElementById ( 'root' ) ) ;
78
-
79
- // const appState = new AppState();
80
- // ReactDOM.render(<TimerView appState={appState}/>, document.getElementById('root'));
5
+ ReactDOM . render ( < Toolbar /> , document . getElementById ( 'root' ) ) ;
0 commit comments