From cec664c8d0548802b76c01e124556ed6f8319b2d Mon Sep 17 00:00:00 2001 From: Maarten Date: Thu, 8 Aug 2024 14:22:02 +0200 Subject: [PATCH] Move files to lib folder --- app/(explore)/category.tsx | 6 +++--- app/(onboarding)/start.tsx | 16 +++++++------- app/(tabs)/_layout.tsx | 6 +++--- app/(tabs)/explore.tsx | 16 +++++++------- app/(tabs)/index.tsx | 16 +++++++------- app/(tabs)/map.tsx | 16 +++++++------- app/(tabs)/settings.tsx | 21 +++++++++---------- app/_layout.tsx | 8 +++---- app/index.tsx | 12 +++++------ {components => lib/components}/EditModal.tsx | 0 {components => lib/components}/List.tsx | 0 {components => lib/components}/ThemedText.tsx | 0 {components => lib/components}/ThemedView.tsx | 0 .../components}/__tests__/ThemedText-test.tsx | 0 .../__snapshots__/ThemedText-test.tsx.snap | 0 .../components}/navigation/TabBarIcon.tsx | 0 {constants => lib/constants}/Colors.ts | 0 {context => lib/context}/AppProvider.tsx | 0 {context => lib/context}/UseStorageState.tsx | 0 {hooks => lib/hooks}/useColorScheme.ts | 0 {hooks => lib/hooks}/useColorScheme.web.ts | 0 {hooks => lib/hooks}/useThemeColor.ts | 0 {services => lib/services}/message.tsx | 0 {services => lib/services}/request.tsx | 0 {store => lib/store}/dataStore.tsx | 0 {store => lib/store}/store.tsx | 0 26 files changed, 58 insertions(+), 59 deletions(-) rename {components => lib/components}/EditModal.tsx (100%) rename {components => lib/components}/List.tsx (100%) rename {components => lib/components}/ThemedText.tsx (100%) rename {components => lib/components}/ThemedView.tsx (100%) rename {components => lib/components}/__tests__/ThemedText-test.tsx (100%) rename {components => lib/components}/__tests__/__snapshots__/ThemedText-test.tsx.snap (100%) rename {components => lib/components}/navigation/TabBarIcon.tsx (100%) rename {constants => lib/constants}/Colors.ts (100%) rename {context => lib/context}/AppProvider.tsx (100%) rename {context => lib/context}/UseStorageState.tsx (100%) rename {hooks => lib/hooks}/useColorScheme.ts (100%) rename {hooks => lib/hooks}/useColorScheme.web.ts (100%) rename {hooks => lib/hooks}/useThemeColor.ts (100%) rename {services => lib/services}/message.tsx (100%) rename {services => lib/services}/request.tsx (100%) rename {store => lib/store}/dataStore.tsx (100%) rename {store => lib/store}/store.tsx (100%) diff --git a/app/(explore)/category.tsx b/app/(explore)/category.tsx index 3d411d4..a22df9d 100644 --- a/app/(explore)/category.tsx +++ b/app/(explore)/category.tsx @@ -10,9 +10,9 @@ import RenderHtml from 'react-native-render-html'; import { useNavigation } from '@react-navigation/native'; import { useSelector } from 'react-redux'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { ThemedView } from '@/components/ThemedView'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { ThemedView } from '@/lib/components/ThemedView'; export default function CategoryScreen() { const colorScheme = useColorScheme() ?? 'light'; diff --git a/app/(onboarding)/start.tsx b/app/(onboarding)/start.tsx index a5756b9..81b0c05 100644 --- a/app/(onboarding)/start.tsx +++ b/app/(onboarding)/start.tsx @@ -1,16 +1,16 @@ +import React from 'react'; import { Stack } from 'expo-router'; import { StyleSheet, TextInput, TouchableOpacity } from 'react-native'; import { router } from 'expo-router'; // import DeviceInfo from 'react-native-device-info'; -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { useToken } from '@/context/AppProvider'; -import { Colors } from '@/constants/Colors'; -import React from 'react'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { Message } from '@/services/message'; -import { Request } from '@/services/request'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { useToken } from '@/lib/context/AppProvider'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { Message } from '@/lib/services/message'; +import { Request } from '@/lib/services/request'; export default function OnboardStartScreen() { const colorScheme = useColorScheme() ?? 'light'; diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx index 5759a2d..693bdc1 100644 --- a/app/(tabs)/_layout.tsx +++ b/app/(tabs)/_layout.tsx @@ -1,9 +1,9 @@ import { Tabs } from 'expo-router'; import React from 'react'; -import { TabBarIcon } from '@/components/navigation/TabBarIcon'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; +import { TabBarIcon } from '@/lib/components/navigation/TabBarIcon'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; export default function TabLayout() { const colorScheme = useColorScheme(); diff --git a/app/(tabs)/explore.tsx b/app/(tabs)/explore.tsx index 0824103..135fbe3 100644 --- a/app/(tabs)/explore.tsx +++ b/app/(tabs)/explore.tsx @@ -14,14 +14,14 @@ import type { AutocompleteDropdownRef } from 'react-native-autocomplete-dropdown import { AutocompleteDropdown } from 'react-native-autocomplete-dropdown'; import Modal from "react-native-modal"; -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { Request } from '@/services/request'; -import List from '@/components/List'; -import { store } from '@/store/store'; -import { setViewCategory } from '@/store/dataStore'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { Request } from '@/lib/services/request'; +import List from '@/lib/components/List'; +import { store } from '@/lib/store/store'; +import { setViewCategory } from '@/lib/store/dataStore'; export default function ExploreScreen() { const colorScheme = useColorScheme() ?? 'light'; diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx index 9492e5c..4888843 100644 --- a/app/(tabs)/index.tsx +++ b/app/(tabs)/index.tsx @@ -3,17 +3,17 @@ import { StyleSheet, ScrollView, SafeAreaView, View, StatusBar } from 'react-nat // @ts-ignore import CalendarPicker from 'react-native-calendar-picker'; import Ionicons from '@expo/vector-icons/Ionicons'; - -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { useToken } from '@/context/AppProvider'; -import { Request } from '@/services/request'; -import List from '@/components/List'; import { useIsFocused } from '@react-navigation/core'; import { useSelector } from 'react-redux'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { useToken } from '@/lib/context/AppProvider'; +import { Request } from '@/lib/services/request'; +import List from '@/lib/components/List'; + export default function HomeScreen() { const colorScheme = useColorScheme() ?? 'light'; const isFocused = useIsFocused(); diff --git a/app/(tabs)/map.tsx b/app/(tabs)/map.tsx index ddcd6b4..78f0c10 100644 --- a/app/(tabs)/map.tsx +++ b/app/(tabs)/map.tsx @@ -1,17 +1,17 @@ import React, { useEffect, useState } from 'react'; import { Image, SafeAreaView, ScrollView, StatusBar, StyleSheet, Switch, View, Dimensions } from 'react-native'; import Mapbox, { Callout, Camera, MapView, PointAnnotation } from "@rnmapbox/maps"; +import { useSelector } from 'react-redux'; +import { useIsFocused } from '@react-navigation/core'; Mapbox.setAccessToken( "pk.eyJ1IjoibWFhcnRlbnZyOTgiLCJhIjoiY2x6ZDFqMGp1MGVyejJrczhqcXpvYm9iYiJ9.XvYcL62dWiJQiFmG6mOoug" ); -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import List from '@/components/List'; -import { Request } from '@/services/request'; -import { useIsFocused } from '@react-navigation/core'; -import { useSelector } from 'react-redux'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import List from '@/lib/components/List'; +import { Request } from '@/lib/services/request'; export default function MapScreen() { const colorScheme = useColorScheme() ?? 'light'; diff --git a/app/(tabs)/settings.tsx b/app/(tabs)/settings.tsx index a4c5d34..3ab360b 100644 --- a/app/(tabs)/settings.tsx +++ b/app/(tabs)/settings.tsx @@ -6,22 +6,21 @@ import { StatusBar, TouchableOpacity, Alert, - TextInput, } from 'react-native'; import { useRouter } from 'expo-router'; import Ionicons from '@expo/vector-icons/Ionicons'; import { useSelector } from 'react-redux'; -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { Colors } from '@/constants/Colors'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { useToken } from '@/context/AppProvider'; -import { Message } from '@/services/message'; -import { Request } from '@/services/request'; -import CustomModal from '@/components/EditModal'; -import { store } from '@/store/store'; -import { setSession, setReloadCalendar } from '@/store/dataStore'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { Colors } from '@/lib/constants/Colors'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { useToken } from '@/lib/context/AppProvider'; +import { Message } from '@/lib/services/message'; +import { Request } from '@/lib/services/request'; +import CustomModal from '@/lib/components/EditModal'; +import { store } from '@/lib/store/store'; +import { setSession, setReloadCalendar } from '@/lib/store/dataStore'; export default function SettingsScreen() { const colorScheme = useColorScheme() ?? 'light'; diff --git a/app/_layout.tsx b/app/_layout.tsx index dafa18e..d930e74 100644 --- a/app/_layout.tsx +++ b/app/_layout.tsx @@ -1,5 +1,5 @@ import { useFonts } from 'expo-font'; -import { Slot, SplashScreen, Stack } from 'expo-router'; +import { SplashScreen, Stack } from 'expo-router'; import { Provider } from 'react-redux'; import { useEffect } from 'react'; import 'react-native-reanimated'; @@ -7,9 +7,9 @@ import { DarkTheme, DefaultTheme, ThemeProvider } from '@react-navigation/native import Toast from 'react-native-toast-message'; import { AutocompleteDropdownContextProvider } from 'react-native-autocomplete-dropdown'; -import { AppProvider } from '@/context/AppProvider'; -import { useColorScheme } from '@/hooks/useColorScheme'; -import { store } from '@/store/store'; +import { AppProvider } from '@/lib/context/AppProvider'; +import { useColorScheme } from '@/lib/hooks/useColorScheme'; +import { store } from '@/lib/store/store'; // Prevent the splash screen from auto-hiding before asset loading is complete. SplashScreen.preventAutoHideAsync(); diff --git a/app/index.tsx b/app/index.tsx index 06c499c..c7bf588 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -1,12 +1,12 @@ import React, { useEffect } from 'react'; import { Redirect, router, useRouter } from 'expo-router'; -import { ThemedText } from '@/components/ThemedText'; -import { ThemedView } from '@/components/ThemedView'; -import { useToken } from '@/context/AppProvider'; -import { Request } from '@/services/request'; -import { store } from '@/store/store'; -import { setSession } from '@/store/dataStore'; +import { ThemedText } from '@/lib/components/ThemedText'; +import { ThemedView } from '@/lib/components/ThemedView'; +import { useToken } from '@/lib/context/AppProvider'; +import { Request } from '@/lib/services/request'; +import { store } from '@/lib/store/store'; +import { setSession } from '@/lib/store/dataStore'; export default function OnboardStartScreen() { diff --git a/components/EditModal.tsx b/lib/components/EditModal.tsx similarity index 100% rename from components/EditModal.tsx rename to lib/components/EditModal.tsx diff --git a/components/List.tsx b/lib/components/List.tsx similarity index 100% rename from components/List.tsx rename to lib/components/List.tsx diff --git a/components/ThemedText.tsx b/lib/components/ThemedText.tsx similarity index 100% rename from components/ThemedText.tsx rename to lib/components/ThemedText.tsx diff --git a/components/ThemedView.tsx b/lib/components/ThemedView.tsx similarity index 100% rename from components/ThemedView.tsx rename to lib/components/ThemedView.tsx diff --git a/components/__tests__/ThemedText-test.tsx b/lib/components/__tests__/ThemedText-test.tsx similarity index 100% rename from components/__tests__/ThemedText-test.tsx rename to lib/components/__tests__/ThemedText-test.tsx diff --git a/components/__tests__/__snapshots__/ThemedText-test.tsx.snap b/lib/components/__tests__/__snapshots__/ThemedText-test.tsx.snap similarity index 100% rename from components/__tests__/__snapshots__/ThemedText-test.tsx.snap rename to lib/components/__tests__/__snapshots__/ThemedText-test.tsx.snap diff --git a/components/navigation/TabBarIcon.tsx b/lib/components/navigation/TabBarIcon.tsx similarity index 100% rename from components/navigation/TabBarIcon.tsx rename to lib/components/navigation/TabBarIcon.tsx diff --git a/constants/Colors.ts b/lib/constants/Colors.ts similarity index 100% rename from constants/Colors.ts rename to lib/constants/Colors.ts diff --git a/context/AppProvider.tsx b/lib/context/AppProvider.tsx similarity index 100% rename from context/AppProvider.tsx rename to lib/context/AppProvider.tsx diff --git a/context/UseStorageState.tsx b/lib/context/UseStorageState.tsx similarity index 100% rename from context/UseStorageState.tsx rename to lib/context/UseStorageState.tsx diff --git a/hooks/useColorScheme.ts b/lib/hooks/useColorScheme.ts similarity index 100% rename from hooks/useColorScheme.ts rename to lib/hooks/useColorScheme.ts diff --git a/hooks/useColorScheme.web.ts b/lib/hooks/useColorScheme.web.ts similarity index 100% rename from hooks/useColorScheme.web.ts rename to lib/hooks/useColorScheme.web.ts diff --git a/hooks/useThemeColor.ts b/lib/hooks/useThemeColor.ts similarity index 100% rename from hooks/useThemeColor.ts rename to lib/hooks/useThemeColor.ts diff --git a/services/message.tsx b/lib/services/message.tsx similarity index 100% rename from services/message.tsx rename to lib/services/message.tsx diff --git a/services/request.tsx b/lib/services/request.tsx similarity index 100% rename from services/request.tsx rename to lib/services/request.tsx diff --git a/store/dataStore.tsx b/lib/store/dataStore.tsx similarity index 100% rename from store/dataStore.tsx rename to lib/store/dataStore.tsx diff --git a/store/store.tsx b/lib/store/store.tsx similarity index 100% rename from store/store.tsx rename to lib/store/store.tsx