From b5d4ad83c3678846d69fad605bfd9e9c1e2ba629 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Sat, 15 May 2021 11:41:17 +0200 Subject: [PATCH] Move context files into own folder --- src/components/Animations/PlanexBottomBar.tsx | 2 +- src/components/Collapsible/CollapsibleComponent.tsx | 2 +- src/components/Screens/WebViewScreen.tsx | 2 +- src/components/Tabbar/CustomTabBar.tsx | 2 +- src/components/providers/CacheProvider.tsx | 2 +- src/components/providers/CollapsibleProvider.tsx | 2 +- src/components/providers/PreferencesProvider.tsx | 2 +- src/{utils => context}/CollapsibleContext.ts | 0 src/{utils => context}/cacheContext.ts | 0 src/{utils => context}/preferencesContext.ts | 2 +- src/screens/Planex/GroupSelectionScreen.tsx | 2 +- src/screens/Services/Proximo/ProximoListScreen.tsx | 2 +- src/screens/Services/Proximo/ProximoMainScreen.tsx | 2 +- 13 files changed, 11 insertions(+), 11 deletions(-) rename src/{utils => context}/CollapsibleContext.ts (100%) rename src/{utils => context}/cacheContext.ts (100%) rename src/{utils => context}/preferencesContext.ts (95%) diff --git a/src/components/Animations/PlanexBottomBar.tsx b/src/components/Animations/PlanexBottomBar.tsx index 2013d41..e239cb9 100644 --- a/src/components/Animations/PlanexBottomBar.tsx +++ b/src/components/Animations/PlanexBottomBar.tsx @@ -23,7 +23,7 @@ import { FAB, IconButton, Surface, useTheme } from 'react-native-paper'; import * as Animatable from 'react-native-animatable'; import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar'; import { useNavigation } from '@react-navigation/core'; -import { useCollapsible } from '../../utils/CollapsibleContext'; +import { useCollapsible } from '../../context/CollapsibleContext'; type Props = { onPress: (action: string, data?: string) => void; diff --git a/src/components/Collapsible/CollapsibleComponent.tsx b/src/components/Collapsible/CollapsibleComponent.tsx index 6aba7e5..24c6c30 100644 --- a/src/components/Collapsible/CollapsibleComponent.tsx +++ b/src/components/Collapsible/CollapsibleComponent.tsx @@ -26,7 +26,7 @@ import { StyleSheet, } from 'react-native'; import { useTheme } from 'react-native-paper'; -import { useCollapsible } from '../../utils/CollapsibleContext'; +import { useCollapsible } from '../../context/CollapsibleContext'; import { useFocusEffect } from '@react-navigation/core'; export type CollapsibleComponentPropsType = { diff --git a/src/components/Screens/WebViewScreen.tsx b/src/components/Screens/WebViewScreen.tsx index 2207466..8137cdc 100644 --- a/src/components/Screens/WebViewScreen.tsx +++ b/src/components/Screens/WebViewScreen.tsx @@ -46,7 +46,7 @@ import MaterialHeaderButtons, { Item } from '../Overrides/CustomHeaderButton'; import ErrorView from './ErrorView'; import BasicLoadingScreen from './BasicLoadingScreen'; import { useFocusEffect, useNavigation } from '@react-navigation/core'; -import { useCollapsible } from '../../utils/CollapsibleContext'; +import { useCollapsible } from '../../context/CollapsibleContext'; import { REQUEST_STATUS } from '../../utils/Requests'; type Props = { diff --git a/src/components/Tabbar/CustomTabBar.tsx b/src/components/Tabbar/CustomTabBar.tsx index 11748a3..1699b6b 100644 --- a/src/components/Tabbar/CustomTabBar.tsx +++ b/src/components/Tabbar/CustomTabBar.tsx @@ -22,7 +22,7 @@ import type { BottomTabBarProps } from '@react-navigation/bottom-tabs'; import { Animated, StyleSheet } from 'react-native'; import TabIcon from './TabIcon'; import { useTheme } from 'react-native-paper'; -import { useCollapsible } from '../../utils/CollapsibleContext'; +import { useCollapsible } from '../../context/CollapsibleContext'; export const TAB_BAR_HEIGHT = 50; diff --git a/src/components/providers/CacheProvider.tsx b/src/components/providers/CacheProvider.tsx index 2151036..22d551c 100644 --- a/src/components/providers/CacheProvider.tsx +++ b/src/components/providers/CacheProvider.tsx @@ -3,7 +3,7 @@ import { CacheContext, CacheContextType, CacheType, -} from '../../utils/cacheContext'; +} from '../../context/cacheContext'; type Props = { children: React.ReactChild; diff --git a/src/components/providers/CollapsibleProvider.tsx b/src/components/providers/CollapsibleProvider.tsx index 4820248..72a25ac 100644 --- a/src/components/providers/CollapsibleProvider.tsx +++ b/src/components/providers/CollapsibleProvider.tsx @@ -3,7 +3,7 @@ import { Collapsible } from 'react-navigation-collapsible'; import { CollapsibleContext, CollapsibleContextType, -} from '../../utils/CollapsibleContext'; +} from '../../context/CollapsibleContext'; type Props = { children: React.ReactChild; diff --git a/src/components/providers/PreferencesProvider.tsx b/src/components/providers/PreferencesProvider.tsx index d5ef6e1..2a81ce3 100644 --- a/src/components/providers/PreferencesProvider.tsx +++ b/src/components/providers/PreferencesProvider.tsx @@ -8,7 +8,7 @@ import { import { PreferencesContext, PreferencesContextType, -} from '../../utils/preferencesContext'; +} from '../../context/preferencesContext'; type Props = { children: React.ReactChild; diff --git a/src/utils/CollapsibleContext.ts b/src/context/CollapsibleContext.ts similarity index 100% rename from src/utils/CollapsibleContext.ts rename to src/context/CollapsibleContext.ts diff --git a/src/utils/cacheContext.ts b/src/context/cacheContext.ts similarity index 100% rename from src/utils/cacheContext.ts rename to src/context/cacheContext.ts diff --git a/src/utils/preferencesContext.ts b/src/context/preferencesContext.ts similarity index 95% rename from src/utils/preferencesContext.ts rename to src/context/preferencesContext.ts index 5ea2a16..e075f33 100644 --- a/src/utils/preferencesContext.ts +++ b/src/context/preferencesContext.ts @@ -3,7 +3,7 @@ import { defaultPreferences, PreferenceKeys, PreferencesType, -} from './asyncStorage'; +} from '../utils/asyncStorage'; export type PreferencesContextType = { preferences: PreferencesType; diff --git a/src/screens/Planex/GroupSelectionScreen.tsx b/src/screens/Planex/GroupSelectionScreen.tsx index 0176bc6..73ee8cd 100644 --- a/src/screens/Planex/GroupSelectionScreen.tsx +++ b/src/screens/Planex/GroupSelectionScreen.tsx @@ -33,7 +33,7 @@ import AsyncStorageManager from '../../managers/AsyncStorageManager'; import Urls from '../../constants/Urls'; import { readData } from '../../utils/WebData'; import { useNavigation } from '@react-navigation/core'; -import { useCachedPlanexGroups } from '../../utils/cacheContext'; +import { useCachedPlanexGroups } from '../../context/cacheContext'; export type PlanexGroupType = { name: string; diff --git a/src/screens/Services/Proximo/ProximoListScreen.tsx b/src/screens/Services/Proximo/ProximoListScreen.tsx index 367473c..2f67cc6 100644 --- a/src/screens/Services/Proximo/ProximoListScreen.tsx +++ b/src/screens/Services/Proximo/ProximoListScreen.tsx @@ -48,7 +48,7 @@ import { MainRoutes, MainStackParamsList, } from '../../../navigation/MainNavigator'; -import { useCachedProximoArticles } from '../../../utils/cacheContext'; +import { useCachedProximoArticles } from '../../../context/cacheContext'; function sortPrice(a: ProximoArticleType, b: ProximoArticleType): number { return a.price - b.price; diff --git a/src/screens/Services/Proximo/ProximoMainScreen.tsx b/src/screens/Services/Proximo/ProximoMainScreen.tsx index a770e75..031a9bf 100644 --- a/src/screens/Services/Proximo/ProximoMainScreen.tsx +++ b/src/screens/Services/Proximo/ProximoMainScreen.tsx @@ -30,7 +30,7 @@ import Urls from '../../../constants/Urls'; import { readData } from '../../../utils/WebData'; import { useNavigation } from '@react-navigation/core'; import { useLayoutEffect } from 'react'; -import { useCachedProximoCategories } from '../../../utils/cacheContext'; +import { useCachedProximoCategories } from '../../../context/cacheContext'; import GENERAL_STYLES from '../../../constants/Styles'; const LIST_ITEM_HEIGHT = 84;