@@ -36,6 +36,7 @@ import {
36
36
heightCalculator ,
37
37
widthCalculator ,
38
38
marginCalculator ,
39
+ TimeLineStyleType ,
39
40
} from "comps/controls/styleControlConstants" ;
40
41
import { stateComp , valueComp } from "comps/generators/simpleGenerators" ;
41
42
import {
@@ -47,6 +48,24 @@ import { timelineDate, timelineNode, TimelineDataTooltip } from "./timelineConst
47
48
import { convertTimeLineData } from "./timelineUtils" ;
48
49
import { default as Timeline } from "antd/es/timeline" ;
49
50
import { EditorContext } from "comps/editorState" ;
51
+ import { styled } from "styled-components" ;
52
+
53
+ const TimelineWrapper = styled . div < {
54
+ $style : TimeLineStyleType
55
+ } > `
56
+ ${ props => `margin: ${ props . $style . margin ?? '3px' } ` } ;
57
+ ${ props => `padding: ${ props . $style . padding !== '3px' ? props . $style . padding : '20px 10px 0px 10px' } ` } ;
58
+ ${ props => `width: ${ widthCalculator ( props . $style . margin ?? '3px' ) } ` } ;
59
+ ${ props => `height: ${ heightCalculator ( props . $style . margin ?? '3px' ) } ` } ;
60
+ ${ props => `background: ${ props . $style . background } ` } ;
61
+ ${ props => `border-radius: ${ props . $style . radius } ` } ;
62
+ overflow: auto;
63
+ overflow-x: hidden;
64
+
65
+ .ant-timeline .ant-timeline-item-head {
66
+ background-color: transparent;
67
+ }
68
+ ` ;
50
69
51
70
const EventOptions = [
52
71
clickEvent ,
@@ -139,18 +158,7 @@ const TimelineComp = (
139
158
140
159
return (
141
160
< ScrollBar hideScrollbar = { ! props . verticalScrollbar } >
142
- < div
143
- style = { {
144
- margin : style . margin ?? '3px' ,
145
- padding : style . padding !== '3px' ? style . padding : '20px 10px 0px 10px' ,
146
- width : widthCalculator ( style . margin ?? '3px' ) ,
147
- height : heightCalculator ( style . margin ?? '3px' ) ,
148
- background : style . background ,
149
- overflow : "auto" ,
150
- overflowX : "hidden" ,
151
- borderRadius : style . radius ,
152
- } }
153
- >
161
+ < TimelineWrapper $style = { style } >
154
162
< Timeline
155
163
mode = { props ?. mode || "left" }
156
164
reverse = { props ?. reverse }
@@ -163,7 +171,7 @@ const TimelineComp = (
163
171
}
164
172
items = { timelineItems }
165
173
/>
166
- </ div >
174
+ </ TimelineWrapper >
167
175
</ ScrollBar >
168
176
) ;
169
177
} ;
0 commit comments