@imksh/create 1.0.23 → 1.0.25
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/package.json +1 -1
- package/src/utils/copyTemplate.js +6 -0
- package/templates/mern-react-native/client/src/vite-env.d.ts +1 -0
- package/templates/mern-react-native/mobile/babel.config.js +1 -0
- package/templates/mern-react-native/mobile/drizzle.config.ts +8 -0
- package/templates/mern-react-native/mobile/expo-env.d.ts +3 -0
- package/templates/mern-react-native/mobile/package.json +6 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/_layout.tsx +12 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/change-password.tsx +112 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/edit-profile.tsx +160 -0
- package/templates/mern-react-native/mobile/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/mern-react-native/mobile/src/app/{login.tsx → (auth)/login.tsx} +69 -21
- package/templates/mern-react-native/mobile/src/app/(tabs)/index.tsx +18 -17
- package/templates/mern-react-native/mobile/src/app/(tabs)/profile.tsx +23 -60
- package/templates/mern-react-native/mobile/src/app/_layout.tsx +22 -4
- package/templates/mern-react-native/mobile/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/mern-react-native/mobile/src/components/common/LocationLoader.tsx +591 -0
- package/templates/mern-react-native/mobile/src/components/common/ScreenHeader.tsx +41 -17
- package/templates/mern-react-native/mobile/src/components/common/TabHeader.tsx +58 -0
- package/templates/mern-react-native/mobile/src/components/common/Typography.tsx +49 -30
- package/templates/mern-react-native/mobile/src/components/common/Welcome.tsx +2 -2
- package/templates/mern-react-native/mobile/src/components/ui/BottomModal.tsx +31 -20
- package/templates/mern-react-native/mobile/src/components/ui/ClassicTabBar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/CustomTabBar.tsx +108 -71
- package/templates/mern-react-native/mobile/src/components/ui/Sidebar.tsx +81 -56
- package/templates/mern-react-native/mobile/src/components/ui/buttons/Button.tsx +106 -37
- package/templates/mern-react-native/mobile/src/components/ui/buttons/IconButton.tsx +4 -2
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Accordion.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Avatar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/data-display/Badge.tsx +45 -17
- package/templates/mern-react-native/mobile/src/components/ui/data-display/ImageViewer.tsx +19 -9
- package/templates/mern-react-native/mobile/src/components/ui/feedback/CircularProgress.tsx +5 -4
- package/templates/mern-react-native/mobile/src/components/ui/feedback/ProgressBar.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/feedback/Skeleton.tsx +3 -0
- package/templates/mern-react-native/mobile/src/components/ui/feedback/Spinner.tsx +11 -3
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Checkbox.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Input.tsx +54 -14
- package/templates/mern-react-native/mobile/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/mern-react-native/mobile/src/components/ui/inputs/OTPInput.tsx +32 -9
- package/templates/mern-react-native/mobile/src/components/ui/inputs/PasswordInput.tsx +2 -1
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Radio.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/SearchBar.tsx +41 -4
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Slider.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/inputs/Switch.tsx +3 -2
- package/templates/mern-react-native/mobile/src/components/ui/inputs/TextArea.tsx +2 -1
- package/templates/mern-react-native/mobile/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/mern-react-native/mobile/src/components/ui/layout/Grid.tsx +52 -10
- package/templates/mern-react-native/mobile/src/components/ui/layout/Section.tsx +7 -8
- package/templates/mern-react-native/mobile/src/components/ui/navigation/Pagination.tsx +4 -3
- package/templates/mern-react-native/mobile/src/components/ui/navigation/ProgressStepper.tsx +6 -5
- package/templates/mern-react-native/mobile/src/components/ui/navigation/Tabs.tsx +30 -4
- package/templates/mern-react-native/mobile/src/config/api.ts +12 -1
- package/templates/mern-react-native/mobile/src/config/sidebar.config.ts +72 -0
- package/templates/mern-react-native/mobile/src/config/tabNavigation.ts +37 -7
- package/templates/mern-react-native/mobile/src/db/index.ts +9 -0
- package/templates/mern-react-native/mobile/src/db/schema.ts +14 -0
- package/templates/mern-react-native/mobile/src/hooks/useDebounce.ts +17 -0
- package/templates/mern-react-native/mobile/src/services/socket.service.ts +36 -0
- package/templates/mern-react-native/mobile/src/store/useAuthStore.ts +122 -27
- package/templates/mern-react-native/mobile/src/store/useNotificationStore.ts +53 -0
- package/templates/mern-react-native/mobile/src/types/auth.type.ts +14 -0
- package/templates/mern-react-native/mobile/tsconfig.json +1 -0
- package/templates/mern-ts/client/src/vite-env.d.ts +1 -0
- package/templates/react-native/babel.config.js +1 -0
- package/templates/react-native/drizzle.config.ts +8 -0
- package/templates/react-native/expo-env.d.ts +3 -0
- package/templates/react-native/package.json +6 -0
- package/templates/react-native/src/app/(auth)/_layout.tsx +12 -0
- package/templates/react-native/src/app/(auth)/change-password.tsx +112 -0
- package/templates/react-native/src/app/(auth)/edit-profile.tsx +160 -0
- package/templates/react-native/src/app/(auth)/forgot-password.tsx +191 -0
- package/templates/react-native/src/app/{login.tsx → (auth)/login.tsx} +69 -21
- package/templates/react-native/src/app/(tabs)/index.tsx +18 -17
- package/templates/react-native/src/app/(tabs)/profile.tsx +23 -60
- package/templates/react-native/src/app/_layout.tsx +22 -4
- package/templates/react-native/src/components/common/AnimatedHeader.tsx +328 -0
- package/templates/react-native/src/components/common/LocationLoader.tsx +591 -0
- package/templates/react-native/src/components/common/ScreenHeader.tsx +41 -17
- package/templates/react-native/src/components/common/TabHeader.tsx +58 -0
- package/templates/react-native/src/components/common/Typography.tsx +49 -30
- package/templates/react-native/src/components/common/Welcome.tsx +2 -2
- package/templates/react-native/src/components/ui/BottomModal.tsx +31 -20
- package/templates/react-native/src/components/ui/ClassicTabBar.tsx +4 -3
- package/templates/react-native/src/components/ui/CustomTabBar.tsx +108 -71
- package/templates/react-native/src/components/ui/Sidebar.tsx +81 -56
- package/templates/react-native/src/components/ui/buttons/Button.tsx +106 -37
- package/templates/react-native/src/components/ui/buttons/IconButton.tsx +4 -2
- package/templates/react-native/src/components/ui/data-display/Accordion.tsx +3 -2
- package/templates/react-native/src/components/ui/data-display/Avatar.tsx +4 -3
- package/templates/react-native/src/components/ui/data-display/Badge.tsx +45 -17
- package/templates/react-native/src/components/ui/data-display/ImageViewer.tsx +19 -9
- package/templates/react-native/src/components/ui/feedback/CircularProgress.tsx +5 -4
- package/templates/react-native/src/components/ui/feedback/ProgressBar.tsx +4 -3
- package/templates/react-native/src/components/ui/feedback/Skeleton.tsx +3 -0
- package/templates/react-native/src/components/ui/feedback/Spinner.tsx +11 -3
- package/templates/react-native/src/components/ui/inputs/Checkbox.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/DatePicker.tsx +186 -0
- package/templates/react-native/src/components/ui/inputs/ImagePickerModal.tsx +129 -0
- package/templates/react-native/src/components/ui/inputs/Input.tsx +54 -14
- package/templates/react-native/src/components/ui/inputs/LocationPicker.tsx +211 -0
- package/templates/react-native/src/components/ui/inputs/OTPInput.tsx +32 -9
- package/templates/react-native/src/components/ui/inputs/PasswordInput.tsx +2 -1
- package/templates/react-native/src/components/ui/inputs/Radio.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/SearchBar.tsx +41 -4
- package/templates/react-native/src/components/ui/inputs/Slider.tsx +4 -3
- package/templates/react-native/src/components/ui/inputs/Switch.tsx +3 -2
- package/templates/react-native/src/components/ui/inputs/TextArea.tsx +2 -1
- package/templates/react-native/src/components/ui/inputs/WebLocationPicker.tsx +321 -0
- package/templates/react-native/src/components/ui/layout/Grid.tsx +52 -10
- package/templates/react-native/src/components/ui/layout/Section.tsx +7 -8
- package/templates/react-native/src/components/ui/navigation/Pagination.tsx +4 -3
- package/templates/react-native/src/components/ui/navigation/ProgressStepper.tsx +6 -5
- package/templates/react-native/src/components/ui/navigation/Tabs.tsx +30 -4
- package/templates/react-native/src/config/api.ts +12 -1
- package/templates/react-native/src/config/sidebar.config.ts +72 -0
- package/templates/react-native/src/config/tabNavigation.ts +37 -7
- package/templates/react-native/src/db/index.ts +9 -0
- package/templates/react-native/src/db/schema.ts +14 -0
- package/templates/react-native/src/hooks/useDebounce.ts +17 -0
- package/templates/react-native/src/services/socket.service.ts +36 -0
- package/templates/react-native/src/store/useAuthStore.ts +122 -27
- package/templates/react-native/src/store/useNotificationStore.ts +53 -0
- package/templates/react-native/src/types/auth.type.ts +14 -0
- package/templates/react-native/tsconfig.json +1 -0
- package/templates/react-ts/src/vite-env.d.ts +1 -0
- package/templates/mern-react-native/mobile/.env +0 -2
- package/templates/mern-react-native/mobile/.env.example +0 -2
- package/templates/mern-react-native/mobile/.vscode/extensions.json +0 -1
- package/templates/mern-react-native/mobile/.vscode/settings.json +0 -7
- package/templates/mern-react-native/mobile/README.md +0 -159
- package/templates/mern-react-native/mobile/docs/README.md +0 -17
- package/templates/mern-react-native/mobile/docs/components/buttons.md +0 -40
- package/templates/mern-react-native/mobile/docs/components/data-display.md +0 -44
- package/templates/mern-react-native/mobile/docs/components/feedback.md +0 -36
- package/templates/mern-react-native/mobile/docs/components/gestures.md +0 -60
- package/templates/mern-react-native/mobile/docs/components/inputs.md +0 -41
- package/templates/mern-react-native/mobile/docs/components/layout.md +0 -34
- package/templates/mern-react-native/mobile/docs/components/navigation.md +0 -31
- package/templates/mern-react-native/mobile/docs/features.md +0 -85
- package/templates/mern-react-native/mobile/docs/getting-started.md +0 -47
- package/templates/mern-react-native/mobile/src/components/common/HomeHeader.tsx +0 -43
- package/templates/mern-react-native/mobile/src/components/settings/SettingToggle.tsx +0 -26
- package/templates/mern-react-native/mobile/src/components/settings/SettingsOptions.tsx +0 -47
- package/templates/react-native/.env +0 -2
- package/templates/react-native/.env.example +0 -2
- package/templates/react-native/.vscode/extensions.json +0 -1
- package/templates/react-native/.vscode/settings.json +0 -7
- package/templates/react-native/README.md +0 -159
- package/templates/react-native/docs/README.md +0 -17
- package/templates/react-native/docs/components/buttons.md +0 -40
- package/templates/react-native/docs/components/data-display.md +0 -44
- package/templates/react-native/docs/components/feedback.md +0 -36
- package/templates/react-native/docs/components/gestures.md +0 -60
- package/templates/react-native/docs/components/inputs.md +0 -41
- package/templates/react-native/docs/components/layout.md +0 -34
- package/templates/react-native/docs/components/navigation.md +0 -31
- package/templates/react-native/docs/features.md +0 -85
- package/templates/react-native/docs/getting-started.md +0 -47
- package/templates/react-native/src/components/common/HomeHeader.tsx +0 -43
- package/templates/react-native/src/components/settings/SettingToggle.tsx +0 -26
- package/templates/react-native/src/components/settings/SettingsOptions.tsx +0 -47
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Animated,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Platform,
|
|
8
|
+
Image,
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
11
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
12
|
+
import { Txt } from "./Typography";
|
|
13
|
+
import { useColorScheme } from "nativewind";
|
|
14
|
+
import { Colors } from "../../constants/Colors";
|
|
15
|
+
|
|
16
|
+
interface AnimatedHeaderProps {
|
|
17
|
+
title: string;
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
showImage?: boolean;
|
|
20
|
+
badges?: React.ReactNode;
|
|
21
|
+
content?: React.ReactNode | ((color: string) => React.ReactNode);
|
|
22
|
+
imageUrl?: string;
|
|
23
|
+
onBack: () => void;
|
|
24
|
+
rightActions?: React.ReactNode | ((color: string) => React.ReactNode);
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
imageFallbackIcon?: keyof typeof Ionicons.glyphMap;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const HEADER_MAX_HEIGHT = 300;
|
|
30
|
+
|
|
31
|
+
export default function AnimatedHeader({
|
|
32
|
+
title,
|
|
33
|
+
subtitle,
|
|
34
|
+
showImage = true,
|
|
35
|
+
badges,
|
|
36
|
+
content,
|
|
37
|
+
imageUrl,
|
|
38
|
+
onBack,
|
|
39
|
+
rightActions,
|
|
40
|
+
children,
|
|
41
|
+
imageFallbackIcon = "business",
|
|
42
|
+
}: AnimatedHeaderProps) {
|
|
43
|
+
const insets = useSafeAreaInsets();
|
|
44
|
+
const { colorScheme } = useColorScheme();
|
|
45
|
+
const colors = Colors[colorScheme ?? "light"];
|
|
46
|
+
|
|
47
|
+
const [scrollY] = useState(() => new Animated.Value(0));
|
|
48
|
+
const isDarkBg = !!imageUrl;
|
|
49
|
+
|
|
50
|
+
const dynamicTextColor = isDarkBg ? "#FFFFFF" : colors.baseContent;
|
|
51
|
+
|
|
52
|
+
const HEADER_MIN_HEIGHT = Platform.OS === "ios" ? 90 : 70 + insets.top;
|
|
53
|
+
const HEADER_SCROLL_DISTANCE = HEADER_MAX_HEIGHT - HEADER_MIN_HEIGHT;
|
|
54
|
+
|
|
55
|
+
const headerTranslateY = scrollY.interpolate({
|
|
56
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE],
|
|
57
|
+
outputRange: [0, -HEADER_SCROLL_DISTANCE],
|
|
58
|
+
extrapolate: "clamp",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const imageOpacity = scrollY.interpolate({
|
|
62
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE / 2, HEADER_SCROLL_DISTANCE],
|
|
63
|
+
outputRange: [1, 1, 0],
|
|
64
|
+
extrapolate: "clamp",
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const imageTranslateY = scrollY.interpolate({
|
|
68
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE],
|
|
69
|
+
outputRange: [0, 100],
|
|
70
|
+
extrapolate: "clamp",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const titleScale = scrollY.interpolate({
|
|
74
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE / 2, HEADER_SCROLL_DISTANCE],
|
|
75
|
+
outputRange: [1, 1, 0.8],
|
|
76
|
+
extrapolate: "clamp",
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const titleTranslateY = scrollY.interpolate({
|
|
80
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE / 2, HEADER_SCROLL_DISTANCE],
|
|
81
|
+
outputRange: [0, 0, -8],
|
|
82
|
+
extrapolate: "clamp",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const titleTranslateX = scrollY.interpolate({
|
|
86
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE / 2, HEADER_SCROLL_DISTANCE],
|
|
87
|
+
outputRange: [0, 0, 40],
|
|
88
|
+
extrapolate: "clamp",
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const topBarBackgroundOpacity = scrollY.interpolate({
|
|
92
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE - 20, HEADER_SCROLL_DISTANCE],
|
|
93
|
+
outputRange: [0, 0, 1],
|
|
94
|
+
extrapolate: "clamp",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const smallImageOpacity = scrollY.interpolate({
|
|
98
|
+
inputRange: [0, HEADER_SCROLL_DISTANCE - 20, HEADER_SCROLL_DISTANCE],
|
|
99
|
+
outputRange: [0, 0, 1],
|
|
100
|
+
extrapolate: "clamp",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<View style={styles.container}>
|
|
105
|
+
<Animated.ScrollView
|
|
106
|
+
contentContainerStyle={{ paddingTop: HEADER_MAX_HEIGHT }}
|
|
107
|
+
showsVerticalScrollIndicator={false}
|
|
108
|
+
scrollEventThrottle={16}
|
|
109
|
+
onScroll={Animated.event(
|
|
110
|
+
[{ nativeEvent: { contentOffset: { y: scrollY } } }],
|
|
111
|
+
{ useNativeDriver: true },
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
{children}
|
|
115
|
+
</Animated.ScrollView>
|
|
116
|
+
|
|
117
|
+
<Animated.View
|
|
118
|
+
style={[
|
|
119
|
+
styles.header,
|
|
120
|
+
{ transform: [{ translateY: headerTranslateY }] },
|
|
121
|
+
]}
|
|
122
|
+
>
|
|
123
|
+
<Animated.View
|
|
124
|
+
style={[
|
|
125
|
+
styles.backgroundImageContainer,
|
|
126
|
+
{
|
|
127
|
+
opacity: imageOpacity,
|
|
128
|
+
transform: [{ translateY: imageTranslateY }],
|
|
129
|
+
},
|
|
130
|
+
]}
|
|
131
|
+
>
|
|
132
|
+
{imageUrl ? (
|
|
133
|
+
<>
|
|
134
|
+
<Image
|
|
135
|
+
source={{ uri: imageUrl }}
|
|
136
|
+
style={styles.backgroundImage}
|
|
137
|
+
resizeMode="cover"
|
|
138
|
+
/>
|
|
139
|
+
<View style={[StyleSheet.absoluteFill, { backgroundColor: 'rgba(0,0,0,0.4)' }]} />
|
|
140
|
+
</>
|
|
141
|
+
) : (
|
|
142
|
+
<View className="w-full h-full items-center justify-center bg-primary/20 pt-10">
|
|
143
|
+
<Ionicons
|
|
144
|
+
name={imageFallbackIcon}
|
|
145
|
+
size={80}
|
|
146
|
+
color={colors.primary}
|
|
147
|
+
style={{ opacity: 0.5 }}
|
|
148
|
+
/>
|
|
149
|
+
</View>
|
|
150
|
+
)}
|
|
151
|
+
</Animated.View>
|
|
152
|
+
|
|
153
|
+
<Animated.View
|
|
154
|
+
style={[
|
|
155
|
+
styles.titleContainer,
|
|
156
|
+
{
|
|
157
|
+
transform: [
|
|
158
|
+
{ scale: titleScale },
|
|
159
|
+
{ translateY: titleTranslateY },
|
|
160
|
+
{ translateX: titleTranslateX },
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
]}
|
|
164
|
+
>
|
|
165
|
+
{badges}
|
|
166
|
+
<Txt
|
|
167
|
+
variant="2xl"
|
|
168
|
+
className=""
|
|
169
|
+
style={{ color: dynamicTextColor }}
|
|
170
|
+
numberOfLines={1}
|
|
171
|
+
>
|
|
172
|
+
{title}
|
|
173
|
+
</Txt>
|
|
174
|
+
{subtitle && (
|
|
175
|
+
<Txt
|
|
176
|
+
variant="sm"
|
|
177
|
+
className=" mt-1"
|
|
178
|
+
style={{ color: dynamicTextColor, opacity: 0.8 }}
|
|
179
|
+
numberOfLines={1}
|
|
180
|
+
>
|
|
181
|
+
{subtitle}
|
|
182
|
+
</Txt>
|
|
183
|
+
)}
|
|
184
|
+
{typeof content === "function" ? content(dynamicTextColor) : content}
|
|
185
|
+
</Animated.View>
|
|
186
|
+
</Animated.View>
|
|
187
|
+
|
|
188
|
+
<Animated.View
|
|
189
|
+
style={[
|
|
190
|
+
styles.topBar,
|
|
191
|
+
{
|
|
192
|
+
height: HEADER_MIN_HEIGHT,
|
|
193
|
+
paddingTop: insets.top,
|
|
194
|
+
backgroundColor: colors.base100,
|
|
195
|
+
opacity: topBarBackgroundOpacity,
|
|
196
|
+
},
|
|
197
|
+
]}
|
|
198
|
+
>
|
|
199
|
+
<Animated.View
|
|
200
|
+
style={{
|
|
201
|
+
position: "absolute",
|
|
202
|
+
top: insets.top + 10,
|
|
203
|
+
left: 0,
|
|
204
|
+
right: 0,
|
|
205
|
+
height: 40,
|
|
206
|
+
opacity: smallImageOpacity,
|
|
207
|
+
flexDirection: "row",
|
|
208
|
+
alignItems: "center",
|
|
209
|
+
marginLeft: 60,
|
|
210
|
+
marginRight: 100,
|
|
211
|
+
}}
|
|
212
|
+
>
|
|
213
|
+
{showImage && (
|
|
214
|
+
<>
|
|
215
|
+
{imageUrl ? (
|
|
216
|
+
<Image source={{ uri: imageUrl }} style={styles.smallImage} />
|
|
217
|
+
) : (
|
|
218
|
+
<View
|
|
219
|
+
style={[
|
|
220
|
+
styles.smallImage,
|
|
221
|
+
{
|
|
222
|
+
backgroundColor: colors.primary,
|
|
223
|
+
opacity: 0.2,
|
|
224
|
+
alignItems: "center",
|
|
225
|
+
justifyContent: "center",
|
|
226
|
+
},
|
|
227
|
+
]}
|
|
228
|
+
>
|
|
229
|
+
<Ionicons
|
|
230
|
+
name={imageFallbackIcon}
|
|
231
|
+
size={18}
|
|
232
|
+
color={colors.primary}
|
|
233
|
+
/>
|
|
234
|
+
</View>
|
|
235
|
+
)}
|
|
236
|
+
</>
|
|
237
|
+
)}
|
|
238
|
+
|
|
239
|
+
<Txt
|
|
240
|
+
variant="md"
|
|
241
|
+
className="font-bold text-base-content"
|
|
242
|
+
numberOfLines={1}
|
|
243
|
+
>
|
|
244
|
+
{title}
|
|
245
|
+
</Txt>
|
|
246
|
+
</Animated.View>
|
|
247
|
+
</Animated.View>
|
|
248
|
+
|
|
249
|
+
{/* Buttons */}
|
|
250
|
+
<View style={[styles.buttonsContainer, { top: insets.top + 10 }]}>
|
|
251
|
+
<TouchableOpacity
|
|
252
|
+
onPress={onBack}
|
|
253
|
+
className={`w-10 h-10 rounded-full items-center justify-center ${isDarkBg ? 'bg-black/40' : ''}`}
|
|
254
|
+
>
|
|
255
|
+
<Ionicons name="arrow-back" size={22} color={dynamicTextColor} />
|
|
256
|
+
</TouchableOpacity>
|
|
257
|
+
<View className="flex-row gap-2">
|
|
258
|
+
{typeof rightActions === "function" ? rightActions(dynamicTextColor) : rightActions}
|
|
259
|
+
</View>
|
|
260
|
+
</View>
|
|
261
|
+
</View>
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
const styles = StyleSheet.create({
|
|
266
|
+
container: {
|
|
267
|
+
flex: 1,
|
|
268
|
+
},
|
|
269
|
+
header: {
|
|
270
|
+
position: "absolute",
|
|
271
|
+
top: 0,
|
|
272
|
+
left: 0,
|
|
273
|
+
right: 0,
|
|
274
|
+
height: HEADER_MAX_HEIGHT,
|
|
275
|
+
backgroundColor: "transparent",
|
|
276
|
+
overflow: "hidden",
|
|
277
|
+
},
|
|
278
|
+
backgroundImageContainer: {
|
|
279
|
+
position: "absolute",
|
|
280
|
+
top: 0,
|
|
281
|
+
left: 0,
|
|
282
|
+
right: 0,
|
|
283
|
+
width: "100%",
|
|
284
|
+
height: HEADER_MAX_HEIGHT,
|
|
285
|
+
},
|
|
286
|
+
backgroundImage: {
|
|
287
|
+
width: "100%",
|
|
288
|
+
height: "100%",
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
titleContainer: {
|
|
292
|
+
position: "absolute",
|
|
293
|
+
bottom: 24,
|
|
294
|
+
left: 20,
|
|
295
|
+
right: 20,
|
|
296
|
+
},
|
|
297
|
+
topBar: {
|
|
298
|
+
position: "absolute",
|
|
299
|
+
top: 0,
|
|
300
|
+
left: 0,
|
|
301
|
+
right: 0,
|
|
302
|
+
borderBottomWidth: 1,
|
|
303
|
+
borderBottomColor: "rgba(0,0,0,0.05)",
|
|
304
|
+
},
|
|
305
|
+
topBarInner: {
|
|
306
|
+
position: "absolute",
|
|
307
|
+
top: 0,
|
|
308
|
+
left: 0,
|
|
309
|
+
right: 0,
|
|
310
|
+
bottom: 0,
|
|
311
|
+
justifyContent: "center",
|
|
312
|
+
},
|
|
313
|
+
smallImage: {
|
|
314
|
+
width: 36,
|
|
315
|
+
height: 36,
|
|
316
|
+
borderRadius: 18,
|
|
317
|
+
marginRight: 10,
|
|
318
|
+
},
|
|
319
|
+
buttonsContainer: {
|
|
320
|
+
position: "absolute",
|
|
321
|
+
left: 16,
|
|
322
|
+
right: 16,
|
|
323
|
+
flexDirection: "row",
|
|
324
|
+
justifyContent: "space-between",
|
|
325
|
+
alignItems: "center",
|
|
326
|
+
zIndex: 100,
|
|
327
|
+
},
|
|
328
|
+
});
|