Browse Source

fix lint errors

Arnaud Vergnet 6 months ago
parent
commit
2bbb3f60ce

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

@@ -28,7 +28,7 @@ import { FAB, IconButton, Surface, withTheme } from 'react-native-paper';
28 28
 import * as Animatable from 'react-native-animatable';
29 29
 import { StackNavigationProp } from '@react-navigation/stack';
30 30
 import AutoHideHandler from '../../utils/AutoHideHandler';
31
-import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
31
+import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
32 32
 
33 33
 const AnimatedFAB = Animatable.createAnimatableComponent(FAB);
34 34
 

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

@@ -27,7 +27,7 @@ import {
27 27
 import { FAB } from 'react-native-paper';
28 28
 import * as Animatable from 'react-native-animatable';
29 29
 import AutoHideHandler from '../../utils/AutoHideHandler';
30
-import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
30
+import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
31 31
 
32 32
 type PropsType = {
33 33
   icon: string;

+ 1
- 1
src/components/Overrides/CustomModal.tsx View File

@@ -21,7 +21,7 @@ import * as React from 'react';
21 21
 import { useTheme } from 'react-native-paper';
22 22
 import { Modalize } from 'react-native-modalize';
23 23
 import { View } from 'react-native-animatable';
24
-import CustomTabBar, { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
24
+import { TAB_BAR_HEIGHT } from '../Tabbar/CustomTabBar';
25 25
 
26 26
 /**
27 27
  * Abstraction layer for Modalize component, using custom configuration

+ 4
- 3
src/navigation/MainNavigator.tsx View File

@@ -46,7 +46,6 @@ import EquipmentConfirmScreen from '../screens/Amicale/Equipment/EquipmentConfir
46 46
 import DashboardEditScreen from '../screens/Other/Settings/DashboardEditScreen';
47 47
 import GameStartScreen from '../screens/Game/screens/GameStartScreen';
48 48
 import ImageGalleryScreen from '../screens/Media/ImageGalleryScreen';
49
-import Test from '../screens/Test';
50 49
 
51 50
 export enum MainRoutes {
52 51
   Main = 'main',
@@ -102,8 +101,10 @@ function MainStackComponent(props: {
102 101
 }) {
103 102
   const { createTabNavigator } = props;
104 103
   return (
105
-    <MainStack.Navigator initialRouteName={MainRoutes.Main} headerMode="screen">
106
-      <MainStack.Screen name={'test'} component={Test} />
104
+    <MainStack.Navigator
105
+      initialRouteName={MainRoutes.Main}
106
+      headerMode={'screen'}
107
+    >
107 108
       <MainStack.Screen
108 109
         name={MainRoutes.Main}
109 110
         component={createTabNavigator}

+ 1
- 1
src/screens/About/AboutDependenciesScreen.tsx View File

@@ -69,7 +69,7 @@ export default class AboutDependenciesScreen extends React.Component<{}> {
69 69
   );
70 70
 
71 71
   getItemLayout = (
72
-    data: Array<ListItemType> | null | undefined,
72
+    _data: Array<ListItemType> | null | undefined,
73 73
     index: number
74 74
   ): { length: number; offset: number; index: number } => ({
75 75
     length: LIST_ITEM_HEIGHT,

+ 1
- 3
src/screens/Amicale/Clubs/ClubDisplayScreen.tsx View File

@@ -31,9 +31,7 @@ import i18n from 'i18n-js';
31 31
 import { StackNavigationProp } from '@react-navigation/stack';
32 32
 import AuthenticatedScreen from '../../../components/Amicale/AuthenticatedScreen';
33 33
 import CustomHTML from '../../../components/Overrides/CustomHTML';
34
-import CustomTabBar, {
35
-  TAB_BAR_HEIGHT,
36
-} from '../../../components/Tabbar/CustomTabBar';
34
+import { TAB_BAR_HEIGHT } from '../../../components/Tabbar/CustomTabBar';
37 35
 import type { ClubCategoryType, ClubType } from './ClubListScreen';
38 36
 import { ERROR_TYPE } from '../../../utils/WebData';
39 37
 import CollapsibleScrollView from '../../../components/Collapsible/CollapsibleScrollView';

+ 1
- 3
src/screens/Home/FeedItemScreen.tsx View File

@@ -25,9 +25,7 @@ import { StackNavigationProp } from '@react-navigation/stack';
25 25
 import MaterialHeaderButtons, {
26 26
   Item,
27 27
 } from '../../components/Overrides/CustomHeaderButton';
28
-import CustomTabBar, {
29
-  TAB_BAR_HEIGHT,
30
-} from '../../components/Tabbar/CustomTabBar';
28
+import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
31 29
 import type { FeedItemType } from './HomeScreen';
32 30
 import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
33 31
 import ImageGalleryButton from '../../components/Media/ImageGalleryButton';

+ 1
- 3
src/screens/Home/ScannerScreen.tsx View File

@@ -26,9 +26,7 @@ import i18n from 'i18n-js';
26 26
 import { PERMISSIONS, request, RESULTS } from 'react-native-permissions';
27 27
 import URLHandler from '../../utils/URLHandler';
28 28
 import AlertDialog from '../../components/Dialogs/AlertDialog';
29
-import CustomTabBar, {
30
-  TAB_BAR_HEIGHT,
31
-} from '../../components/Tabbar/CustomTabBar';
29
+import { TAB_BAR_HEIGHT } from '../../components/Tabbar/CustomTabBar';
32 30
 import LoadingConfirmDialog from '../../components/Dialogs/LoadingConfirmDialog';
33 31
 import { MASCOT_STYLE } from '../../components/Mascot/Mascot';
34 32
 import MascotPopup from '../../components/Mascot/MascotPopup';

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

@@ -123,10 +123,14 @@ function ProximoMainScreen() {
123 123
   const getHeaderButtons = () => {
124 124
     return (
125 125
       <MaterialHeaderButtons>
126
-        <Item title="magnify" iconName="magnify" onPress={onPressSearchBtn} />
127 126
         <Item
128
-          title="information"
129
-          iconName="information"
127
+          title={'magnify'}
128
+          iconName={'magnify'}
129
+          onPress={onPressSearchBtn}
130
+        />
131
+        <Item
132
+          title={'information'}
133
+          iconName={'information'}
130 134
           onPress={onPressAboutBtn}
131 135
         />
132 136
       </MaterialHeaderButtons>
@@ -181,7 +185,7 @@ function ProximoMainScreen() {
181 185
             <List.Icon
182 186
               color={props.color}
183 187
               style={props.style}
184
-              icon="chevron-right"
188
+              icon={'chevron-right'}
185 189
             />
186 190
           )}
187 191
           style={{

+ 0
- 156
src/screens/Test.tsx View File

@@ -1,156 +0,0 @@
1
-import { useNavigation } from '@react-navigation/core';
2
-import { StackNavigationProp } from '@react-navigation/stack';
3
-import React from 'react';
4
-import { Animated, View } from 'react-native';
5
-import { Text } from 'react-native-paper';
6
-import {
7
-  Collapsible,
8
-  useCollapsibleHeader,
9
-} from 'react-navigation-collapsible';
10
-import CollapsibleFlatList from '../components/Collapsible/CollapsibleFlatList';
11
-import FeedItem from '../components/Home/FeedItem';
12
-import WebSectionList from '../components/Screens/WebSectionList';
13
-import withCollapsible from '../utils/withCollapsible';
14
-import { FeedItemType } from './Home/HomeScreen';
15
-import i18n from 'i18n-js';
16
-import CollapsibleSectionList from '../components/Collapsible/CollapsibleSectionList';
17
-
18
-// export default function Test() {
19
-//   const {
20
-//     onScroll /* Event handler */,
21
-//     onScrollWithListener /* Event handler creator */,
22
-//     containerPaddingTop /* number */,
23
-//     scrollIndicatorInsetTop /* number */,
24
-//     /* Animated.AnimatedValue contentOffset from scrolling */
25
-//     positionY /* 0.0 ~ length of scrollable component (contentOffset)
26
-//     /* Animated.AnimatedInterpolation by scrolling */,
27
-//     translateY /* 0.0 ~ -headerHeight */,
28
-//     progress /* 0.0 ~ 1.0 */,
29
-//     opacity /* 1.0 ~ 0.0 */,
30
-//   } = useCollapsibleHeader();
31
-
32
-//   const renderItem = () => {
33
-//     return (
34
-//       <View
35
-//         style={{
36
-//           marginTop: 50,
37
-//           marginBottom: 50,
38
-//         }}
39
-//       >
40
-//         <Text>TEST</Text>
41
-//       </View>
42
-//     );
43
-//   };
44
-
45
-//   return (
46
-//     <Animated.FlatList
47
-//       onScroll={onScroll}
48
-//       contentContainerStyle={{ paddingTop: containerPaddingTop }}
49
-//       scrollIndicatorInsets={{ top: scrollIndicatorInsetTop }}
50
-//       data={[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
51
-//       renderItem={renderItem}
52
-//     />
53
-//   );
54
-// }
55
-
56
-type Props = {
57
-  navigation: StackNavigationProp<any>;
58
-  collapsibleStack: Collapsible;
59
-};
60
-
61
-const DATA_URL =
62
-  'https://etud.insa-toulouse.fr/~amicale_app/v2/dashboard/dashboard_data.json';
63
-const FEED_ITEM_HEIGHT = 500;
64
-
65
-const REFRESH_TIME = 1000 * 20; // Refresh every 20 seconds
66
-class Test extends React.Component<Props> {
67
-  createDataset = (): Array<{
68
-    title: string;
69
-    data: [] | Array<FeedItemType>;
70
-    id: string;
71
-  }> => {
72
-    return [
73
-      {
74
-        title: 'title',
75
-        data: [
76
-          {
77
-            id: '0',
78
-            message: 'message',
79
-            image: '',
80
-            link: '',
81
-            page_id: 'amicale.deseleves',
82
-            time: 0,
83
-            url: '',
84
-            video: '',
85
-          },
86
-          {
87
-            id: '1',
88
-            message: 'message',
89
-            image: '',
90
-            link: '',
91
-            page_id: 'amicale.deseleves',
92
-            time: 0,
93
-            url: '',
94
-            video: '',
95
-          },
96
-          {
97
-            id: '2',
98
-            message: 'message',
99
-            image: '',
100
-            link: '',
101
-            page_id: 'amicale.deseleves',
102
-            time: 0,
103
-            url: '',
104
-            video: '',
105
-          },
106
-        ],
107
-        id: '0',
108
-      },
109
-    ];
110
-  };
111
-  getRenderItem = ({ item }: { item: FeedItemType }) => (
112
-    <FeedItem item={item} height={FEED_ITEM_HEIGHT} />
113
-  );
114
-
115
-  render() {
116
-    const renderItem = () => {
117
-      return (
118
-        <View
119
-          style={{
120
-            marginTop: 50,
121
-            marginBottom: 50,
122
-          }}
123
-        >
124
-          <Text>TEST</Text>
125
-        </View>
126
-      );
127
-    };
128
-
129
-    const props = this.props;
130
-    // return (
131
-    //   <CollapsibleFlatList
132
-    //     data={[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
133
-    //     renderItem={renderItem}
134
-    //   />
135
-    // );
136
-    // return (
137
-    //   <CollapsibleSectionList
138
-    //     sections={[{ title: '', data: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] }]}
139
-    //     renderItem={renderItem}
140
-    //   />
141
-    // );
142
-    return (
143
-      <WebSectionList
144
-        createDataset={this.createDataset}
145
-        autoRefreshTime={REFRESH_TIME}
146
-        refreshOnFocus
147
-        fetchUrl={DATA_URL}
148
-        renderItem={this.getRenderItem}
149
-        itemHeight={FEED_ITEM_HEIGHT}
150
-        showError={false}
151
-      />
152
-    );
153
-  }
154
-}
155
-
156
-export default Test;

Loading…
Cancel
Save