Advertisement
enkf

Untitled

Jan 9th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.07 KB | None | 0 0
  1. import React from 'react';
  2. import {
  3. StyleSheet,
  4. View,
  5. Text,
  6. TextInput,
  7. TouchableOpacity,
  8. BackHandler,
  9. Image,
  10. ScrollView
  11. } from 'react-native';
  12. import {
  13. Container,
  14. Header,
  15. Card,
  16. CardItem,
  17. Button,
  18. Left,
  19. Right,
  20. Body,
  21. Thumbnail,
  22. Icon,
  23. } from 'native-base';
  24. import { withNavigation } from 'react-navigation';
  25.  
  26. class Home extends React.Component {
  27.  
  28.  
  29. constructor(props) {
  30. super(props);
  31. this.state = {
  32.  
  33.  
  34. };
  35. }
  36.  
  37. static navigationOptions = {
  38. // title: 'Booking',
  39. headerStyle: {
  40. headerTintColor: '#E91E63',
  41. },
  42. headerTitleStyle: {
  43. fontWeight: 'bold',
  44. },
  45. };
  46. ComponentWillMount() {
  47. BackHandler.addEventListener('hardwareBackPress', () => {
  48. if (!this.onMainScreen()) {
  49. this.goBack();
  50. return true;
  51. }
  52. return false;
  53. });
  54. }
  55.  
  56. render() {
  57. return (
  58. <Container>
  59. <View>
  60. <Header style={{ backgroundColor: '#E91E63' }} />
  61. <ScrollView>
  62. <View style={{ flex: 1, alignItems: 'center' }}>
  63. <Text style={{ fontSize: 16 }}>{this.state.curTime}</Text>
  64. </View>
  65.  
  66.  
  67. <CardItem>
  68. <View style={{ marginHorizontal: 10 }}></View>
  69. <Left>
  70. <Thumbnail
  71. style={{ width: 80, height: 80 }}
  72. source={require('../asset/images/man-user.png')}
  73. />
  74. <Body>
  75. <Text>Nama</Text>
  76. <Text note>Telp</Text>
  77. <Text>Jumlah Point</Text>
  78. </Body>
  79. </Left>
  80. </CardItem>
  81. <View
  82. style={{
  83. flexDirection: 'row',
  84. flexWrap: 'wrap',
  85. marginHorizontal: 50,
  86. marginTop: 50,
  87. }}></View>
  88. <View
  89. style={{
  90. flexDirection: 'row',
  91. flexWrap: 'wrap',
  92. marginHorizontal: 18,
  93. marginTop: 18,
  94. }}>
  95. <View
  96. style={{
  97. justifyContent: 'space-between',
  98. flexDirection: 'row',
  99. width: '100%',
  100. marginBottom: 18,
  101. }}>
  102. <View>
  103. <TouchableOpacity onPress={() => this.props.navigation.navigate('treatment')}>
  104. <View
  105. style={{
  106. width: 100,
  107. height: 100,
  108. borderWidth: 1,
  109. borderColor: '#EFEFEF',
  110. borderRadius: 18,
  111. }}>
  112. <Image
  113. source={require('../asset/images/color/service.png')}
  114. style={{ height: 80, width: 100, flex: 1 }}
  115. />
  116. </View>
  117. <Text
  118. style={{
  119. fontSize: 12,
  120. fontWeight: 'bold',
  121. textAlign: 'center',
  122. color: '#E91E63',
  123. }}>
  124. Treatment
  125. </Text>
  126. </TouchableOpacity>
  127. </View>
  128. <View>
  129. <TouchableOpacity onPress={() => this.props.navigation.navigate('booking')}>
  130. <View
  131. style={{
  132. width: 100,
  133. height: 100,
  134. borderWidth: 1,
  135. borderColor: '#EFEFEF',
  136. borderRadius: 18,
  137. }}>
  138. <Image
  139. source={require('../asset/images/color/booking.png')}
  140. style={{ height: 80, width: 100, flex: 1 }}
  141. />
  142. </View>
  143. <Text
  144. style={{
  145. fontSize: 12,
  146. fontWeight: 'bold',
  147. textAlign: 'center',
  148. color: '#E91E63',
  149. }}>
  150. Booking
  151. </Text>
  152. </TouchableOpacity>
  153. </View>
  154. <View>
  155. <TouchableOpacity onPress={() => this.props.navigation.navigate('promotion')}>
  156. <View
  157. style={{
  158. width: 100,
  159. height: 100,
  160. borderWidth: 1,
  161. borderColor: '#EFEFEF',
  162. borderRadius: 18,
  163. }}>
  164. <Image
  165. source={require('../asset/images/color/promo.png')}
  166. style={{ height: 80, width: 100, flex: 1 }}
  167. />
  168. </View>
  169. <Text
  170. style={{
  171. fontSize: 12,
  172. fontWeight: 'bold',
  173. textAlign: 'center',
  174. color: '#E91E63',
  175. }}>
  176. Promotion
  177. </Text>
  178. </TouchableOpacity>
  179. </View>
  180. </View>
  181. </View>
  182.  
  183. <View
  184. style={{
  185. flexDirection: 'row',
  186. flexWrap: 'wrap',
  187. marginHorizontal: 18,
  188. marginTop: 18,
  189. }}>
  190. <View
  191. style={{
  192. justifyContent: 'space-between',
  193. flexDirection: 'row',
  194. width: '100%',
  195. marginBottom: 18,
  196. }}>
  197. <View>
  198. <TouchableOpacity onPress={() => this.props.navigation.navigate('point')}>
  199. <View
  200. style={{
  201. width: 100,
  202. height: 100,
  203. borderWidth: 1,
  204. borderColor: '#EFEFEF',
  205. borderRadius: 18,
  206. }}>
  207. <Image
  208. source={require('../asset/images/color/point.png')}
  209. style={{ height: 80, width: 100, flex: 1 }}
  210. />
  211. </View>
  212. <Text
  213. style={{
  214. fontSize: 12,
  215. fontWeight: 'bold',
  216. textAlign: 'center',
  217. color: '#E91E63',
  218. }}>
  219. Point
  220. </Text>
  221. </TouchableOpacity>
  222. </View>
  223. <View>
  224. <TouchableOpacity>
  225. <View
  226. style={{
  227. width: 100,
  228. height: 100,
  229. borderWidth: 1,
  230. borderColor: '#EFEFEF',
  231. borderRadius: 18,
  232. }}>
  233. <Image
  234. source={require('../asset/images/color/spin.png')}
  235. style={{ height: 80, width: 100, flex: 1 }}
  236. />
  237. </View>
  238. <Text
  239. style={{
  240. fontSize: 12,
  241. fontWeight: 'bold',
  242. textAlign: 'center',
  243. color: '#E91E63',
  244. }}>
  245. Spin
  246. </Text>
  247. </TouchableOpacity>
  248. </View>
  249. <View>
  250. <TouchableOpacity onPress={() => this.props.navigation.navigate('contact')}>
  251. <View
  252. style={{
  253. width: 100,
  254. height: 100,
  255. borderWidth: 1,
  256. borderColor: '#EFEFEF',
  257. borderRadius: 18,
  258. }}>
  259. <Image
  260. source={require('../asset/images/color/contact.png')}
  261. style={{ height: 80, width: 100, flex: 1 }}
  262. />
  263. </View>
  264. <Text
  265. style={{
  266. fontSize: 12,
  267. fontWeight: 'bold',
  268. textAlign: 'center',
  269. color: '#E91E63',
  270. }}>
  271. Contact
  272. </Text>
  273. </TouchableOpacity>
  274. </View>
  275. </View>
  276. </View>
  277. </ScrollView>
  278. </View>
  279. </Container>
  280. );
  281. }
  282. }
  283.  
  284. export default withNavigation(Home);
  285. const styles = StyleSheet.create({
  286. container: {
  287. flex: 1,
  288. justifyContent: 'center',
  289. alignItems: 'center',
  290. },
  291. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement