Skip to content

Commit

Permalink
Terms & privacy (#63)
Browse files Browse the repository at this point in the history
* terms and privacy

* Update PublicRoutes.js

* Update LoginView.js
  • Loading branch information
diegolmello authored and ggazzo committed Nov 13, 2017
1 parent 1ac5d07 commit a568e82
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/containers/routes/PublicRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import ListServerView from '../../views/ListServerView';
import NewServerView from '../../views/NewServerView';
import LoginView from '../../views/LoginView';
import RegisterView from '../../views/RegisterView';

import TermsServiceView from '../../views/TermsServiceView';
import PrivacyPolicyView from '../../views/PrivacyPolicyView';
import ForgotPasswordView from '../../views/ForgotPasswordView';

const PublicRoutes = StackNavigator(
Expand Down Expand Up @@ -45,6 +48,18 @@ const PublicRoutes = StackNavigator(
title: 'Register'
}
},
TermsService: {
screen: TermsServiceView,
navigationOptions: {
title: 'Terms of service'
}
},
PrivacyPolicy: {
screen: PrivacyPolicyView,
navigationOptions: {
title: 'Privacy policy'
}
},
ForgotPassword: {
screen: ForgotPasswordView,
navigationOptions: {
Expand Down
15 changes: 15 additions & 0 deletions app/views/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ class LoginView extends React.Component {
this.props.navigation.navigate('Register');
}

termsService = () => {
this.props.navigation.navigate('TermsService');
}

privacyPolicy = () => {
this.props.navigation.navigate('PrivacyPolicy');
}

forgotPassword = () => {
this.props.navigation.navigate('ForgotPassword');
}
Expand Down Expand Up @@ -114,6 +122,13 @@ class LoginView extends React.Component {
<Text style={styles.button} onPress={this.register}>REGISTER</Text>
</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}>
<Text style={styles.button}>FORGOT MY PASSWORD</Text>
</TouchableOpacity>
Expand Down
28 changes: 28 additions & 0 deletions app/views/PrivacyPolicyView.js
Original file line number Diff line number Diff line change
@@ -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);
28 changes: 28 additions & 0 deletions app/views/TermsServiceView.js
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit a568e82

Please sign in to comment.