@popp0102/nova 0.9.1 → 0.9.2
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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const styles = StyleSheet.create({
|
|
4
|
+
header: {
|
|
5
|
+
paddingVertical: 16,
|
|
6
|
+
paddingHorizontal: 16,
|
|
7
|
+
width: "100%",
|
|
8
|
+
},
|
|
9
|
+
topRow: {
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
width: "100%",
|
|
13
|
+
},
|
|
14
|
+
backButton: {
|
|
15
|
+
width: 48,
|
|
16
|
+
},
|
|
17
|
+
titleContainer: {
|
|
18
|
+
flex: 1,
|
|
19
|
+
alignItems: "center",
|
|
20
|
+
},
|
|
21
|
+
rightContent: {
|
|
22
|
+
width: 80,
|
|
23
|
+
alignItems: "flex-end",
|
|
24
|
+
},
|
|
25
|
+
subtitleRow: {
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
marginTop: 4,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { View, Pressable } from 'react-native';
|
|
2
|
+
import { MaterialIcons } from '@expo/vector-icons';
|
|
3
|
+
import Heading from '../Heading';
|
|
4
|
+
import { styles } from './config';
|
|
5
|
+
|
|
6
|
+
export default function ScreenHeader({
|
|
7
|
+
title,
|
|
8
|
+
subtitle,
|
|
9
|
+
onBack,
|
|
10
|
+
rightContent,
|
|
11
|
+
titleFontFamily,
|
|
12
|
+
titleColor = "#4A2C0A",
|
|
13
|
+
subtitleColor = "#2C1810",
|
|
14
|
+
backIconColor = "#4A2C0A"
|
|
15
|
+
}) {
|
|
16
|
+
return (
|
|
17
|
+
<View style={styles.header}>
|
|
18
|
+
<View style={styles.topRow}>
|
|
19
|
+
{onBack ? (
|
|
20
|
+
<Pressable onPress={onBack} style={styles.backButton} testID="screen-header-back-button">
|
|
21
|
+
<MaterialIcons name="arrow-back" size={32} color={backIconColor} />
|
|
22
|
+
</Pressable>
|
|
23
|
+
) : (
|
|
24
|
+
<View style={styles.backButton} />
|
|
25
|
+
)}
|
|
26
|
+
<View style={styles.titleContainer}>
|
|
27
|
+
<Heading size="h2" fontFamily={titleFontFamily} color={titleColor}>{title}</Heading>
|
|
28
|
+
</View>
|
|
29
|
+
{rightContent ? (
|
|
30
|
+
<View style={styles.rightContent}>
|
|
31
|
+
{rightContent}
|
|
32
|
+
</View>
|
|
33
|
+
) : (
|
|
34
|
+
<View style={styles.rightContent} />
|
|
35
|
+
)}
|
|
36
|
+
</View>
|
|
37
|
+
{subtitle && (
|
|
38
|
+
<View style={styles.subtitleRow}>
|
|
39
|
+
<Heading size="h5" color={subtitleColor}>{subtitle}</Heading>
|
|
40
|
+
</View>
|
|
41
|
+
)}
|
|
42
|
+
</View>
|
|
43
|
+
);
|
|
44
|
+
}
|
package/lib/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Badge } from './components/Badge';
|
|
|
4
4
|
export { default as Card } from './components/Card';
|
|
5
5
|
export { default as IconButton } from './components/IconButton';
|
|
6
6
|
export { default as Screen } from './components/Screen';
|
|
7
|
+
export { default as ScreenHeader } from './components/ScreenHeader';
|
|
7
8
|
export { default as Subtitle } from './components/Subtitle';
|
|
8
9
|
export { default as Heading } from './components/Heading';
|
|
9
10
|
export { default as FadeView } from './components/animations/FadeView';
|