Terms & privacy (#63)
* terms and privacy * Update PublicRoutes.js * Update LoginView.js
This commit is contained in:
parent
1ac5d07761
commit
a568e826e5
|
@ -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(
|
||||
|
@ -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: {
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
@ -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>
|
||||
|
|
|
@ -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);
|
|
@ -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);
|
Loading…
Reference in New Issue