Browse Source

Move context files into own folder

Arnaud Vergnet 2 years ago
parent
commit
b5d4ad83c3

+ 1
- 1
src/components/Animations/PlanexBottomBar.tsx View File

23
 import * as Animatable from 'react-native-animatable';
23
 import * as Animatable from 'react-native-animatable';
24
 import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
24
 import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
25
 import { useNavigation } from '@react-navigation/core';
25
 import { useNavigation } from '@react-navigation/core';
26
-import { useCollapsible } from '../../utils/CollapsibleContext';
26
+import { useCollapsible } from '../../context/CollapsibleContext';
27
 
27
 
28
 type Props = {
28
 type Props = {
29
   onPress: (action: string, data?: string) => void;
29
   onPress: (action: string, data?: string) => void;

+ 1
- 1
src/components/Collapsible/CollapsibleComponent.tsx View File

26
   StyleSheet,
26
   StyleSheet,
27
 } from 'react-native';
27
 } from 'react-native';
28
 import { useTheme } from 'react-native-paper';
28
 import { useTheme } from 'react-native-paper';
29
-import { useCollapsible } from '../../utils/CollapsibleContext';
29
+import { useCollapsible } from '../../context/CollapsibleContext';
30
 import { useFocusEffect } from '@react-navigation/core';
30
 import { useFocusEffect } from '@react-navigation/core';
31
 
31
 
32
 export type CollapsibleComponentPropsType = {
32
 export type CollapsibleComponentPropsType = {

+ 1
- 1
src/components/Screens/WebViewScreen.tsx View File

46
 import ErrorView from './ErrorView';
46
 import ErrorView from './ErrorView';
47
 import BasicLoadingScreen from './BasicLoadingScreen';
47
 import BasicLoadingScreen from './BasicLoadingScreen';
48
 import { useFocusEffect, useNavigation } from '@react-navigation/core';
48
 import { useFocusEffect, useNavigation } from '@react-navigation/core';
49
-import { useCollapsible } from '../../utils/CollapsibleContext';
49
+import { useCollapsible } from '../../context/CollapsibleContext';
50
 import { REQUEST_STATUS } from '../../utils/Requests';
50
 import { REQUEST_STATUS } from '../../utils/Requests';
51
 
51
 
52
 type Props = {
52
 type Props = {

+ 1
- 1
src/components/Tabbar/CustomTabBar.tsx View File

22
 import { Animated, StyleSheet } from 'react-native';
22
 import { Animated, StyleSheet } from 'react-native';
23
 import TabIcon from './TabIcon';
23
 import TabIcon from './TabIcon';
24
 import { useTheme } from 'react-native-paper';
24
 import { useTheme } from 'react-native-paper';
25
-import { useCollapsible } from '../../utils/CollapsibleContext';
25
+import { useCollapsible } from '../../context/CollapsibleContext';
26
 
26
 
27
 export const TAB_BAR_HEIGHT = 50;
27
 export const TAB_BAR_HEIGHT = 50;
28
 
28
 

+ 1
- 1
src/components/providers/CacheProvider.tsx View File

3
   CacheContext,
3
   CacheContext,
4
   CacheContextType,
4
   CacheContextType,
5
   CacheType,
5
   CacheType,
6
-} from '../../utils/cacheContext';
6
+} from '../../context/cacheContext';
7
 
7
 
8
 type Props = {
8
 type Props = {
9
   children: React.ReactChild;
9
   children: React.ReactChild;

+ 1
- 1
src/components/providers/CollapsibleProvider.tsx View File

3
 import {
3
 import {
4
   CollapsibleContext,
4
   CollapsibleContext,
5
   CollapsibleContextType,
5
   CollapsibleContextType,
6
-} from '../../utils/CollapsibleContext';
6
+} from '../../context/CollapsibleContext';
7
 
7
 
8
 type Props = {
8
 type Props = {
9
   children: React.ReactChild;
9
   children: React.ReactChild;

+ 1
- 1
src/components/providers/PreferencesProvider.tsx View File

8
 import {
8
 import {
9
   PreferencesContext,
9
   PreferencesContext,
10
   PreferencesContextType,
10
   PreferencesContextType,
11
-} from '../../utils/preferencesContext';
11
+} from '../../context/preferencesContext';
12
 
12
 
13
 type Props = {
13
 type Props = {
14
   children: React.ReactChild;
14
   children: React.ReactChild;

src/utils/CollapsibleContext.ts → src/context/CollapsibleContext.ts View File


src/utils/cacheContext.ts → src/context/cacheContext.ts View File


src/utils/preferencesContext.ts → src/context/preferencesContext.ts View File

3
   defaultPreferences,
3
   defaultPreferences,
4
   PreferenceKeys,
4
   PreferenceKeys,
5
   PreferencesType,
5
   PreferencesType,
6
-} from './asyncStorage';
6
+} from '../utils/asyncStorage';
7
 
7
 
8
 export type PreferencesContextType = {
8
 export type PreferencesContextType = {
9
   preferences: PreferencesType;
9
   preferences: PreferencesType;

+ 1
- 1
src/screens/Planex/GroupSelectionScreen.tsx View File

33
 import Urls from '../../constants/Urls';
33
 import Urls from '../../constants/Urls';
34
 import { readData } from '../../utils/WebData';
34
 import { readData } from '../../utils/WebData';
35
 import { useNavigation } from '@react-navigation/core';
35
 import { useNavigation } from '@react-navigation/core';
36
-import { useCachedPlanexGroups } from '../../utils/cacheContext';
36
+import { useCachedPlanexGroups } from '../../context/cacheContext';
37
 
37
 
38
 export type PlanexGroupType = {
38
 export type PlanexGroupType = {
39
   name: string;
39
   name: string;

+ 1
- 1
src/screens/Services/Proximo/ProximoListScreen.tsx View File

48
   MainRoutes,
48
   MainRoutes,
49
   MainStackParamsList,
49
   MainStackParamsList,
50
 } from '../../../navigation/MainNavigator';
50
 } from '../../../navigation/MainNavigator';
51
-import { useCachedProximoArticles } from '../../../utils/cacheContext';
51
+import { useCachedProximoArticles } from '../../../context/cacheContext';
52
 
52
 
53
 function sortPrice(a: ProximoArticleType, b: ProximoArticleType): number {
53
 function sortPrice(a: ProximoArticleType, b: ProximoArticleType): number {
54
   return a.price - b.price;
54
   return a.price - b.price;

+ 1
- 1
src/screens/Services/Proximo/ProximoMainScreen.tsx View File

30
 import { readData } from '../../../utils/WebData';
30
 import { readData } from '../../../utils/WebData';
31
 import { useNavigation } from '@react-navigation/core';
31
 import { useNavigation } from '@react-navigation/core';
32
 import { useLayoutEffect } from 'react';
32
 import { useLayoutEffect } from 'react';
33
-import { useCachedProximoCategories } from '../../../utils/cacheContext';
33
+import { useCachedProximoCategories } from '../../../context/cacheContext';
34
 import GENERAL_STYLES from '../../../constants/Styles';
34
 import GENERAL_STYLES from '../../../constants/Styles';
35
 
35
 
36
 const LIST_ITEM_HEIGHT = 84;
36
 const LIST_ITEM_HEIGHT = 84;

Loading…
Cancel
Save