File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed
client/packages/lowcoder/src/comps/comps Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import { CompTypeContext } from "../utils/compTypeContext";
28
28
import { changeChildAction } from "lowcoder-core" ;
29
29
import { setInitialCompStyles } from "../utils/themeUtil" ;
30
30
import { BoolControl } from "../controls/boolControl" ;
31
+ import { useMergeCompStyles } from "@lowcoder-ee/util/hooks" ;
31
32
32
33
const getStyle = ( style : TextStyleType ) => {
33
34
return css `
@@ -142,27 +143,14 @@ let TextTmpComp = (function () {
142
143
animationStyle : styleControl ( AnimationStyle , 'animationStyle' ) ,
143
144
margin : MarginControl ,
144
145
padding : PaddingControl ,
145
- themeApplied : BoolControl ,
146
146
} ;
147
147
return new UICompBuilder ( childrenMap , ( props , dispatch ) => {
148
148
const value = props . text . value ;
149
- const theme = useContext ( ThemeContext ) ;
150
- const compType = useContext ( CompTypeContext ) ;
151
- const compTheme = theme ?. theme ?. components ?. [ compType ] ;
152
-
153
- const styleProps : Record < string , any > = { } ;
154
- [ 'style' , 'animationStyle' ] . forEach ( ( key : string ) => {
155
- styleProps [ key ] = ( props as any ) [ key ] ;
156
- } ) ;
157
149
158
- useEffect ( ( ) => {
159
- if ( props . themeApplied ) return ;
160
- setInitialCompStyles ( {
161
- dispatch,
162
- compTheme,
163
- styleProps,
164
- } ) ;
165
- } , [ ] ) ;
150
+ useMergeCompStyles (
151
+ props as Record < string , any > ,
152
+ dispatch
153
+ ) ;
166
154
167
155
return (
168
156
< TextContainer
You can’t perform that action at this time.
0 commit comments