Terms & privacy (#63)

* terms and privacy

* Update PublicRoutes.js

* Update LoginView.js
This commit is contained in:
Diego Mello 2017-11-13 11:32:46 -02:00 committed by Guilherme Gazzo
parent 1ac5d07761
commit a568e826e5
4 changed files with 86 additions and 0 deletions

View File

@ -7,6 +7,9 @@ import ListServerView from '../../views/ListServerView';
import NewServerView from '../../views/NewServerView'; import NewServerView from '../../views/NewServerView';
import LoginView from '../../views/LoginView'; import LoginView from '../../views/LoginView';
import RegisterView from '../../views/RegisterView'; import RegisterView from '../../views/RegisterView';
import TermsServiceView from '../../views/TermsServiceView';
import PrivacyPolicyView from '../../views/PrivacyPolicyView';
import ForgotPasswordView from '../../views/ForgotPasswordView'; import ForgotPasswordView from '../../views/ForgotPasswordView';
const PublicRoutes = StackNavigator( const PublicRoutes = StackNavigator(
@ -45,6 +48,18 @@ const PublicRoutes = StackNavigator(
title: 'Register' title: 'Register'
} }
}, },
TermsService: {
screen: TermsServiceView,
navigationOptions: {
title: 'Terms of service'
}
},
PrivacyPolicy: {
screen: PrivacyPolicyView,
navigationOptions: {
title: 'Privacy policy'
}
},
ForgotPassword: { ForgotPassword: {
screen: ForgotPasswordView, screen: ForgotPasswordView,
navigationOptions: { navigationOptions: {

View File

@ -49,6 +49,14 @@ class LoginView extends React.Component {
this.props.navigation.navigate('Register'); this.props.navigation.navigate('Register');
} }
termsService = () => {
this.props.navigation.navigate('TermsService');
}
privacyPolicy = () => {
this.props.navigation.navigate('PrivacyPolicy');
}
forgotPassword = () => { forgotPassword = () => {
this.props.navigation.navigate('ForgotPassword'); this.props.navigation.navigate('ForgotPassword');
} }
@ -114,6 +122,13 @@ class LoginView extends React.Component {
<Text style={styles.button} onPress={this.register}>REGISTER</Text> <Text style={styles.button} onPress={this.register}>REGISTER</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={styles.buttonContainer} onPress={this.termsService}>
<Text style={styles.button}>TERMS OF SERVICE</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonContainer} onPress={this.privacyPolicy}>
<Text style={styles.button}>PRIVACY POLICY</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonContainer} onPress={this.forgotPassword}> <TouchableOpacity style={styles.buttonContainer} onPress={this.forgotPassword}>
<Text style={styles.button}>FORGOT MY PASSWORD</Text> <Text style={styles.button}>FORGOT MY PASSWORD</Text>
</TouchableOpacity> </TouchableOpacity>

View File

@ -0,0 +1,28 @@
import React from 'react';
import PropTypes from 'prop-types';
import { WebView } from 'react-native';
import { connect } from 'react-redux';
class PrivacyPolicyView extends React.Component {
static propTypes = {
privacyPolicy: PropTypes.string
}
static navigationOptions = () => ({
title: 'Terms of service'
});
render() {
return (
<WebView source={{ html: this.props.privacyPolicy }} />
);
}
}
function mapStateToProps(state) {
return {
privacyPolicy: state.settings.Layout_Privacy_Policy
};
}
export default connect(mapStateToProps)(PrivacyPolicyView);

View File

@ -0,0 +1,28 @@
import React from 'react';
import PropTypes from 'prop-types';
import { WebView } from 'react-native';
import { connect } from 'react-redux';
class TermsServiceView extends React.Component {
static propTypes = {
termsService: PropTypes.string
}
static navigationOptions = () => ({
title: 'Terms of service'
});
render() {
return (
<WebView source={{ html: this.props.termsService }} />
);
}
}
function mapStateToProps(state) {
return {
termsService: state.settings.Layout_Terms_of_Service
};
}
export default connect(mapStateToProps)(TermsServiceView);