11import React from 'react' ;
22
3- const controlStyles = { fontSize : 10 } ;
4-
5- type Props = {
6- orientation : string ;
7- linkType : string ;
8- stepPercent : number ;
9- setOrientation : ( orientation : string ) => void ;
10- setLinkType : ( linkType : string ) => void ;
11- setStepPercent : ( percent : number ) => void ;
12- } ;
13-
14- export default function LinkControls ( {
3+ const AxLinkControls = ( {
154 orientation,
165 linkType,
176 stepPercent,
187 setOrientation,
198 setLinkType,
209 setStepPercent,
21- } : Props ) {
10+ } ) => {
2211 return (
23- < div style = { controlStyles } >
24-
25- < label > orientation:</ label >
26- < select
27- onClick = { ( e ) => e . stopPropagation ( ) }
28- onChange = { ( e ) => setOrientation ( e . target . value ) }
29- value = { orientation }
30- >
31- < option value = 'vertical' > vertical</ option >
32- < option value = 'horizontal' > horizontal</ option >
33- </ select >
34-
35- < label > link:</ label >
36- < select
37- onClick = { ( e ) => e . stopPropagation ( ) }
38- onChange = { ( e ) => setLinkType ( e . target . value ) }
39- value = { linkType }
40- >
41- < option value = 'diagonal' > diagonal</ option >
42- < option value = 'step' > step</ option >
43- < option value = 'curve' > curve</ option >
44- < option value = 'line' > line</ option >
45- </ select >
12+ < div className = 'link-controls' >
13+ < div className = 'control-group' >
14+ < label className = 'control-label' > Orientation:</ label >
15+ < select
16+ className = 'control-select'
17+ onClick = { ( e ) => e . stopPropagation ( ) }
18+ onChange = { ( e ) => setOrientation ( e . target . value ) }
19+ value = { orientation }
20+ >
21+ < option value = 'vertical' > vertical</ option >
22+ < option value = 'horizontal' > horizontal</ option >
23+ </ select >
24+ </ div >
25+
26+ < div className = 'control-group' >
27+ < label className = 'control-label' > Link:</ label >
28+ < select
29+ className = 'control-select'
30+ onClick = { ( e ) => e . stopPropagation ( ) }
31+ onChange = { ( e ) => setLinkType ( e . target . value ) }
32+ value = { linkType }
33+ >
34+ < option value = 'diagonal' > diagonal</ option >
35+ < option value = 'step' > step</ option >
36+ < option value = 'curve' > curve</ option >
37+ < option value = 'line' > line</ option >
38+ </ select >
39+ </ div >
40+
4641 { linkType === 'step' && (
47- < >
48-
49- < label > step:</ label >
42+ < div className = 'control-group' >
43+ < label className = 'control-label' > step:</ label >
5044 < input
5145 onClick = { ( e ) => e . stopPropagation ( ) }
5246 type = 'range'
@@ -56,9 +50,12 @@ export default function LinkControls({
5650 onChange = { ( e ) => setStepPercent ( Number ( e . target . value ) ) }
5751 value = { stepPercent }
5852 disabled = { linkType !== 'step' }
53+ className = 'control-range'
5954 />
60- </ >
55+ </ div >
6156 ) }
6257 </ div >
6358 ) ;
64- }
59+ } ;
60+
61+ export default AxLinkControls ;
0 commit comments