-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommandView.js
More file actions
22 lines (20 loc) · 895 Bytes
/
Copy pathcommandView.js
File metadata and controls
22 lines (20 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import React from 'react';
function CommandView(props){
return(
<div key={props.id} style={{top: props.top, position: 'absolute'}} onDragOver={(e)=>props.onDragOver(e)} onDragStart={(e)=>props.onDragStart(e, props.id)}>
<div className={props.name == "If" || props.name == "Repeat" ? "command-select" : "command"}
draggable
style = {{backgroundColor: props.setBgColor(props.category), borderColor: props.setBrColor(props.category)}}>
<span id="label">{props.name}</span>
{props.select.length > 0 &&
<select id="select">
{props.select.map((x,y) =>
<option key={y} value={x}>{x}</option>
)}
</select>
}
</div>
</div>
);
}
export default CommandView;