HeaderView.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react'
  2. import { NavigationActions, createAction } from '../../utils'
  3. import { View, Text, TouchableOpacity, PixelRatio } from 'react-native'
  4. import Icon from '../../components/Iconfont/Iconfont'
  5. // 头部
  6. export const HeaderView = (dispatch, name) => {
  7. return (
  8. <View
  9. style={{
  10. height: HEADERSTYLE.height,
  11. paddingTop: HEADERSTYLE.paddingTop + 5,
  12. backgroundColor: '#fff',
  13. borderBottomColor: '#eee',
  14. borderBottomWidth: 1 / PixelRatio.get(),
  15. }}
  16. >
  17. <View
  18. style={{
  19. flex: 1,
  20. justifyContent: 'center',
  21. }}
  22. >
  23. <TouchableOpacity
  24. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  25. onPress={() => dispatch(NavigationActions.back())}
  26. >
  27. <Icon
  28. name="icon-icon-fanhui"
  29. size={20}
  30. color={'#666'}
  31. style={{ marginTop: 4 }}
  32. />
  33. <Text
  34. style={{
  35. fontSize: 14,
  36. lineHeight: 20,
  37. color: '#666',
  38. alignSelf: 'center',
  39. }}
  40. >
  41. 返回
  42. </Text>
  43. </TouchableOpacity>
  44. <Text
  45. style={{
  46. alignSelf: 'center',
  47. fontSize: 18,
  48. lineHeight: 25,
  49. letterSpacing: 0.19,
  50. color: '#333',
  51. }}
  52. >
  53. {name}
  54. </Text>
  55. </View>
  56. </View>
  57. )
  58. }