Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.11 KB | None | 0 0
  1. //import liraries
  2. import React, { Component } from 'react';
  3. import { View, Text, TextInput, StyleSheet, ScrollView, Container, TouchableOpacity, Dimensions, StatusBar, Alert, ActivityIndicator, Image, ImageBackground, AsyncStorage, BackHandler } from 'react-native';
  4. import Icon from 'react-native-vector-icons/FontAwesome';
  5. import Slideshow from 'react-native-slideshow';
  6. import InternetOffline from '../../Components/InternetOffline';
  7. import NetInfo from "@react-native-community/netinfo";
  8. import Accounting from '../../Components/Accounting';
  9. import PropTypes from 'prop-types';
  10. import { USER_INFO } from '../../Config/UserServices';
  11. // import Dialog, {
  12. // DialogTitle,
  13. // DialogContent,
  14. // DialogFooter,
  15. // DialogButto
  16. // SlideAnimation,
  17. // ScaleAnimation,
  18. // } from 'react-native-popup-dialog';
  19.  
  20. // const { height, width, scale } = Dimensions.get('window')
  21. const width = Dimensions.get('window').width;
  22. const height = Dimensions.get('window').height;
  23. const GLOBAL = require('../../Config/Services');
  24. // create a component
  25.  
  26. class Home extends Component {
  27. constructor() {
  28. super();
  29. this.state = {
  30. isConnected: false,
  31. animating: true,
  32. position: 1,
  33. interval: null,
  34. dataSource: [
  35. {
  36. title: 'Title 1',
  37. caption: 'Caption 1',
  38. url: 'http://placeimg.com/640/480/any',
  39. }, {
  40. title: 'Title 2',
  41. caption: 'Caption 2',
  42. url: 'http://placeimg.com/640/480/any',
  43. }, {
  44. title: 'Title 3',
  45. caption: 'Caption 3',
  46. url: 'http://placeimg.com/640/480/any',
  47. },
  48. ],
  49. dataBuku: [{
  50. id: 0,
  51. judul: 'Judul Buku 1',
  52. namapengarang: 'Arief Advani',
  53. harga: 'Rp. 5000',
  54. image: require('../../Assets/image/icons/buk1.png'),
  55. star: 4
  56. },
  57. {
  58. id: 1,
  59. judul: 'Judul Buku 2',
  60. namapengarang: 'Arief Advani',
  61. harga: 'Rp. 5000',
  62. image: require('../../Assets/image/icons/buk2.png'),
  63. star: 4
  64. },
  65. {
  66. id: 2,
  67. judul: 'Judul Buku 3',
  68. namapengarang: 'Arief Advani',
  69. harga: 'Rp. 5000',
  70. image: require('../../Assets/image/icons/buk3.png'),
  71. star: 4
  72. },
  73. {
  74. id: 3,
  75. judul: 'Judul Buku 4',
  76. namapengarang: 'Arief Advani',
  77. harga: 'Rp. 5000',
  78. image: require('../../Assets/image/icons/buk4.png'),
  79. star: 4
  80. }],
  81. tempWallet: 0,
  82. tempName: '',
  83. tempImage: '',
  84. screenWidth: width,
  85. screenHeight: height,
  86. orientation: this._getOrientation(width, height)
  87. }
  88. this.handleBackButtonClick = this.handleBackButtonClick.bind(this);
  89. }
  90. _getOrientation(width, height) {
  91. return width < height ? 'Potrait' : 'Landscape'
  92. }
  93.  
  94. _updateLayout(event) {
  95. const { width, height } = event.nativeEvent.layout
  96. let orientation = this._getOrientation(width, height)
  97. this.setState({
  98. screenWidth: width,
  99. screenHeight: height,
  100. orientation: this._getOrientation(width, height)
  101. })
  102. }
  103.  
  104. componentWillMount() {
  105. this.setState({
  106. interval: setInterval(() => {
  107. this.setState({
  108. position: this.state.position === this.state.dataSource.length ? 0 : this.state.position + 1
  109. });
  110. }, 2000)
  111. });
  112. BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
  113. }
  114.  
  115. componentDidMount() {
  116. NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);
  117. this.getId();
  118. }
  119.  
  120. componentWillUnmount() {
  121. clearInterval(this.state.interval);
  122. BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
  123. NetInfo.isConnected.removeEventListener('connectionChange', this.handleConnectivityChange);
  124. }
  125.  
  126. clickBack(){
  127. this.props.navigation.navigate('AppAuthentication');
  128. };
  129.  
  130. handleBackButtonClick() {
  131. // this.props.navigation.goBack(null);
  132. Alert.alert('My Character', 'Apakah Anda Ingin Keluar ?', [
  133. { text: 'NO', onPress: () => console.warn('NO Pressed'), style: 'cancel' },
  134. { text: 'YES', onPress: () => this.clickBack()},
  135. ]);
  136. return true;
  137. }
  138.  
  139. getId() {
  140. AsyncStorage.getItem(GLOBAL.APPUSERID).then((value) => {
  141. this.funcGetUserInfo(value);
  142. });
  143. }
  144.  
  145. funcGetUserInfo = async (getId) => {
  146. const resJson = await USER_INFO(getId);
  147. console.log(resJson)
  148. if (resJson.status == 200) {
  149. this.setState({
  150. tempWallet: resJson.data.walet,
  151. tempName: resJson.data.name
  152. })
  153. } else {
  154.  
  155. }
  156. }
  157.  
  158. handleConnectivityChange = (isConnected) => {
  159. if (isConnected) {
  160. this.setState({ isConnected: false });
  161. // this.handleGetProfile();
  162. } else {
  163. this.setState({ isConnected: true });
  164. }
  165. }
  166.  
  167. clickBook() {
  168. this.props.navigation.navigate('CatalogEbook');
  169. }
  170. formatValue(value) {
  171. return Accounting.formatMoney(parseFloat(value), "Rp ", 0);
  172. }
  173.  
  174. clickDialog(getTitle, getDescription) {
  175. Alert.alert(getTitle, getDescription)
  176. }
  177.  
  178. render() {
  179. return (
  180. <View style={{ justifyContent: 'center', alignItems: 'center' }} onLayout={(event) => this._updateLayout(event)}>
  181. <ImageBackground source={require('../../Assets/image/icons/header.png')} style={{ width: width / 1, justifyContent: 'center', alignItems: 'center', height: height / 5, flexDirection: 'row' }}>
  182. {/* <TouchableOpacity style={{ marginLeft: width / 20 }}>
  183. <Icon name="bars" style={{ fontWeight: '900', fontSize: width / 20, color: 'white' }} />
  184. </TouchableOpacity> */}
  185. <View>
  186. <Text style={{ color: 'white', fontWeight: 'bold', fontSize: 25, marginLeft: width / 20 }}>Home</Text>
  187. </View>
  188. {/* <TouchableOpacity style={{ marginRight: width / 20 }}>
  189. <Text style={{ fontWeight: '900', fontSize: width / 25, color: 'white' }}>{this.formatValue(this.state.tempWallet)}</Text>
  190. </TouchableOpacity> */}
  191. </ImageBackground>
  192. {/* <Dialog
  193. onDismiss={() => {
  194. this.setState({ Dialog: false });
  195. }}
  196. onTouchOutside={() => {
  197. this.setState({ Dialog: false });
  198. }}
  199. visible={this.state.Dialog}
  200. dialogAnimation={new SlideAnimation({ slideFrom: 'bottom' })}>
  201. <DialogContent>
  202. <View style={{ width: width / 1, height: height / 1.25 }}>
  203. <Text>{this.state.DialogDeskripsi}</Text>
  204. </View>
  205. </DialogContent>
  206. </Dialog> */}
  207. <InternetOffline
  208. isConnected={this.state.isConnected}
  209. />
  210. {/* <View>
  211. <StatusBar backgroundColor='#678f75' barStyle='light-content' />
  212. </View> */}
  213. {/* <View style={{ height: 52, width: width / 1.1, backgroundColor: "#fcfcfa", justifyContent: 'center', paddingLeft: 30, position: 'absolute', top: width / 4, borderWidth: 0.5 }}>
  214. <TextInput placeholder='Telusuri E-book Anda ' placeholderTextColor='#0bbed6' />
  215. </View> */}
  216. <ScrollView style={{ marginTop: 5 }}
  217. showsVerticalScrollIndicator={false} bounces={false} bouncesZoom={false}
  218. >
  219. <View style={{ marginTop: width / 10, height: height / 3.8, width: width / 1 }}>
  220. <Slideshow
  221. dataSource={this.state.dataSource}
  222. position={this.state.position}
  223. onPositionChanged={position => this.setState({ position })}
  224.  
  225. />
  226. </View>
  227. <View style={{
  228. marginTop: width / 10,
  229. backgroundColor: 'white',
  230. shadowColor: "#000",
  231. width: width / 1,
  232. height: height / 6,
  233. shadowOffset: {
  234. width: 0,
  235. height: 11,
  236. },
  237. shadowOpacity: 0.55,
  238. shadowRadius: 14.78,
  239. elevation: 22,
  240. justifyContent: 'center',
  241. marginRight: width / 20
  242. }}>
  243. <View style={{ flexDirection: 'row', justifyContent: 'space-around', alignItems: 'center' }}>
  244. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 4.5, height: height / 9, marginTop: 10 }}>
  245. <TouchableOpacity onPress={() => this.props.navigation.navigate('MyCharacter')} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }}>
  246. <Image source={require('../../Assets/image/icons/char.png')} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }} />
  247. </TouchableOpacity>
  248. <Text style={{ fontWeight: '800', marginTop: 2 }}>Character</Text>
  249. </View>
  250. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 4.5, height: height / 9, marginTop: 10 }}>
  251. <TouchableOpacity onPress={() => this.clickBook()} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }}>
  252. <Image source={require('../../Assets/image/icons/book.png')} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }} />
  253. </TouchableOpacity>
  254. <Text style={{ fontWeight: '800', marginTop: 2 }}>E Book</Text>
  255. </View>
  256. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 4.5, height: height / 9, marginTop: 10 }}>
  257. <TouchableOpacity onPress={() => this.props.navigation.navigate('CatalogXcull')} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }}>
  258. <Image source={require('../../Assets/image/icons/kuler.png')} style={{ width: width / 4.5, height: height / 9, borderRadius: width / 25 }} />
  259. </TouchableOpacity>
  260. <Text style={{ fontWeight: '800', marginTop: 2 }}>Xcull</Text>
  261. </View>
  262. </View>
  263. </View>
  264. <View style={{ marginTop: width / 20, width: width / 1 }}>
  265. <ImageBackground source={require('../../Assets/image/icons/bgP.png')} style={{ width: width / 1, height: height / 3, resizeMode: 'stretch' }}>
  266. <View>
  267. <View style={{ flexDirection: 'row', justifyContent: 'space-around', marginTop: width / 12 }}>
  268. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 5, height: height / 9.5 }}>
  269. <TouchableOpacity style={{ borderRadius: width / 25, width: width / 5, height: height / 9.5 }}>
  270. <Image source={require('../../Assets/image/icons/guru.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  271. </TouchableOpacity>
  272. <Text style={{ fontWeight: '800', marginTop: 5 }}>E Student</Text>
  273. </View>
  274. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 4.5, height: height / 9.5 }}>
  275. <TouchableOpacity style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }}>
  276. <Image source={require('../../Assets/image/icons/homework.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  277. </TouchableOpacity>
  278. <Text style={{ fontWeight: '800', marginTop: 5 }}>Home Work</Text>
  279. </View>
  280. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 5, height: height / 9.5 }}>
  281. <TouchableOpacity style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }}>
  282. <Image source={require('../../Assets/image/icons/eskul.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  283. </TouchableOpacity>
  284. <Text style={{ fontWeight: '800', marginTop: 5 }}>E School</Text>
  285. </View>
  286. </View>
  287. <View style={{ flexDirection: 'row', justifyContent: 'space-around', marginTop: width / 15 }}>
  288. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 5, height: height / 9.5 }}>
  289. <TouchableOpacity style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }}>
  290. <Image source={require('../../Assets/image/icons/schedul.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  291. </TouchableOpacity>
  292. <Text style={{ fontWeight: '800', marginTop: 5 }}>Scheduler</Text>
  293. </View>
  294. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 5, height: height / 9.5 }}>
  295. <TouchableOpacity style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }}>
  296. <Image source={require('../../Assets/image/icons/elearn.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  297. </TouchableOpacity>
  298. <Text style={{ fontWeight: '800', marginTop: 5 }}>E Learning</Text>
  299. </View>
  300. <View style={{ justifyContent: 'center', alignItems: 'center', width: width / 5, height: height / 9.5 }}>
  301. <TouchableOpacity style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }}>
  302. <Image source={require('../../Assets/image/icons/wallet.png')} style={{ width: width / 5, height: height / 9.5, borderRadius: width / 25 }} />
  303. </TouchableOpacity>
  304. <Text style={{ fontWeight: '800', marginTop: 5 }}>Wallet</Text>
  305. </View>
  306. </View>
  307. <View style={{ position: 'absolute', bottom: '80%', left: '2%' }}>
  308. <Image source={require('../../Assets/image/icons/comingsoon.png')} />
  309. </View>
  310. </View>
  311. </ImageBackground>
  312. </View>
  313. <View style={{
  314. height: height / 12, width: width / 1,
  315. marginTop: width / 20, backgroundColor: 'white',
  316. // shadowColor: "#000",
  317. // shadowOffset: {
  318. // width: 0,
  319. // height: 11,
  320. // },
  321. // shadowOpacity: 0.55,
  322. // shadowRadius: 14.78,
  323. // elevation: 22,
  324. borderTopLeftRadius: 20,
  325. borderBottomLeftRadius: 20,
  326. flexDirection: 'row',
  327. }}>
  328. <View style={{ width: width / 20, height: height / 12, backgroundColor: '#24a0ff', marginLeft: width / 15 }} />
  329. <View style={{ alignItems: 'center', justifyContent: 'center' }}>
  330. <Text style={{ fontWeight: '900', marginLeft: width / 20, fontSize: 20 }}>My Character Info</Text>
  331. </View>
  332. </View>
  333. <View style={{ marginTop: width / 20, width: width / 1 }}>
  334. <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
  335. <TouchableOpacity onPress={() => this.clickDialog('My Character', 'Pengembangan Karakter dan Softskill')} style={{
  336. width: width / 2.1, height: height / 10,
  337. backgroundColor: 'white',
  338. // shadowColor: "#000",
  339. // shadowOffset: {
  340. // width: 0,
  341. // height: 11,
  342. // },
  343. // shadowOpacity: 0.55,
  344. // shadowRadius: 14.78,
  345. // elevation: 22,
  346. borderTopRightRadius: 20,
  347. borderBottomRightRadius: 20,
  348. flexDirection: 'row',
  349. alignItems: 'center'
  350. }}>
  351. <Image source={require('../../Assets/image/icons/sayap.png')} style={{ height: height / 10 }} />
  352. <View style={{ width: width / 3, marginLeft: 5 }}>
  353. <Text style={{ fontWeight: '900' }}>My Character</Text>
  354. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Pengembangan Karakter dan Softskill</Text> */}
  355. </View>
  356. </TouchableOpacity>
  357. <TouchableOpacity onPress={() => this.clickDialog('E-Student', 'Latar belakang yang meliputi bidang pendidikan')} style={{
  358. width: width / 2.1, height: height / 10,
  359. backgroundColor: 'white',
  360. // shadowColor: "#000",
  361. // shadowOffset: {
  362. // width: 0,
  363. // height: 11,
  364. // },
  365. // shadowOpacity: 0.55,
  366. // shadowRadius: 14.78,
  367. // elevation: 22,
  368. borderTopLeftRadius: 20,
  369. borderBottomLeftRadius: 20,
  370. flexDirection: 'row-reverse',
  371. alignItems: 'center'
  372. }}>
  373. <Image source={require('../../Assets/image/icons/guru.png')} style={{ height: height / 10 }} />
  374. <View style={{ width: width / 3, paddingLeft: 30 }}>
  375. <Text style={{ fontWeight: '900' }}>E Student</Text>
  376. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Latar belakang yang meliputi bidang pendidikan</Text> */}
  377. </View>
  378. </TouchableOpacity>
  379. </View>
  380. <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginTop: width / 20 }}>
  381. <TouchableOpacity onPress={() => this.clickDialog('Extrakulikuller', 'Pelatihan Ekstrakulikuler non Akademik melalui media audio visual')} style={{
  382. width: width / 2.1, height: height / 10,
  383. backgroundColor: 'white',
  384. // shadowColor: "#000",
  385. // shadowOffset: {
  386. // width: 0,
  387. // height: 11,
  388. // },
  389. // shadowOpacity: 0.55,
  390. // shadowRadius: 14.78,
  391. // elevation: 22,
  392. borderTopRightRadius: 20,
  393. borderBottomRightRadius: 20,
  394. flexDirection: 'row',
  395. alignItems: 'center'
  396. }}>
  397. <Image source={require('../../Assets/image/icons/kuler.png')} style={{ height: height / 10 }} />
  398. <View style={{ width: width / 3, marginLeft: 5 }}>
  399. <Text style={{ fontWeight: '900' }}>Xcull</Text>
  400. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Pengembangan Karakter dan Softskill</Text> */}
  401. </View>
  402. </TouchableOpacity>
  403. <TouchableOpacity onPress={() => this.clickDialog('Home Work', 'Kegiatan penunjang dengan waktu yang flexible')} style={{
  404. width: width / 2.1, height: height / 10,
  405. backgroundColor: 'white',
  406. // shadowColor: "#000",
  407. // shadowOffset: {
  408. // width: 0,
  409. // height: 11,
  410. // },
  411. // shadowOpacity: 0.55,
  412. // shadowRadius: 14.78,
  413. // elevation: 22,
  414. borderTopLeftRadius: 20,
  415. borderBottomLeftRadius: 20,
  416. flexDirection: 'row-reverse',
  417. alignItems: 'center'
  418. }}>
  419. <Image source={require('../../Assets/image/icons/homework.png')} style={{ height: height / 10 }} />
  420. <View style={{ width: width / 3, paddingLeft: 30 }}>
  421. <Text style={{ fontWeight: '900' }}>Home Work</Text>
  422. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Latar belakang yang meliputi bidang pendidikan</Text> */}
  423. </View>
  424. </TouchableOpacity>
  425. </View>
  426. <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginTop: width / 20 }}>
  427. <TouchableOpacity onPress={() => this.clickDialog('E-School', 'Sistem integrasi Sekolah berbasis Teknologi Digital ')} style={{
  428. width: width / 2.1, height: height / 10,
  429. backgroundColor: 'white',
  430. // shadowColor: "#000",
  431. // shadowOffset: {
  432. // width: 0,
  433. // height: 11,
  434. // },
  435. // shadowOpacity: 0.55,
  436. // shadowRadius: 14.78,
  437. // elevation: 22,
  438. borderTopRightRadius: 20,
  439. borderBottomRightRadius: 20,
  440. flexDirection: 'row',
  441. alignItems: 'center'
  442. }}>
  443. <Image source={require('../../Assets/image/icons/eskul.png')} style={{ height: height / 10 }} />
  444. <View style={{ width: width / 3, marginLeft: 5 }}>
  445. <Text style={{ fontWeight: '900' }}>E School</Text>
  446. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Pengembangan Karakter dan Softskill</Text> */}
  447. </View>
  448. </TouchableOpacity>
  449. <TouchableOpacity onPress={() => this.clickDialog('Wallet', 'Uang digital beserta opsi transaksinya')} style={{
  450. width: width / 2.1, height: height / 10,
  451. backgroundColor: 'white',
  452. // shadowColor: "#000",
  453. // shadowOffset: {
  454. // width: 0,
  455. // height: 11,
  456. // },
  457. // shadowOpacity: 0.55,
  458. // shadowRadius: 14.78,
  459. // elevation: 22,
  460. borderTopLeftRadius: 20,
  461. borderBottomLeftRadius: 20,
  462. flexDirection: 'row-reverse',
  463. alignItems: 'center'
  464. }}>
  465. <Image source={require('../../Assets/image/icons/wallet.png')} style={{ height: height / 10 }} />
  466. <View style={{ width: width / 3, paddingLeft: 30 }}>
  467. <Text style={{ fontWeight: '900' }}>Wallet</Text>
  468. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Latar belakang yang meliputi bidang pendidikan</Text> */}
  469. </View>
  470. </TouchableOpacity>
  471. </View>
  472. <View style={{ flexDirection: 'row', justifyContent: 'space-between', marginTop: width / 20 }}>
  473. <TouchableOpacity onPress={() => this.clickDialog('Schedule', 'Jadwal target program pengembangan Karakter')} style={{
  474. width: width / 2.1, height: height / 10,
  475. backgroundColor: 'white',
  476. // shadowColor: "#000",
  477. // shadowOffset: {
  478. // width: 0,
  479. // height: 11,
  480. // },
  481. // shadowOpacity: 0.55,
  482. // shadowRadius: 14.78,
  483. // elevation: 22,
  484. borderTopRightRadius: 20,
  485. borderBottomRightRadius: 20,
  486. flexDirection: 'row',
  487. alignItems: 'center'
  488. }}>
  489. <Image source={require('../../Assets/image/icons/schedul.png')} style={{ height: height / 10 }} />
  490. <View style={{ width: width / 3, marginLeft: 5 }}>
  491. <Text style={{ fontWeight: '900' }}>Shedule</Text>
  492. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Pengembangan Karakter dan Softskill</Text> */}
  493. </View>
  494. </TouchableOpacity>
  495. <TouchableOpacity onPress={() => this.clickDialog('E Learning', 'Pembelajaran melalui materi online berupa buku, audio, dan video')} style={{
  496. width: width / 2.1, height: height / 10,
  497. backgroundColor: 'white',
  498. // shadowColor: "#000",
  499. // shadowOffset: {
  500. // width: 0,
  501. // height: 11,
  502. // },
  503. // shadowOpacity: 0.55,
  504. // shadowRadius: 14.78,
  505. // elevation: 22,
  506. borderTopLeftRadius: 20,
  507. borderBottomLeftRadius: 20,
  508. flexDirection: 'row-reverse',
  509. alignItems: 'center'
  510. }}>
  511. <Image source={require('../../Assets/image/icons/elearn.png')} style={{ height: height / 10 }} />
  512. <View style={{ width: width / 3, paddingLeft: 30 }}>
  513. <Text style={{ fontWeight: '900' }}>E Learning</Text>
  514. {/* <Text numberOfLines={3} style={{ fontSize: 10 }}>Latar belakang yang meliputi bidang pendidikan</Text> */}
  515. </View>
  516. </TouchableOpacity>
  517. </View>
  518. </View>
  519. {/* <View style={{ marginTop: width / 20, marginLeft: width / 20 }}>
  520. <Text style={{ fontWeight: '900' }}>Terbaru Harga Mulai Rp. 5000</Text>
  521. <ScrollView horizontal={true} style={{ width: width / 1, height: height / 3, marginTop: width / 20 }} showsHorizontalScrollIndicator={false}>
  522. {
  523. this.state.dataBuku.map((item, index) => (
  524. <TouchableOpacity
  525. key={item.id}
  526. onPress={() => this.alertItemName(item)}
  527. >
  528. <Image source={item.image} style={{ height: 155, width: 100, marginLeft: 3 }} />
  529. <View style={{ marginTop: width / 25 }}>
  530. <Text style={{ fontSize: 10, color: 'black', fontWeight: 'bold', marginLeft: 5, width: width / 3 }} numberOfLines={3}>{item.judul}</Text>
  531. <Text style={{ fontSize: 10, color: 'black', marginLeft: 5 }}>{item.namapengarang}</Text>
  532. <Text style={{ fontSize: 10, color: 'black', fontWeight: 'bold', marginLeft: 5 }}>{item.harga}</Text>
  533. </View>
  534. </TouchableOpacity>
  535. ))
  536. }
  537. </ScrollView>
  538. </View> */}
  539. <View style={{ height: 100 }} />
  540. </ScrollView>
  541. </View>
  542. );
  543. }
  544. }
  545.  
  546. // define your styles
  547. const styles = StyleSheet.create({
  548. container: {
  549. flex: 1,
  550. },
  551. activityIndicator: {
  552. justifyContent: 'center',
  553. alignItems: 'center',
  554. height: 900
  555. }
  556. });
  557.  
  558. //make this component available to the app
  559. export default Home;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement