Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.89 KB | None | 0 0
  1. import React, { Component } from "react";
  2. import {
  3. View,
  4. Text,
  5. StyleSheet,
  6. TouchableOpacity,
  7. TextInput,
  8. ScrollView,
  9. Image
  10. } from "react-native";
  11. import Header from './comp/Header';
  12. import Footer from './comp/Footer';
  13. const image = require('./img/undiksha.jpg');
  14. class MainMenuScreen extends Component {
  15. static navigationOptions = {
  16. header: null
  17. };
  18.  
  19. render() {
  20. return (
  21. <View style={styles.container}>
  22. <Header judul={"APP KASIR"} />
  23. <View style={{
  24. flex: 0.4, alignItems: 'center',
  25. justifyContent: 'center'
  26. }}>
  27. <Image source={image}
  28. style={styles.gambarContainer} />
  29. </View>
  30. <View style={styles.buttomContainer}>
  31. <View style={styles.doubleButtom}>
  32. <View style={{
  33. flex: 0.5, alignItems:
  34. 'center', justifyContent: 'center',
  35. }}>
  36. <TouchableOpacity style={styles.Buttom}
  37. activeOpacity={0.5}
  38. onPress={() =>
  39. this.props.navigation.navigate('Penjualan')}
  40. >
  41. <Text style={{
  42. fontSize: 20, color:
  43. '#fff', fontWeight: 'bold'
  44. }}>Penjualan</Text>
  45. </TouchableOpacity>
  46. </View>
  47. <View style={{
  48. flex: 0.5, alignItems:
  49. 'center', justifyContent: 'center',
  50. }}>
  51. <TouchableOpacity style={styles.Buttom}
  52. activeOpacity={0.5}
  53. onPress={() =>
  54. this.props.navigation.navigate('Barang')}
  55. >
  56. <Text style={{
  57. fontSize: 20, color:
  58. '#fff', fontWeight: 'bold'
  59. }}>Data Barang</Text>
  60. </TouchableOpacity>
  61. </View>
  62. </View>
  63. <View style={styles.singleButtom}>
  64. <TouchableOpacity style={styles.Buttom}
  65. activeOpacity={0.5}
  66. onPress={() =>
  67. this.props.navigation.navigate('Tentang')}
  68. >
  69. <Text style={{
  70. fontSize: 20, color:
  71. '#fff', fontWeight: 'bold'
  72. }}>Tentang</Text>
  73. </TouchableOpacity>
  74. </View>
  75. </View>
  76. <Footer />
  77. </View>
  78. );
  79. }
  80. }
  81. // define your styles
  82. const styles = StyleSheet.create({
  83. container: {
  84. flex: 1,
  85. alignContent: 'center',
  86. backgroundColor: '#E3F2FD',
  87. },
  88. gambarContainer: {
  89. width: '90%',
  90. backgroundColor: '#00ff00',
  91. height: '100%',
  92. marginTop: 10,
  93. },
  94. buttomContainer: {
  95. flex: 0.6,
  96. marginBottom: 50,
  97. },
  98. doubleButtom: {
  99. flex: 0.5,
  100. flexDirection: 'row',
  101. },
  102. singleButtom: {
  103. flex: 0.5,
  104. justifyContent: 'center',
  105. alignItems: 'center',
  106. },
  107. Buttom: {
  108. width: '90%',
  109. height: 75,
  110. backgroundColor: '#FF7F50',
  111. color: '#fff',
  112. borderRadius: 10,
  113. justifyContent: 'center',
  114. alignItems: 'center'
  115. }
  116. });
  117. //make this component available to the app
  118. export default MainMenuScreen;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement