Advertisement
enkf

Untitled

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