Browse Source

Updated libs to latest compatible version

Arnaud Vergnet 1 year ago
parent
commit
daae4984ad
5 changed files with 90 additions and 86 deletions
  1. 10
    9
      App.js
  2. 0
    1
      app.json
  3. 1
    1
      components/Custom/CustomIntroSlider.js
  4. 61
    57
      components/Home/FeedItem.js
  5. 18
    18
      package.json

+ 10
- 9
App.js View File

@@ -1,7 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import * as React from 'react';
4
-import {Platform, StatusBar} from 'react-native';
4
+import {StatusBar} from 'react-native';
5 5
 import LocaleManager from './managers/LocaleManager';
6 6
 import AsyncStorageManager from "./managers/AsyncStorageManager";
7 7
 import CustomIntroSlider from "./components/Custom/CustomIntroSlider";
@@ -60,12 +60,10 @@ export default class App extends React.Component<Props, State> {
60 60
     }
61 61
 
62 62
     setupStatusBar() {
63
-        if (Platform.OS === 'ios') {
64
-            if (ThemeManager.getNightMode()) {
65
-                StatusBar.setBarStyle('light-content', true);
66
-            } else {
67
-                StatusBar.setBarStyle('dark-content', true);
68
-            }
63
+        if (ThemeManager.getNightMode()) {
64
+            StatusBar.setBarStyle('light-content', true);
65
+        } else {
66
+            StatusBar.setBarStyle('dark-content', true);
69 67
         }
70 68
     }
71 69
 
@@ -109,8 +107,11 @@ export default class App extends React.Component<Props, State> {
109 107
             showUpdate: AsyncStorageManager.getInstance().preferences.updateNumber.current !== Update.number.toString(),
110 108
             showAprilFools: AprilFoolsManager.getInstance().isAprilFoolsEnabled() && AsyncStorageManager.getInstance().preferences.showAprilFoolsStart.current === '1',
111 109
         });
112
-        // Status bar goes dark if set too fast
113
-        setTimeout(this.setupStatusBar, 1000);
110
+        // Status bar goes dark if set too fast on ios
111
+        if (Platform.OS === 'ios')
112
+            setTimeout(this.setupStatusBar, 1000);
113
+        else
114
+            this.setupStatusBar();
114 115
         SplashScreen.hide();
115 116
     }
116 117
 

+ 0
- 1
app.json View File

@@ -4,7 +4,6 @@
4 4
     "description": "Application mobile compatible Android et iOS pour l'Amicale INSA Toulouse. Grâce à cette application, vous avez facilement accès aux news du campus, aux emplois du temps, à l'état de la laverie, et bien d'autres services ! Ceci est une version Beta, Toutes les fonctionnalités ne sont pas encore implémentées, et il est possible de rencontrer quelques bugs.",
5 5
     "slug": "application-amicale",
6 6
     "privacy": "public",
7
-    "sdkVersion": "36.0.0",
8 7
     "platforms": [
9 8
       "ios",
10 9
       "android",

+ 1
- 1
components/Custom/CustomIntroSlider.js View File

@@ -142,7 +142,7 @@ export default class CustomIntroSlider extends React.Component<Props> {
142 142
         return (
143 143
             <AppIntroSlider
144 144
                 renderItem={CustomIntroSlider.getIntroRenderItem}
145
-                slides={slides}
145
+                data={slides}
146 146
                 onDone={this.props.onDone}
147 147
                 bottomButton
148 148
                 showSkipButton

+ 61
- 57
components/Home/FeedItem.js View File

@@ -1,5 +1,5 @@
1 1
 import * as React from 'react';
2
-import {Avatar, Button, Card, withTheme} from 'react-native-paper';
2
+import {Avatar, Button, Card, Text, withTheme} from 'react-native-paper';
3 3
 import {View} from "react-native";
4 4
 import Autolink from "react-native-autolink";
5 5
 import i18n from "i18n-js";
@@ -8,64 +8,68 @@ import ImageModal from 'react-native-image-modal';
8 8
 const ICON_AMICALE = require('../../assets/amicale.png');
9 9
 
10 10
 /**
11
- * Gets the amicale INSAT logo
12
- *
13
- * @return {*}
14
- */
15
-function getAvatar() {
16
-    return (
17
-        <Avatar.Image size={48} source={ICON_AMICALE}
18
-                      style={{backgroundColor: 'transparent'}}/>
19
-    );
20
-}
21
-
22
-/**
23 11
  * Component used to display a feed item
24
- *
25
- * @param props Props to pass to the component
26
- * @return {*}
27 12
  */
28
-function FeedItem(props) {
29
-    const {colors} = props.theme;
30
-    return (
31
-        <Card style={{margin: 10}}>
32
-            <Card.Title
33
-                title={props.title}
34
-                subtitle={props.subtitle}
35
-                left={getAvatar}
36
-            />
37
-            {props.full_picture !== '' && props.full_picture !== undefined ?
38
-                <View style={{marginLeft: 'auto', marginRight: 'auto'}}>
39
-                    <ImageModal
40
-                        resizeMode="contain"
41
-                        imageBackgroundColor={colors.background}
42
-                        style={{
43
-                            width: 250,
44
-                            height: 250,
45
-                        }}
46
-                        source={{
47
-                            uri: props.full_picture,
48
-                        }}
49
-                    /></View> : <View/>}
50
-            <Card.Content>
51
-                {props.message !== undefined ?
52
-                    <Autolink
53
-                        text={props.message}
54
-                        hashtag="facebook"
55
-                        style={{color: colors.text}}
56
-                    /> : <View/>
57
-                }
58
-            </Card.Content>
59
-            <Card.Actions>
60
-                <Button
61
-                    color={'#57aeff'}
62
-                    onPress={props.onOutLinkPress}
63
-                    icon={'facebook'}>
64
-                    {i18n.t('homeScreen.dashboard.seeMore')}
65
-                </Button>
66
-            </Card.Actions>
67
-        </Card>
68
-    );
13
+class FeedItem extends React.Component {
14
+
15
+    shouldComponentUpdate() {
16
+        return false;
17
+    }
18
+
19
+
20
+    /**
21
+     * Gets the amicale INSAT logo
22
+     *
23
+     * @return {*}
24
+     */
25
+    getAvatar() {
26
+        return (
27
+            <Avatar.Image size={48} source={ICON_AMICALE}
28
+                          style={{backgroundColor: 'transparent'}}/>
29
+        );
30
+    }
31
+
32
+    render() {
33
+        return (
34
+            <Card style={{margin: 10}}>
35
+                <Card.Title
36
+                    title={this.props.title}
37
+                    subtitle={this.props.subtitle}
38
+                    left={this.getAvatar}
39
+                />
40
+                {this.props.full_picture !== '' && this.props.full_picture !== undefined ?
41
+                    <View style={{marginLeft: 'auto', marginRight: 'auto'}}>
42
+                        <ImageModal
43
+                            resizeMode="contain"
44
+                            imageBackgroundColor={"#000"}
45
+                            style={{
46
+                                width: 250,
47
+                                height: 250,
48
+                            }}
49
+                            source={{
50
+                                uri: this.props.full_picture,
51
+                            }}
52
+                        /></View> : <View/>}
53
+                <Card.Content>
54
+                    {this.props.message !== undefined ?
55
+                        <Autolink
56
+                            text={this.props.message}
57
+                            hashtag="facebook"
58
+                            component={Text}
59
+                        /> : <View/>
60
+                    }
61
+                </Card.Content>
62
+                <Card.Actions>
63
+                    <Button
64
+                        color={'#57aeff'}
65
+                        onPress={this.props.onOutLinkPress}
66
+                        icon={'facebook'}>
67
+                        {i18n.t('homeScreen.dashboard.seeMore')}
68
+                    </Button>
69
+                </Card.Actions>
70
+            </Card>
71
+        );
72
+    }
69 73
 }
70 74
 
71 75
 export default withTheme(FeedItem);

+ 18
- 18
package.json View File

@@ -20,42 +20,42 @@
20 20
     ]
21 21
   },
22 22
   "dependencies": {
23
-    "@expo/vector-icons": "~10.0.0",
24
-    "@react-native-community/masked-view": "0.1.5",
23
+    "@expo/vector-icons": "^10.0.0",
24
+    "@react-native-community/masked-view": "0.1.6",
25 25
     "@react-navigation/bottom-tabs": "^5.1.1",
26 26
     "@react-navigation/drawer": "^5.1.1",
27 27
     "@react-navigation/material-bottom-tabs": "^5.1.1",
28 28
     "@react-navigation/native": "^5.0.9",
29 29
     "@react-navigation/stack": "^5.1.1",
30
-    "expo": "^36.0.0",
31
-    "expo-linear-gradient": "~8.0.0",
32
-    "expo-localization": "~8.0.0",
33
-    "expo-permissions": "~8.0.0",
34
-    "expo-secure-store": "~8.0.0",
35
-    "expo-web-browser": "~8.0.0",
30
+    "expo": "^37.0.0",
31
+    "expo-linear-gradient": "~8.1.0",
32
+    "expo-localization": "~8.1.0",
33
+    "expo-permissions": "~8.1.0",
34
+    "expo-secure-store": "~8.1.0",
35
+    "expo-web-browser": "~8.1.0",
36 36
     "i18n-js": "^3.3.0",
37 37
     "react": "16.9.0",
38 38
     "react-dom": "16.9.0",
39
-    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz",
40
-    "react-native-app-intro-slider": "^3.0.0",
41
-    "react-native-appearance": "~0.3.1",
42
-    "react-native-autolink": "^1.8.1",
39
+    "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.0.tar.gz",
40
+    "react-native-app-intro-slider": "^4.0.0",
41
+    "react-native-appearance": "~0.3.3",
42
+    "react-native-autolink": "^3.0.0",
43 43
     "react-native-calendars": "^1.260.0",
44
-    "react-native-gesture-handler": "~1.5.0",
44
+    "react-native-gesture-handler": "~1.6.0",
45 45
     "react-native-image-modal": "^1.0.1",
46 46
     "react-native-modalize": "^1.3.6",
47 47
     "react-native-paper": "^3.6.0",
48
-    "react-native-reanimated": "~1.4.0",
48
+    "react-native-reanimated": "~1.7.0",
49 49
     "react-native-render-html": "^4.1.2",
50
-    "react-native-safe-area-context": "0.6.0",
51
-    "react-native-screens": "2.0.0-alpha.12",
52
-    "react-native-webview": "7.4.3"
50
+    "react-native-safe-area-context": "0.7.3",
51
+    "react-native-screens": "~2.2.0",
52
+    "react-native-webview": "8.1.1"
53 53
   },
54 54
   "devDependencies": {
55 55
     "@babel/cli": "^7.8.4",
56 56
     "@babel/core": "^7.9.0",
57 57
     "@babel/preset-flow": "^7.9.0",
58
-    "babel-preset-expo": "^8.0.0",
58
+    "babel-preset-expo": "^8.1.0",
59 59
     "flow-bin": "^0.122.0",
60 60
     "jest": "^25.1.0",
61 61
     "jest-extended": "^0.11.5",

Loading…
Cancel
Save