From 18fae8346fed5a6b1a49161ba42405f6c84febfa Mon Sep 17 00:00:00 2001 From: keplyx Date: Thu, 27 Jun 2019 11:08:56 +0200 Subject: [PATCH] Added used libs page --- app.json | 4 +- navigation/AppNavigator.js | 3 +- navigation/MainDrawerNavigator.js | 2 +- screens/About/AboutDependenciesScreen.js | 47 ++++++++++++++++++++++++ screens/{ => About}/AboutScreen.js | 11 +++--- 5 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 screens/About/AboutDependenciesScreen.js rename screens/{ => About}/AboutScreen.js (96%) diff --git a/app.json b/app.json index 0105c44..706e2ca 100644 --- a/app.json +++ b/app.json @@ -9,7 +9,7 @@ "android", "web" ], - "version": "1.0.0", + "version": "0.0.1", "orientation": "portrait", "icon": "./assets/icon.png", "splash": { @@ -27,4 +27,4 @@ "supportsTablet": true } } -} \ No newline at end of file +} diff --git a/navigation/AppNavigator.js b/navigation/AppNavigator.js index 2fb9d45..faed221 100644 --- a/navigation/AppNavigator.js +++ b/navigation/AppNavigator.js @@ -2,12 +2,13 @@ import {createAppContainer, createStackNavigator} from 'react-navigation'; import MainDrawerNavigator from './MainDrawerNavigator'; import ProximoListScreen from '../screens/Proximo/ProximoListScreen'; - +import AboutDependenciesScreen from '../screens/About/AboutDependenciesScreen'; export default createAppContainer( createStackNavigator({ Main: MainDrawerNavigator, ProximoListScreen: {screen: ProximoListScreen}, + AboutDependenciesScreen: {screen: AboutDependenciesScreen}, }, { initialRouteName: "Main", diff --git a/navigation/MainDrawerNavigator.js b/navigation/MainDrawerNavigator.js index d3cd95e..6e422e3 100644 --- a/navigation/MainDrawerNavigator.js +++ b/navigation/MainDrawerNavigator.js @@ -6,7 +6,7 @@ import PlanningScreen from '../screens/PlanningScreen'; import ProxiwashScreen from '../screens/ProxiwashScreen'; import ProximoMainScreen from '../screens/Proximo/ProximoMainScreen'; import SettingsScreen from '../screens/SettingsScreen'; -import AboutScreen from '../screens/AboutScreen'; +import AboutScreen from '../screens/About/AboutScreen'; import SideMenu from "../components/SideMenu"; diff --git a/screens/About/AboutDependenciesScreen.js b/screens/About/AboutDependenciesScreen.js new file mode 100644 index 0000000..688eb18 --- /dev/null +++ b/screens/About/AboutDependenciesScreen.js @@ -0,0 +1,47 @@ +import React from 'react'; +import {Container, Text, Content, ListItem, Body, Left, Thumbnail, Right, Button, Icon} from 'native-base'; +import CustomHeader from "../../components/CustomHeader"; +import {FlatList} from "react-native"; +import i18n from "i18n-js"; + +function generateListFromObject(object) { + let list = []; + let keys = Object.keys(object); + let values = Object.values(object); + for (let i = 0; i < keys.length; i++) { + list.push({name: keys[i], version: values[i]}); + } + return list; +} + + +export default class AboutDependenciesScreen extends React.Component { + + render() { + const nav = this.props.navigation; + const data = generateListFromObject(nav.getParam('data', {})); + return ( + + + + item.name} + style={{minHeight: 300, width: '100%'}} + renderItem={({item}) => + + + + {item.name} + + + {item.version.replace('^', '')} + + + } + /> + + + ); + } +} diff --git a/screens/AboutScreen.js b/screens/About/AboutScreen.js similarity index 96% rename from screens/AboutScreen.js rename to screens/About/AboutScreen.js index 311f3fd..a9187e6 100644 --- a/screens/AboutScreen.js +++ b/screens/About/AboutScreen.js @@ -1,10 +1,11 @@ import React from 'react'; import {Platform, StyleSheet, Linking, Alert} from 'react-native'; import {Container, Content, Text, Card, CardItem, Body, Icon, Left, Right, Thumbnail, H1} from 'native-base'; -import CustomHeader from "../components/CustomHeader"; +import CustomHeader from "../../components/CustomHeader"; import i18n from "i18n-js"; +import appJson from '../../app'; +import packageJson from '../../package'; -const version = 'a0.0.1'; const links = { appstore: 'https://qwant.com', playstore: 'https://qwant.com', @@ -34,11 +35,11 @@ export default class AboutScreen extends React.Component { - +

Amicale INSA Toulouse

- v.{version} + v.{appJson.expo.version}
@@ -204,7 +205,7 @@ export default class AboutScreen extends React.Component {
console.log('libs')}> + onPress={() => this.props.navigation.navigate('AboutDependenciesScreen', {data: packageJson.dependencies})}>