Added used libs page
This commit is contained in:
parent
356d7c2092
commit
18fae8346f
5 changed files with 58 additions and 9 deletions
4
app.json
4
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
||||
|
|
47
screens/About/AboutDependenciesScreen.js
Normal file
47
screens/About/AboutDependenciesScreen.js
Normal file
|
@ -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 (
|
||||
<Container>
|
||||
<CustomHeader backButton={true} navigation={nav} title={i18n.t('aboutScreen.libs')} />
|
||||
<Content>
|
||||
<FlatList
|
||||
data={data}
|
||||
keyExtractor={(item, index) => item.name}
|
||||
style={{minHeight: 300, width: '100%'}}
|
||||
renderItem={({item}) =>
|
||||
<ListItem>
|
||||
<Body>
|
||||
<Text>
|
||||
{item.name}
|
||||
</Text>
|
||||
<Text note>
|
||||
{item.version.replace('^', '')}
|
||||
</Text>
|
||||
</Body>
|
||||
</ListItem>}
|
||||
/>
|
||||
</Content>
|
||||
</Container>
|
||||
);
|
||||
}
|
||||
}
|
|
@ -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 {
|
|||
<Card>
|
||||
<CardItem>
|
||||
<Left>
|
||||
<Thumbnail square source={require('../assets/amicale.png')}/>
|
||||
<Thumbnail square source={require('../../assets/amicale.png')}/>
|
||||
<Body>
|
||||
<H1>Amicale INSA Toulouse</H1>
|
||||
<Text note>
|
||||
v.{version}
|
||||
v.{appJson.expo.version}
|
||||
</Text>
|
||||
</Body>
|
||||
</Left>
|
||||
|
@ -204,7 +205,7 @@ export default class AboutScreen extends React.Component {
|
|||
</Right>
|
||||
</CardItem>
|
||||
<CardItem button
|
||||
onPress={() => console.log('libs')}>
|
||||
onPress={() => this.props.navigation.navigate('AboutDependenciesScreen', {data: packageJson.dependencies})}>
|
||||
<Left>
|
||||
<Icon active name="developer-board"
|
||||
type={'MaterialCommunityIcons'}
|
Loading…
Reference in a new issue