forked from TamimEhsan/AlgorithmVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrect.jsx
More file actions
31 lines (28 loc) · 743 Bytes
/
rect.jsx
File metadata and controls
31 lines (28 loc) · 743 Bytes
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
import React, {Component} from 'react';
import './style.css';
class Rect extends Component {
render() {
return (
<div
className='rect'
style={{height:this.props.rect.width,
background:this.checkColor(),
margin:this.props.marg,
// float:'left',
'vertical-align': 'middle'
}}
>
</div>
);
}
checkColor = () => {
if( this.props.rect.isSorted ){
return "green";
} else if( this.props.rect.isSorting ){
return "red";
} else{
return "black"
}
}
}
export default Rect;