Icon.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 { IconList } = this.props
  8. return (
  9. <View style={styles.iconArea}>
  10. {
  11. IconList.map(item => {
  12. return (
  13. <View style={styles.iconItem}>
  14. <View style={styles.icon}>
  15. <AntDesign
  16. name={"camera"}
  17. size={45}
  18. style={{ color: "#fff" }}
  19. />
  20. </View>
  21. <Text style={{ color: "#333333", fontSize: unitWidth * 24 }}>{item}</Text>
  22. </View>
  23. )
  24. })
  25. }
  26. </View>
  27. )
  28. }
  29. }
  30. const styles = StyleSheet.create({
  31. iconArea: {
  32. width: "100%",
  33. height: unitHeight * 280,
  34. flexDirection: "row",
  35. justifyContent: "space-around",
  36. paddingLeft: unitWidth * 20,
  37. paddingRight: unitWidth * 20
  38. },
  39. iconItem: {
  40. flex: 1,
  41. height: unitHeight * 280,
  42. borderStyle: "dashed",
  43. borderWidth: 1,
  44. borderColor: "#ccc",
  45. alignItems: "center",
  46. justifyContent: "space-between",
  47. paddingTop: unitHeight * 57,
  48. paddingBottom: unitHeight * 20,
  49. marginLeft: unitWidth * 10,
  50. marginRight: unitWidth * 10
  51. },
  52. icon: {
  53. width: unitWidth * 118,
  54. height: unitWidth * 118,
  55. backgroundColor: "#FB7E90",
  56. justifyContent: "center",
  57. alignItems: "center",
  58. borderRadius: unitWidth * 118
  59. }
  60. })