@@ -36,26 +36,38 @@ export class HorizontalStroke extends React.Component<
3636 }
3737 }
3838
39+ renderVerticalStroke ( connectionType : ConnectionType , classNameSuffix : string ) : React . ReactNode {
40+ if ( connectionType ) {
41+ return (
42+ < div className = { `stroke-vertical ${ getConnectionClassName ( connectionType ) } ${ classNameSuffix } ` } >
43+ < div className = "top" />
44+ < div className = "center" />
45+ < div className = "bottom" />
46+ </ div >
47+ ) ;
48+ }
49+ return null ;
50+ }
51+
3952 render ( ) : React . ReactNode {
4053 const { className, incomingConnection, outgoingConnection, children } = this . props ;
4154 const classNameSuffix = className ? ` ${ className } ` : "" ;
4255 return (
4356 < >
44- { incomingConnection && < div className = { `stroke-vertical ${ getConnectionClassName ( incomingConnection ) } ${ classNameSuffix } ` } /> }
57+ { this . renderVerticalStroke ( incomingConnection , classNameSuffix ) }
4558 { ! children && < div className = { `stroke-horizontal${ classNameSuffix } ` } /> }
4659 { children && (
4760 < div className = { `centered-line-wrapper${ classNameSuffix } ` } >
48- < div className = "wrapper-top-label" ref = { this . topLabelRef } >
49- { children }
61+ < div className = "wrapper-top-label" >
62+ < div ref = { this . topLabelRef } > { children } </ div >
5063 </ div >
51- < div className = { `stroke-horizontal${ classNameSuffix } ` } />
5264 < div
5365 className = "wrapper-bottom-spacing"
54- style = { ( this . topLabelRef . current && { height : `${ this . state . wrapperTopHeight } px` } ) || undefined }
66+ style = { ( this . topLabelRef . current && { minHeight : `${ this . state . wrapperTopHeight } px` } ) || undefined }
5567 />
5668 </ div >
5769 ) }
58- { outgoingConnection && < div className = { `stroke-vertical ${ getConnectionClassName ( outgoingConnection ) } ${ classNameSuffix } ` } /> }
70+ { this . renderVerticalStroke ( outgoingConnection , classNameSuffix ) }
5971 </ >
6072 ) ;
6173 }
0 commit comments