From 87ea67cc2d10f5d5abbad4308222aacd3072f6af Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 6 Feb 2016 16:46:41 +0000 Subject: [PATCH] Add info button --- .nvmrc | 1 + app/components/navigation/BackButton.js | 4 +-- app/components/navigation/InfoButton.js | 43 ++++++++++++++++++++++++ app/components/navigation/RouteMapper.js | 6 +++- package.json | 1 + 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .nvmrc create mode 100644 app/components/navigation/InfoButton.js diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..268fccb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v5.5.0 diff --git a/app/components/navigation/BackButton.js b/app/components/navigation/BackButton.js index 1e7d637..b61ca40 100644 --- a/app/components/navigation/BackButton.js +++ b/app/components/navigation/BackButton.js @@ -14,7 +14,7 @@ const styles = StyleSheet.create({ justifyContent: 'center', }, toolbarButton: { - paddingHorizontal: 10, + paddingHorizontal: 15, }, text: { color: GlobalStyles.get('CIRCLE_NAVBAR_TEXT') @@ -36,7 +36,7 @@ export default class NavigationButton extends React.Component { style={styles.toolbarButton} underlayColor={GlobalStyles.get('CIRCLE_NAVBAR_BG')} onPress={this.goBack.bind(this)}> - B + < ); diff --git a/app/components/navigation/InfoButton.js b/app/components/navigation/InfoButton.js new file mode 100644 index 0000000..a941f77 --- /dev/null +++ b/app/components/navigation/InfoButton.js @@ -0,0 +1,43 @@ +import React from 'react-native'; +import GlobalStyles from '../../settings/styles'; +import RouteMaster from '../routes/RouteMaster'; + +var { + StyleSheet, + TouchableHighlight, + View, + Text +} = React; + +const styles = StyleSheet.create({ + container: { + flex: 1, + justifyContent: 'center', + }, + toolbarButton: { + paddingHorizontal: 15, + }, + text: { + color: GlobalStyles.get('CIRCLE_NAVBAR_TEXT'), + fontSize: 18, + fontStyle: 'italic' + } +}); + +export default class InfoButton extends React.Component { + showInfo() { + this.props.nav.push(RouteMaster.get('INFO')); + } + render() { + return ( + + + i + + + ); + } +} diff --git a/app/components/navigation/RouteMapper.js b/app/components/navigation/RouteMapper.js index d0645cf..2c1ef3a 100644 --- a/app/components/navigation/RouteMapper.js +++ b/app/components/navigation/RouteMapper.js @@ -2,6 +2,7 @@ import React from 'react-native'; // eslint-disable-line no-unused-vars import NavigationTitle from './Title'; import NavigationBackButton from './BackButton'; +import NavigationInfoButton from './InfoButton'; import { View } from 'react-native'; @@ -10,11 +11,14 @@ export default { LeftButton(route, nav, index, navState) { return ( - + ); }, RightButton(route, nav, index, navState) { + if (route.id === 'login') { + return ; + } return ( ); diff --git a/package.json b/package.json index 0c8b9fc..d88fe8a 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "eslint-plugin-react-native": "=0.5.0", "react": "=0.14.6", "react-addons-test-utils": "=0.14.6", + "svg2png": "^3.0.0", "url": "=0.11.0" } }