create-ern-boilerplate 0.0.40 → 0.0.41
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/templates/agent-generator/examples/screen.example.tsx +2 -3
- package/templates/agent-generator/examples/screens/detail-screen.example.tsx +3 -2
- package/templates/agent-generator/examples/screens/list-screen-no-auth.example.tsx +3 -2
- package/templates/agent-generator/examples/screens/list-screen-with-auth.example.tsx +3 -2
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import React, { useState, useEffect } from 'react';
|
|
13
13
|
import { View, Text, FlatList, RefreshControl, ActivityIndicator } from 'react-native';
|
|
14
14
|
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
15
|
-
import {
|
|
15
|
+
import { useTheme } from '@/hooks/useTheme';
|
|
16
16
|
import { Card } from '@/components/common/Card';
|
|
17
17
|
import { Button } from '@/components/common/Button';
|
|
18
18
|
|
|
@@ -25,8 +25,7 @@ interface NewsItem {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export default function NewsListScreen() {
|
|
28
|
-
const
|
|
29
|
-
const isDark = colorScheme === 'dark';
|
|
28
|
+
const { colors, isDark } = useTheme();
|
|
30
29
|
|
|
31
30
|
// State management
|
|
32
31
|
const [news, setNews] = useState<NewsItem[]>([]);
|
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
import { useTheme } from '@/hooks/useTheme';
|
|
29
29
|
import { useRouter, useLocalSearchParams } from 'expo-router';
|
|
30
30
|
import Toast from 'react-native-toast-message';
|
|
31
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
31
32
|
|
|
32
33
|
// Example: Product interface
|
|
33
34
|
interface Product {
|
|
@@ -184,7 +185,7 @@ export default function ProductDetailScreen() {
|
|
|
184
185
|
|
|
185
186
|
// Main content
|
|
186
187
|
return (
|
|
187
|
-
<
|
|
188
|
+
<SafeAreaView className="flex-1" style={{ backgroundColor: isDark ? '#000' : '#F9FAFB' }}>
|
|
188
189
|
<ScrollView>
|
|
189
190
|
{/* Product Image */}
|
|
190
191
|
{product.imageUrl && (
|
|
@@ -282,6 +283,6 @@ export default function ProductDetailScreen() {
|
|
|
282
283
|
</View>
|
|
283
284
|
</View>
|
|
284
285
|
</ScrollView>
|
|
285
|
-
</
|
|
286
|
+
</SafeAreaView>
|
|
286
287
|
);
|
|
287
288
|
}
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from 'react-native';
|
|
27
27
|
import { useTheme } from '@/hooks/useTheme';
|
|
28
28
|
import { useRouter } from 'expo-router';
|
|
29
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
29
30
|
|
|
30
31
|
// Example: News interface
|
|
31
32
|
interface NewsItem {
|
|
@@ -142,7 +143,7 @@ export default function NewsListScreen() {
|
|
|
142
143
|
|
|
143
144
|
// Main content
|
|
144
145
|
return (
|
|
145
|
-
<
|
|
146
|
+
<SafeAreaView className="flex-1" style={{ backgroundColor: isDark ? '#000' : '#F9FAFB' }}>
|
|
146
147
|
<FlatList
|
|
147
148
|
data={news}
|
|
148
149
|
keyExtractor={(item) => item.id}
|
|
@@ -189,6 +190,6 @@ export default function NewsListScreen() {
|
|
|
189
190
|
)}
|
|
190
191
|
contentContainerStyle={{ paddingBottom: 16 }}
|
|
191
192
|
/>
|
|
192
|
-
</
|
|
193
|
+
</SafeAreaView>
|
|
193
194
|
);
|
|
194
195
|
}
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
import { useTheme } from '@/hooks/useTheme';
|
|
28
28
|
import { useAuthStore } from '@/store/authStore';
|
|
29
29
|
import { useRouter } from 'expo-router';
|
|
30
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
30
31
|
|
|
31
32
|
// Example: User's task interface
|
|
32
33
|
interface Task {
|
|
@@ -190,7 +191,7 @@ export default function TaskListScreen() {
|
|
|
190
191
|
|
|
191
192
|
// Main content
|
|
192
193
|
return (
|
|
193
|
-
<
|
|
194
|
+
<SafeAreaView className="flex-1" style={{ backgroundColor: isDark ? '#000' : '#F9FAFB' }}>
|
|
194
195
|
{/* Header with user info */}
|
|
195
196
|
<View className={`px-4 py-4 ${isDark ? 'bg-gray-800' : 'bg-white'}`}>
|
|
196
197
|
<Text className={`text-lg font-bold ${isDark ? 'text-white' : 'text-gray-900'}`}>
|
|
@@ -245,6 +246,6 @@ export default function TaskListScreen() {
|
|
|
245
246
|
)}
|
|
246
247
|
contentContainerStyle={{ paddingBottom: 16 }}
|
|
247
248
|
/>
|
|
248
|
-
</
|
|
249
|
+
</SafeAreaView>
|
|
249
250
|
);
|
|
250
251
|
}
|