Icon.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View } from "react-native"
  3. import { unitWidth, unitHeight } from "../../utils/AdapterUtil";
  4. import AntDesign from "react-native-vector-icons/AntDesign"
  5. export default class Icon extends Component {
  6. render() {
  7. let { text } = this.props
  8. return (
  9. <View style={styles.iconArea}>
  10. <View style={styles.iconItem}>
  11. <View style={styles.icon}>
  12. <AntDesign
  13. name={"camera"}
  14. size={45}
  15. style={{ color: "#fff" }}
  16. />
  17. </View>
  18. <Text style={{ color: "#333333", fontSize: unitWidth * 24 }}>{text}</Text>
  19. </View>
  20. </View>
  21. )
  22. }
  23. }
  24. const styles = StyleSheet.create({
  25. iconArea: {
  26. width: "100%",
  27. height: unitHeight * 280,
  28. flexDirection: "row",
  29. justifyContent: "space-around"
  30. },
  31. iconItem: {
  32. width: unitWidth * 590,
  33. height: unitHeight * 280,
  34. borderStyle: "dashed",
  35. borderWidth: 1,
  36. borderColor:"#ccc",
  37. alignItems: "center",
  38. justifyContent: "space-between",
  39. paddingTop: unitHeight * 57,
  40. paddingBottom: unitHeight * 20,
  41. },
  42. icon: {
  43. width: unitWidth * 118,
  44. height: unitWidth * 118,
  45. backgroundColor: "#FB7E90",
  46. justifyContent: "center",
  47. alignItems: "center",
  48. borderRadius: unitWidth * 118
  49. }
  50. })