diff --git a/app/containers/routes/PublicRoutes.js b/app/containers/routes/PublicRoutes.js index 92781c00d471f50bc538561b151d707cb8073c21..41c267173c0de193b965b1b2665bed15a1233545 100644 --- a/app/containers/routes/PublicRoutes.js +++ b/app/containers/routes/PublicRoutes.js @@ -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: { diff --git a/app/views/LoginView.js b/app/views/LoginView.js index f27741bc37a6c3257f3dc49163df64a5e4ea33a4..4ee33cae8e7d147085a9d9b2d23d6cc1d9e9af90 100644 --- a/app/views/LoginView.js +++ b/app/views/LoginView.js @@ -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> diff --git a/app/views/PrivacyPolicyView.js b/app/views/PrivacyPolicyView.js new file mode 100644 index 0000000000000000000000000000000000000000..e4f96abc18701cbae0866c7758225a9d379de10f --- /dev/null +++ b/app/views/PrivacyPolicyView.js @@ -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); diff --git a/app/views/TermsServiceView.js b/app/views/TermsServiceView.js new file mode 100644 index 0000000000000000000000000000000000000000..b56abca08a0b2b711af7fe127a0d1bd6d653750c --- /dev/null +++ b/app/views/TermsServiceView.js @@ -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);