Advertisement
Eko_Sariyanto

Untitled

Jan 22nd, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. import React from 'react';
  2. import { Text, View, TouchableOpacity, StyleSheet, Button, Image, ScrollView, BackHandler, RefreshControl, TextInput, ActivityIndicator, PermissionsAndroid, Platform } from 'react-native';
  3.  
  4.  
  5. export default class App extends React.Component {
  6.  
  7. constructor(props) {
  8. super(props);
  9.  
  10. this.state = {
  11. refreshing: false,
  12.  
  13. }
  14. }
  15.  
  16.  
  17. componentDidMount = () => {
  18.  
  19.  
  20.  
  21. fetch('https://tracessystem.com/apitraces/AA_open_user.php',
  22. {
  23. method: 'POST',
  24. headers:
  25. {
  26. 'Accept': 'application/json',
  27. 'Content-Type': 'application/json',
  28. },
  29. body: JSON.stringify(
  30. {
  31. username: 'mikel@taysbakers.com',
  32. password: '123456'
  33.  
  34.  
  35. })
  36. })
  37. .then((response) => response.json())
  38. .then((responseJson) => {
  39. this.setState({
  40. idusernya: responseJson[0].id_user,
  41. Namanya: responseJson[0].nama_lengkap,
  42. jobnya: responseJson[0].jobs_title,
  43. emailnya: responseJson[0].email,
  44. phonenya: responseJson[0].phone,
  45. companynya: responseJson[0].company,
  46. alamatnya: responseJson[0].alamat,
  47. countrynya: responseJson[0].country,
  48. telpnnya: responseJson[0].no_telpn,
  49. imagenya: responseJson[0].image,
  50. })
  51.  
  52. })
  53. .catch((error) => {
  54. console.error(error);
  55. });
  56.  
  57. }
  58.  
  59.  
  60.  
  61.  
  62.  
  63. render() {
  64. const namanyaya=this.state.Namanya
  65. return (
  66. <ScrollView>
  67. <View style={styles.MainContainer}>
  68.  
  69. <View style={styles.bodyContent}>
  70. <Text>{namanyaya}</Text>
  71. <Text></Text>
  72. <Text></Text>
  73.  
  74. </View>
  75. </View>
  76.  
  77. </ScrollView>
  78.  
  79. );
  80.  
  81. }
  82. }
  83.  
  84. const styles = StyleSheet.create({
  85. header: {
  86. backgroundColor: "black",
  87. height: 20,
  88. },
  89.  
  90.  
  91. avatar: {
  92. width: 150,
  93. height: 150,
  94. borderRadius: 80,
  95. borderWidth: 0.1,
  96. borderColor: "gray",
  97. marginBottom: 10,
  98. position: 'absolute',
  99. marginTop: -15,
  100. marginLeft: 150
  101. },
  102.  
  103. body: {
  104. marginTop: 20,
  105. },
  106.  
  107. MainContainer:
  108. {
  109. flex: 1,
  110. margin: 20,
  111. left: -30
  112. },
  113.  
  114. centertext: {
  115. height: 50,
  116. textAlign: 'center',
  117. color: 'grey',
  118. fontSize: 30,
  119. width: '100%',
  120. borderColor: '#009688',
  121. backgroundColor: "#52c5d8",
  122. marginBottom: 10
  123. },
  124. centeringButtonDetail: {
  125. flex: 1,
  126. flexDirection: "row",
  127. justifyContent: 'center',
  128. alignItems: 'center',
  129.  
  130. },
  131. uploadAvatar: {
  132. height: 100,
  133. width: 100,
  134. borderRadius: 10,
  135. },
  136. conPreview: {
  137. flex: 8,
  138. alignItems: 'center',
  139. justifyContent: 'center',
  140. },
  141. containerImage: {
  142.  
  143. backgroundColor: "#52c5d8",
  144. justifyContent: 'center',
  145. alignItems: 'center',
  146. marginBottom: 45,
  147. },
  148. containerTakeFoto: {
  149.  
  150.  
  151. justifyContent: 'center',
  152. alignItems: 'center',
  153. marginBottom: 15,
  154. },
  155.  
  156. Merge: { flexDirection: "row" },
  157. rowingdata: {
  158.  
  159. width: "100%",
  160. flexDirection: "row",
  161. justifyContent: "space-between",
  162. alignItems: "center"
  163.  
  164. },
  165.  
  166. centeringButton: {
  167. justifyContent: 'center',
  168. alignItems: 'center',
  169. },
  170.  
  171. TextInputStyleClass:
  172. {
  173.  
  174. textAlign: 'center',
  175. height: 40,
  176. backgroundColor: "#fff",
  177. flexDirection: "row",
  178. // borderWidth: 1,
  179. // borderColor: '#009688',
  180. // borderRadius: 7,
  181. marginBottom: 10,
  182. width: '60%'
  183. },
  184.  
  185. TouchableOpacityStyle:
  186. {
  187. backgroundColor: "#f78f20",
  188. // height: '30%',
  189. justifyContent: 'center',
  190. alignItems: 'center',
  191. width: 100,
  192. height: 40,
  193. borderRadius: 25,
  194. marginHorizontal: 10,
  195.  
  196.  
  197.  
  198. },
  199.  
  200. TouchableOpacityStyleProfile:
  201. {
  202. backgroundColor: "#f78f20",
  203. // height: '30%',
  204. justifyContent: 'center',
  205. alignItems: 'center',
  206. width: 200,
  207. height: 200,
  208. borderRadius: 100,
  209. marginHorizontal: 10,
  210.  
  211.  
  212.  
  213. },
  214. TouchableTakeFoto:
  215. {
  216.  
  217. // height: '30%',
  218. justifyContent: 'center',
  219. alignItems: 'center',
  220.  
  221.  
  222.  
  223. },
  224. BoxCust:
  225. {
  226. textAlign: 'center',
  227. color: 'grey',
  228. fontSize: 30,
  229. borderWidth: 0.2,
  230. backgroundColor: "#fff",
  231. // height: '30%',
  232. justifyContent: 'center',
  233. alignItems: 'center',
  234. width: 320,
  235. height: 50,
  236. borderRadius: 17,
  237. position: 'absolute',
  238. top: 90,
  239.  
  240. },
  241.  
  242. TextStyle:
  243. {
  244. color: '#fff',
  245. textAlign: 'center',
  246. fontSize: 18
  247. },
  248.  
  249. BorddererText:
  250. {
  251. color: 'grey',
  252. textAlign: 'left',
  253. fontSize: 18,
  254. marginRight: 10,
  255. marginLeft: 30,
  256. fontWeight: 'bold',
  257. flexDirection: "row"
  258. },
  259.  
  260. ActivityIndicatorStyle: {
  261.  
  262. position: 'absolute',
  263. left: 0,
  264. right: 0,
  265. top: 0,
  266. bottom: 0,
  267. alignItems: 'center',
  268. justifyContent: 'center'
  269.  
  270. }
  271. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement