native-pytech 1.0.224 → 1.0.225
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo, useMemo } from 'react';
|
|
2
|
-
import { StyleSheet, Text } from 'react-native';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import { LinearGradient } from 'expo-linear-gradient';
|
|
4
4
|
import { Ionicons } from '@expo/vector-icons';
|
|
5
5
|
import colors, { sizes } from '../../constants';
|
|
@@ -27,16 +27,21 @@ export default memo(({ text, color = 'default', type = 'small', icon, ionIconNam
|
|
|
27
27
|
{text}
|
|
28
28
|
</Text>);
|
|
29
29
|
}, [text, typeSizes]);
|
|
30
|
-
return (<
|
|
30
|
+
return (<View style={[styles.view, { height: typeSizes.diameter, borderRadius: typeSizes.diameter }]}>
|
|
31
|
+
<LinearGradient style={[styles.view, styles.gradient, { height: typeSizes.diameter, borderRadius: typeSizes.diameter }]} colors={[colors[color].light, colors[color].dark]} start={{ x: 0, y: 0 }} end={{ x: 1, y: 0 }}/>
|
|
31
32
|
{textComponent ?? (icon ?? (ionIconName && <Ionicons name={ionIconName} size={iconSize} color={'white'}/>))}
|
|
32
|
-
</
|
|
33
|
+
</View>);
|
|
33
34
|
});
|
|
34
35
|
const styles = StyleSheet.create({
|
|
35
|
-
|
|
36
|
+
view: {
|
|
36
37
|
aspectRatio: 1, // width will automatically match height
|
|
37
38
|
justifyContent: 'center',
|
|
38
39
|
alignItems: 'center'
|
|
39
40
|
},
|
|
41
|
+
gradient: {
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
transform: [{ rotate: '90deg' }],
|
|
44
|
+
},
|
|
40
45
|
text: {
|
|
41
46
|
color: 'white',
|
|
42
47
|
fontWeight: 'bold',
|