No Description

index.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React ,{Component} from 'react'
  2. import {
  3. View,
  4. Text,
  5. StyleSheet,
  6. Image,
  7. TouchableOpacity,
  8. } from 'react-native'
  9. import {deviceWidth, heightPxToDp, widthPxToDp} from "../../../utils/ScreenUtils";
  10. import _const from "../../../const/_const";
  11. export default class ChatMainTopLayout extends Component{
  12. constructor(props){
  13. super(props)
  14. this.state={}
  15. }
  16. getTopLayout=()=>{
  17. const data = _const.chatViewTopLayout
  18. const comps = []
  19. data.map((item,index)=>{
  20. comps.push(
  21. <TouchableOpacity key={item.key} style={{marginRight:index===3?0:widthPxToDp(85),justifyContent:'center',alignItems:'center'}}>
  22. <Image source={item.image} style={{height:widthPxToDp(100),width:widthPxToDp(100),borderRadius:8}}/>
  23. <Text style={{marginTop:heightPxToDp(17),fontSize:15}}>{item.name}</Text>
  24. </TouchableOpacity>
  25. )
  26. })
  27. return comps
  28. }
  29. render(){
  30. return(
  31. <View style={{marginLeft:26,width:deviceWidth,marginTop:heightPxToDp(142),flexDirection:'row'}}>
  32. {this.getTopLayout()}
  33. </View>
  34. )
  35. }
  36. }