@@ -3,59 +3,37 @@ import '../css/gridblock.css';
3
3
import GridLayout from './GridLayoutComponent' ;
4
4
5
5
export default class GridBlockComponent extends Component {
6
- constructor ( props ) {
6
+
7
+ constructor ( props ) {
7
8
super ( props ) ;
8
9
}
9
- funcChild = ( val ) => {
10
+
11
+ funcChild = ( val ) => {
10
12
this . props . chng . func ( val ) ;
11
13
}
14
+
12
15
render ( ) {
13
- const st = < i className = "fa fa-chevron-right" > < /i >
14
- const ed = < i className = "fa fa-circle" > < /i >
16
+ const st = < i className = "fa fa-chevron-right" > < / i >
17
+ const ed = < i className = "fa fa-circle" > < / i >
15
18
16
19
const onMouseDown = this.props.onMouseDown;
17
20
const onMouseUp = this.props.onMouseUp;
18
21
const onMouseEnter = this.props.onMouseEnter;
19
-
20
- const clsName = this . props . iswall ? "node-wall" : '' ;
21
-
22
-
23
- // console.log("render",this.props.row," ",this.props.col," ",this.props.start);
24
- const s = ( ( this . props . row == this . props . startnode [ 0 ] ) && ( this . props . col == this . props . startnode [ 1 ] ) ) ;
25
- const e = ( ( this . props . row == this . props . endnode [ 0 ] ) && ( this . props . col == this . props . endnode [ 1 ] ) ) ;
26
-
27
- return (
28
-
29
-
30
-
31
-
32
- < div id = { `node-${ this . props . row } -${ this . props . col } ` } className = { `grid-block ${ this . props . start ?'start' :this . props . end ?'end' :'unvisited' } ${ clsName } ` }
33
-
34
- onMouseDown = { ( ) => this . props . onMouseDown ( this . props . row , this . props . col ) }
35
- onMouseEnter = { ( ) => this . props . onMouseEnter ( this . props . row , this . props . col ) }
36
- onMouseUp = { ( ) => this . props . onMouseUp ( ) }
37
-
38
- >
39
- { /* <Board id={`board-${this.props.row}-${this.props.col}`} className={`board`} row={this.props.row} col={this.props.col} grdRender={this.props.grdRender.bind(this)} funcChd={this.funcChild.bind(this)}>
40
- { this.props.unchanged && (this.props.start||this.props.end)
41
-
42
- ?
43
-
44
- <Card id={`card-${this.props.row}-${this.props.col}`} className={`card`} draggable={this.props.unchanged && (this.props.start || this.props.end) ? true: false } row={this.props.row} col={this.props.col} funcChd={this.funcChild.bind(this)}>
45
-
46
- {console.log("row"+this.props.row +" "+ this.props.col)}
47
- {console.log(this.props.unchanged)}
48
- { this.props.start ? st:'' }
49
- { this.props.end ? ed:'' }
50
-
51
- </Card>
52
- :
53
- ''
54
- }
55
- </Board> */ }
56
-
57
- </ div >
58
-
59
- )
22
+
23
+ const clsName = this.props.iswall ? "node-wall" : '';
24
+
25
+ const s = ((this.props.row == this.props.startnode[0]) && ( this . props . col == this . props . startnode [ 1 ] ) ) ;
26
+ const e = ( ( this . props . row == this . props . endnode [ 0 ] ) && ( this . props . col == this . props . endnode [ 1 ] ) ) ;
27
+
28
+ return ( <
29
+ div id = { `node-${ this . props . row } -${ this . props . col } ` }
30
+ className = { `grid-block ${ this . props . start ? 'start' : this . props . end ? 'end' : 'unvisited' } ${ clsName } ` }
31
+ onMouseDown = {
32
+ ( ) => this . props . onMouseDown ( this . props . row , this . props . col ) }
33
+ onMouseEnter = {
34
+ ( ) => this . props . onMouseEnter ( this . props . row , this . props . col ) }
35
+ onMouseUp = {
36
+ ( ) => this . props . onMouseUp ( ) } > < / div >
37
+ );
60
38
}
61
- }
39
+ }
0 commit comments