@popp0102/nova 0.6.1 → 0.6.3
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.
- package/lib/components/Badge.js +11 -2
- package/lib/components/Title.js +1 -0
- package/package.json +1 -1
package/lib/components/Badge.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { View, Text, StyleSheet } from 'react-native';
|
|
2
2
|
import { MaterialIcons } from '@expo/vector-icons';
|
|
3
3
|
|
|
4
|
+
const SIZES = {
|
|
5
|
+
small: 12,
|
|
6
|
+
medium: 14,
|
|
7
|
+
large: 16,
|
|
8
|
+
};
|
|
9
|
+
|
|
4
10
|
export default function Badge({
|
|
5
11
|
children,
|
|
6
12
|
leftIcon,
|
|
@@ -8,13 +14,16 @@ export default function Badge({
|
|
|
8
14
|
iconSize = 20,
|
|
9
15
|
color = 'white',
|
|
10
16
|
backgroundColor = 'blue',
|
|
17
|
+
size = 'large',
|
|
11
18
|
style
|
|
12
19
|
}) {
|
|
20
|
+
const fontSize = SIZES[size] || SIZES.large;
|
|
21
|
+
|
|
13
22
|
return (
|
|
14
23
|
<View style={style}>
|
|
15
24
|
<View style={[styles.container, { backgroundColor }]}>
|
|
16
25
|
{leftIcon && <MaterialIcons name={leftIcon} size={iconSize} color={color} />}
|
|
17
|
-
<Text style={[styles.text, { color }]}>{children}</Text>
|
|
26
|
+
<Text style={[styles.text, { color, fontSize }]}>{children}</Text>
|
|
18
27
|
{rightIcon && <MaterialIcons name={rightIcon} size={iconSize} color={color} />}
|
|
19
28
|
</View>
|
|
20
29
|
</View>
|
|
@@ -31,6 +40,6 @@ const styles = StyleSheet.create({
|
|
|
31
40
|
alignSelf: "flex-start",
|
|
32
41
|
},
|
|
33
42
|
text: {
|
|
34
|
-
|
|
43
|
+
fontWeight: '600',
|
|
35
44
|
},
|
|
36
45
|
});
|
package/lib/components/Title.js
CHANGED