Skip to content

Commit 068d8b2

Browse files
committed
feat: [:art:] change from return react element return react fc & remove IPropEmptyDot
1 parent 1b03ac7 commit 068d8b2

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

src/component/EmptyDot.tsx

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@
33
* Created by rouge on 11/09/2019.
44
*/
55
import React from 'react';
6-
import { View } from 'react-native';
7-
import { IPropEmptyDot } from './types/Dot';
6+
import { StyleSheet, View } from 'react-native';
87

98
export const defaultEmptyDotSize = 3;
109

11-
const EmptyDot = (
12-
props: IPropEmptyDot
13-
): React.FunctionComponentElement<IPropEmptyDot> => {
10+
const EmptyDot: React.FC<{
11+
sizeRatio: number;
12+
}> = (props) => {
1413
return (
1514
<View
16-
style={{
17-
backgroundColor: 'white',
18-
opacity: 0.0,
19-
width: defaultEmptyDotSize * props.sizeRatio,
20-
height: defaultEmptyDotSize * props.sizeRatio,
21-
margin: defaultEmptyDotSize * props.sizeRatio,
22-
}}
15+
style={[
16+
styles.base,
17+
{
18+
width: defaultEmptyDotSize * props.sizeRatio,
19+
height: defaultEmptyDotSize * props.sizeRatio,
20+
margin: defaultEmptyDotSize * props.sizeRatio,
21+
},
22+
]}
2323
/>
2424
);
2525
};
2626

27+
const styles = StyleSheet.create({
28+
base: {
29+
backgroundColor: 'white',
30+
opacity: 0.0,
31+
},
32+
});
33+
2734
export default EmptyDot;

0 commit comments

Comments
 (0)