Guest User

Untitled

a guest
Feb 17th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. import React , {Component} from 'react';
  2. import { View, Text, ScrollView, Dimensions, TouchableOpacity } from 'react-native';
  3.  
  4. const isCloseToBottom = ({layoutMeasurement, contentOffset, contentSize}) => {
  5. const paddingToBottom = 20;
  6. return layoutMeasurement.height + contentOffset.y >=
  7. contentSize.height - paddingToBottom;
  8. };
  9.  
  10. class TermsAndConditions extends Component{
  11.  
  12. state = {
  13. accepted: false
  14. }
  15.  
  16. render(){
  17. return (
  18. <View style={styles.container}>
  19. <Text style={styles.title}>Terms and conditions</Text>
  20. <ScrollView
  21. style={styles.tcContainer}
  22. onScroll={({nativeEvent}) => {
  23. if (isCloseToBottom(nativeEvent)) {
  24. this.setState({
  25. accepted: true
  26. })
  27. }
  28. }}
  29. >
  30. <Text style={styles.tcP}>Welcome to our website. If you continue to browse and use this website, you are agreeing to comply with and be bound by the following terms and conditions of use, which together with our privacy policy govern [business name]’s relationship with you in relation to this website. If you disagree with any part of these terms and conditions, please do not use our website.</Text>
  31. <Text style={styles.tcP}>The term ‘[business name]’ or ‘us’ or ‘we’ refers to the owner of the website whose registered office is [address]. Our company registration number is [company registration number and place of registration]. The term ‘you’ refers to the user or viewer of our website.</Text>
  32. <Text style={styles.tcL}>{'\u2022'} The content of the pages of this website is for your general information and use only. It is subject to change without notice.</Text>
  33. <Text style={styles.tcL}>{'\u2022'} This website uses cookies to monitor browsing preferences. If you do allow cookies to be used, the following personal information may be stored by us for use by third parties: [insert list of information].</Text>
  34. <Text style={styles.tcL}>{'\u2022'} Neither we nor any third parties provide any warranty or guarantee as to the accuracy, timeliness, performance, completeness or suitability of the information and materials found or offered on this website for any particular purpose. You acknowledge that such information and materials may contain inaccuracies or errors and we expressly exclude liability for any such inaccuracies or errors to the fullest extent permitted by law.</Text>
  35. <Text style={styles.tcL}>{'\u2022'} Your use of any information or materials on this website is entirely at your own risk, for which we shall not be liable. It shall be your own responsibility to ensure that any products, services or information available through this website meet your specific requirements.</Text>
  36. <Text style={styles.tcL}>{'\u2022'} This website contains material which is owned by or licensed to us. This material includes, but is not limited to, the design, layout, look, appearance and graphics. Reproduction is prohibited other than in accordance with the copyright notice, which forms part of these terms and conditions.</Text>
  37. <Text style={styles.tcL}>{'\u2022'} All trademarks reproduced in this website, which are not the property of, or licensed to the operator, are acknowledged on the website.
  38. Unauthorised use of this website may give rise to a claim for damages and/or be a criminal offence.</Text>
  39. <Text style={styles.tcL}>{'\u2022'} From time to time, this website may also include links to other websites. These links are provided for your convenience to provide further information. They do not signify that we endorse the website(s). We have no responsibility for the content of the linked website(s).</Text>
  40. <Text style={styles.tcL}>{'\u2022'} Your use of this website and any dispute arising out of such use of the website is subject to the laws of England, Northern Ireland, Scotland and Wales.</Text>
  41. <Text style={styles.tcP}>The use of this website is subject to the following terms of use</Text>
  42. </ScrollView>
  43.  
  44. <TouchableOpacity disabled={ !this.state.accepted } onPress={ ()=>alert("Terms and conditions accepted") } style={ this.state.accepted ? styles.button : styles.buttonDisabled }><Text style={styles.buttonLabel}>Accept</Text></TouchableOpacity>
  45. </View>
  46. );
  47. }
  48.  
  49. }
  50.  
  51. const { width , height } = Dimensions.get('window');
  52.  
  53. const styles = {
  54.  
  55. container:{
  56. marginTop: 20,
  57. marginLeft: 10,
  58. marginRight: 10
  59. },
  60. title: {
  61. fontSize: 22,
  62. alignSelf: 'center'
  63. },
  64. tcP: {
  65. marginTop: 10,
  66. marginBottom: 10,
  67. fontSize: 12
  68. },
  69. tcP:{
  70. marginTop: 10,
  71. fontSize: 12
  72. },
  73. tcL:{
  74. marginLeft: 10,
  75. marginTop: 10,
  76. marginBottom: 10,
  77. fontSize: 12
  78. },
  79. tcContainer: {
  80. marginTop: 15,
  81. marginBottom: 15,
  82. height: height * .7
  83. },
  84.  
  85. button:{
  86. backgroundColor: '#136AC7',
  87. borderRadius: 5,
  88. padding: 10
  89. },
  90.  
  91. buttonDisabled:{
  92. backgroundColor: '#999',
  93. borderRadius: 5,
  94. padding: 10
  95. },
  96.  
  97. buttonLabel:{
  98. fontSize: 14,
  99. color: '#FFF',
  100. alignSelf: 'center'
  101. }
  102.  
  103. }
  104.  
  105. export default TermsAndConditions;
Add Comment
Please, Sign In to add comment