@@ -17,41 +17,39 @@ interface CloudProps extends ViewProps {
1717 borderRadius ?: number ;
1818}
1919
20- export default class Cloud extends React . Component < CloudProps > {
21- render ( ) {
22- const { title, isDown, isStart, triangle, backgroundColor, borderRadius } = this . props ;
23- const style : ViewStyle = {
24- flexDirection : isDown ? 'column-reverse' : 'column' ,
25- alignItems : isStart ,
26- } ;
27- const TextContainerStyle : ViewStyle = {
28- position : triangle ? 'absolute' : 'relative' ,
29- marginVertical : triangle ? 10 : 0 ,
30- backgroundColor,
31- borderRadius,
32- paddingHorizontal : 10 ,
33- paddingVertical : 10 ,
34- } ;
35- return (
36- < View style = { [ style ] } >
37- < View
38- style = { [
39- styles . cloudFoot ,
40- {
41- transform : [ { rotateX : isDown ? '180deg' : '0deg' } ] ,
42- position : triangle ? 'absolute' : 'relative' ,
43- left : triangle ,
44- zIndex : 9999 ,
45- borderBottomColor : backgroundColor ,
46- } ,
47- ] }
48- />
49- < View testID = "RNE__Tooltip__cloud__view" style = { [ { ...TextContainerStyle } ] } >
50- < Text style = { [ styles . cloudText ] } > { title } </ Text >
51- </ View >
20+ export default function Cloud ( props : CloudProps ) {
21+ const { title, isDown, isStart, triangle, backgroundColor, borderRadius } = props ;
22+ const style : ViewStyle = {
23+ flexDirection : isDown ? 'column-reverse' : 'column' ,
24+ alignItems : isStart ,
25+ } ;
26+ const TextContainerStyle : ViewStyle = {
27+ position : triangle ? 'absolute' : 'relative' ,
28+ marginVertical : triangle ? 10 : 0 ,
29+ backgroundColor,
30+ borderRadius,
31+ paddingHorizontal : 10 ,
32+ paddingVertical : 10 ,
33+ } ;
34+ return (
35+ < View style = { [ style ] } >
36+ < View
37+ style = { [
38+ styles . cloudFoot ,
39+ {
40+ transform : [ { rotateX : isDown ? '180deg' : '0deg' } ] ,
41+ position : triangle ? 'absolute' : 'relative' ,
42+ left : triangle ,
43+ zIndex : 9999 ,
44+ borderBottomColor : backgroundColor ,
45+ } ,
46+ ] }
47+ />
48+ < View testID = "RNE__Tooltip__cloud__view" style = { [ { ...TextContainerStyle } ] } >
49+ < Text style = { [ styles . cloudText ] } > { title } </ Text >
5250 </ View >
53- ) ;
54- }
51+ </ View >
52+ ) ;
5553}
5654
5755const styles = StyleSheet . create ( {
0 commit comments