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