Browse Source

fix proximo images

Arnaud Vergnet 2 years ago
parent
commit
a8dde29654

+ 0
- 2
src/components/Lists/Proximo/ProximoListItem.tsx View File

@@ -44,8 +44,6 @@ const styles = StyleSheet.create({
44 44
 });
45 45
 
46 46
 function ProximoListItem(props: PropsType) {
47
-  // console.log(Urls.proximo.images + props.item.image);
48
-
49 47
   return (
50 48
     <List.Item
51 49
       title={props.item.name}

+ 1
- 1
src/constants/Urls.tsx View File

@@ -28,7 +28,7 @@ const AMICALE_ENDPOINT = AMICALE_SERVER + 'api/';
28 28
 const APP_ENDPOINT = STUDENT_SERVER + '~amicale_app/v2/';
29 29
 const PROXIMO_ENDPOINT = STUDENT_SERVER + '~proximo/v2/api/';
30 30
 const PROXIMO_IMAGES_ENDPOINT =
31
-  STUDENT_SERVER + '~proximo/v2/api-proximo/public/storage/app/';
31
+  STUDENT_SERVER + '~proximo/api_proximo/storage/app/public/';
32 32
 const APP_IMAGES_ENDPOINT = STUDENT_SERVER + '~amicale_app/images/';
33 33
 
34 34
 export default {

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

@@ -249,7 +249,10 @@ function ProximoListScreen(props: Props) {
249 249
 
250 250
         <ScrollView>
251 251
           <View style={styles.modalContent}>
252
-            <Image style={styles.image} source={{ uri: item.image }} />
252
+            <Image
253
+              style={styles.image}
254
+              source={{ uri: Urls.proximo.images + item.image }}
255
+            />
253 256
           </View>
254 257
           <Text>{item.description}</Text>
255 258
         </ScrollView>
@@ -330,9 +333,6 @@ function ProximoListScreen(props: Props) {
330 333
     data: ArticlesType | undefined
331 334
   ): SectionListDataType<ProximoArticleType> => {
332 335
     if (data) {
333
-      console.log(data);
334
-      console.log(props.route.params.category);
335
-
336 336
       return [
337 337
         {
338 338
           title: '',

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

@@ -19,18 +19,19 @@
19 19
 
20 20
 import * as React from 'react';
21 21
 import i18n from 'i18n-js';
22
-import { Avatar, List, useTheme, withTheme } from 'react-native-paper';
22
+import { List, useTheme, withTheme } from 'react-native-paper';
23 23
 import WebSectionList from '../../../components/Screens/WebSectionList';
24 24
 import MaterialHeaderButtons, {
25 25
   Item,
26 26
 } from '../../../components/Overrides/CustomHeaderButton';
27 27
 import type { SectionListDataType } from '../../../components/Screens/WebSectionList';
28
-import { StyleSheet } from 'react-native';
28
+import { Image, StyleSheet } from 'react-native';
29 29
 import Urls from '../../../constants/Urls';
30 30
 import { readData } from '../../../utils/WebData';
31 31
 import { useNavigation } from '@react-navigation/core';
32 32
 import { useLayoutEffect } from 'react';
33 33
 import { useCachedProximoCategories } from '../../../utils/cacheContext';
34
+import GENERAL_STYLES from '../../../constants/Styles';
34 35
 
35 36
 const LIST_ITEM_HEIGHT = 84;
36 37
 
@@ -63,6 +64,12 @@ const styles = StyleSheet.create({
63 64
   item: {
64 65
     justifyContent: 'center',
65 66
   },
67
+  avatar: {
68
+    marginLeft: 5,
69
+    ...GENERAL_STYLES.centerVertical,
70
+    height: 35,
71
+    width: 35,
72
+  },
66 73
 });
67 74
 
68 75
 function sortCategories(
@@ -172,7 +179,10 @@ function ProximoMainScreen() {
172 179
           onPress={onPress}
173 180
           left={(props) =>
174 181
             item.icon.endsWith('.png') ? (
175
-              <Avatar.Image style={props.style} source={{ uri: item.icon }} />
182
+              <Image
183
+                style={{ ...props.style, ...styles.avatar }}
184
+                source={{ uri: Urls.proximo.icons + item.icon }}
185
+              />
176 186
             ) : (
177 187
               <List.Icon
178 188
                 style={props.style}

Loading…
Cancel
Save