Title.js 923 B

1234567891011121314151617181920212223242526272829303132333435
  1. import React, { Component } from "react"
  2. import { StyleSheet, Text, View } from "react-native"
  3. import { unitWidth, unitHeight } from "../../utils/AdapterUtil";
  4. export default class Title extends Component {
  5. render() {
  6. let { tit, subTit } = this.props
  7. return (
  8. <View style={styles.titArea}>
  9. <Text style={styles.tit}>{tit}</Text>
  10. {
  11. subTit!=="" ? <Text style={styles.subTit}>{subTit}</Text> : null
  12. }
  13. </View>
  14. )
  15. }
  16. }
  17. const styles = StyleSheet.create({
  18. titArea: {
  19. width: "100%",
  20. paddingTop: unitHeight * 30,
  21. paddingBottom: unitHeight * 40,
  22. paddingLeft: unitWidth * 26
  23. },
  24. tit: {
  25. fontSize: unitWidth * 28,
  26. color: "#333333"
  27. },
  28. subTit: {
  29. fontSize: unitWidth * 24,
  30. color: "#FA788A",
  31. marginTop:unitHeight * 23
  32. }
  33. })