Browse Source

Added used libs page

keplyx 2 years ago
parent
commit
18fae8346f

+ 2
- 2
app.json View File

@@ -9,7 +9,7 @@
9 9
       "android",
10 10
       "web"
11 11
     ],
12
-    "version": "1.0.0",
12
+    "version": "0.0.1",
13 13
     "orientation": "portrait",
14 14
     "icon": "./assets/icon.png",
15 15
     "splash": {
@@ -27,4 +27,4 @@
27 27
       "supportsTablet": true
28 28
     }
29 29
   }
30
-}
30
+}

+ 2
- 1
navigation/AppNavigator.js View File

@@ -2,12 +2,13 @@ import {createAppContainer, createStackNavigator} from 'react-navigation';
2 2
 
3 3
 import MainDrawerNavigator from './MainDrawerNavigator';
4 4
 import ProximoListScreen from '../screens/Proximo/ProximoListScreen';
5
-
5
+import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen';
6 6
 
7 7
 export default createAppContainer(
8 8
     createStackNavigator({
9 9
             Main: MainDrawerNavigator,
10 10
             ProximoListScreen: {screen: ProximoListScreen},
11
+            AboutDependenciesScreen: {screen: AboutDependenciesScreen},
11 12
         },
12 13
         {
13 14
             initialRouteName: "Main",

+ 1
- 1
navigation/MainDrawerNavigator.js View File

@@ -6,7 +6,7 @@ import PlanningScreen from '../screens/PlanningScreen';
6 6
 import ProxiwashScreen from '../screens/ProxiwashScreen';
7 7
 import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen';
8 8
 import SettingsScreen from '../screens/SettingsScreen';
9
-import AboutScreen from '../screens/AboutScreen';
9
+import AboutScreen from '../screens/About/AboutScreen';
10 10
 import SideMenu from "../components/SideMenu";
11 11
 
12 12
 

+ 47
- 0
screens/About/AboutDependenciesScreen.js View File

@@ -0,0 +1,47 @@
1
+import React from 'react';
2
+import {Container, Text, Content, ListItem, Body, Left, Thumbnail, Right, Button, Icon} from 'native-base';
3
+import CustomHeader from "../../components/CustomHeader";
4
+import {FlatList} from "react-native";
5
+import i18n from "i18n-js";
6
+
7
+function generateListFromObject(object) {
8
+    let list = [];
9
+    let keys = Object.keys(object);
10
+    let values = Object.values(object);
11
+    for (let i = 0; i < keys.length; i++) {
12
+        list.push({name: keys[i], version: values[i]});
13
+    }
14
+    return list;
15
+}
16
+
17
+
18
+export default class AboutDependenciesScreen extends React.Component {
19
+
20
+    render() {
21
+        const nav = this.props.navigation;
22
+        const data = generateListFromObject(nav.getParam('data', {}));
23
+        return (
24
+            <Container>
25
+                <CustomHeader backButton={true} navigation={nav} title={i18n.t('aboutScreen.libs')} />
26
+                <Content>
27
+                    <FlatList
28
+                        data={data}
29
+                        keyExtractor={(item, index) => item.name}
30
+                        style={{minHeight: 300, width: '100%'}}
31
+                        renderItem={({item}) =>
32
+                            <ListItem>
33
+                                <Body>
34
+                                    <Text>
35
+                                        {item.name}
36
+                                    </Text>
37
+                                    <Text note>
38
+                                        {item.version.replace('^', '')}
39
+                                    </Text>
40
+                                </Body>
41
+                            </ListItem>}
42
+                    />
43
+                </Content>
44
+            </Container>
45
+        );
46
+    }
47
+}

screens/AboutScreen.js → screens/About/AboutScreen.js View File

@@ -1,10 +1,11 @@
1 1
 import React from 'react';
2 2
 import {Platform, StyleSheet, Linking, Alert} from 'react-native';
3 3
 import {Container, Content, Text, Card, CardItem, Body, Icon, Left, Right, Thumbnail, H1} from 'native-base';
4
-import CustomHeader from "../components/CustomHeader";
4
+import CustomHeader from "../../components/CustomHeader";
5 5
 import i18n from "i18n-js";
6
+import appJson from '../../app';
7
+import packageJson from '../../package';
6 8
 
7
-const version = 'a0.0.1';
8 9
 const links = {
9 10
     appstore: 'https://qwant.com',
10 11
     playstore: 'https://qwant.com',
@@ -34,11 +35,11 @@ export default class AboutScreen extends React.Component {
34 35
                     <Card>
35 36
                         <CardItem>
36 37
                             <Left>
37
-                                <Thumbnail square source={require('../assets/amicale.png')}/>
38
+                                <Thumbnail square source={require('../../assets/amicale.png')}/>
38 39
                                 <Body>
39 40
                                     <H1>Amicale INSA Toulouse</H1>
40 41
                                     <Text note>
41
-                                        v.{version}
42
+                                        v.{appJson.expo.version}
42 43
                                     </Text>
43 44
                                 </Body>
44 45
                             </Left>
@@ -204,7 +205,7 @@ export default class AboutScreen extends React.Component {
204 205
                             </Right>
205 206
                         </CardItem>
206 207
                         <CardItem button
207
-                                  onPress={() => console.log('libs')}>
208
+                                  onPress={() => this.props.navigation.navigate('AboutDependenciesScreen', {data: packageJson.dependencies})}>
208 209
                             <Left>
209 210
                                 <Icon active name="developer-board"
210 211
                                       type={'MaterialCommunityIcons'}

Loading…
Cancel
Save