@popp0102/nova 0.1.2 → 0.2.0
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 +29 -0
- package/lib/components/Modal.js +1 -6
- package/lib/index.js +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
2
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
3
|
+
|
|
4
|
+
export default function Badge({ children, style }) {
|
|
5
|
+
return (
|
|
6
|
+
<View style={style}>
|
|
7
|
+
<View style={styles.container}>
|
|
8
|
+
<Ionicons name="checkmark-circle" color="white" size={20} />
|
|
9
|
+
<Text style={styles.text}>{children}</Text>
|
|
10
|
+
</View>
|
|
11
|
+
</View>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
container: {
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
gap: 4,
|
|
20
|
+
padding: 8,
|
|
21
|
+
borderRadius: 24,
|
|
22
|
+
backgroundColor: "blue",
|
|
23
|
+
alignSelf: "flex-start",
|
|
24
|
+
},
|
|
25
|
+
text: {
|
|
26
|
+
color: "white",
|
|
27
|
+
fontSize: 16,
|
|
28
|
+
},
|
|
29
|
+
});
|
package/lib/components/Modal.js
CHANGED
|
@@ -4,11 +4,6 @@ import { SafeAreaView } from "react-native-safe-area-context";
|
|
|
4
4
|
import Button from "./Button";
|
|
5
5
|
|
|
6
6
|
export default function Modal({ visible, title, onConfirm, onClose, children, includeFooter = true }) {
|
|
7
|
-
function handleOnConfirm() {
|
|
8
|
-
onConfirm();
|
|
9
|
-
onClose();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
7
|
return (
|
|
13
8
|
<RNModal visible={visible} transparent={true} onRequestClose={onClose}>
|
|
14
9
|
<SafeAreaView style={styles.backdrop}>
|
|
@@ -22,7 +17,7 @@ export default function Modal({ visible, title, onConfirm, onClose, children, in
|
|
|
22
17
|
{ includeFooter &&
|
|
23
18
|
<View style={styles.footer}>
|
|
24
19
|
<Button style={styles.button} onPress={onClose} type="secondary">Cancel</Button>
|
|
25
|
-
<Button style={styles.button} onPress={
|
|
20
|
+
<Button style={styles.button} onPress={onConfirm}>Ok</Button>
|
|
26
21
|
</View>
|
|
27
22
|
}
|
|
28
23
|
</View>
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@popp0102/nova",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React Native component library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -48,5 +48,8 @@
|
|
|
48
48
|
"react": "^18.3.1",
|
|
49
49
|
"react-native": "^0.75.0",
|
|
50
50
|
"react-test-renderer": "^18.3.1"
|
|
51
|
+
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@expo/vector-icons": "^15.0.3"
|
|
51
54
|
}
|
|
52
55
|
}
|