CommentCom.jsx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import * as WebBrowser from 'expo-web-browser';
  2. import * as React from 'react';
  3. import { Div, Button, Image, Text, Avatar, Icon } from 'react-native-magnus';
  4. import { ScrollView } from 'react-native-gesture-handler';
  5. export default function CommentItem({ info }) {
  6. const imgs = info.img ? info.img.split(',') : [];
  7. const imageSize = imgs.length > 1 ? 80 : 167;
  8. return (
  9. <Div row py={10} px={15} bg="white" mt={10}>
  10. <Image source={{ uri: info.avatar }} w={33} h={33} />
  11. <Div flex={1} ml={5}>
  12. <Div row>
  13. <Div flex={1}>
  14. <Text fontSize="sm" textAlign="left">
  15. {info.nickname}
  16. </Text>
  17. <Div row>
  18. <Icon name="like1" color="brand500" />
  19. <Text fontSize="sm" color="brand500" textAlign="left">
  20. {info.likes || 0}
  21. </Text>
  22. </Div>
  23. </Div>
  24. <Text fontSize="sm" color="gray400" textAlign="left">
  25. {info.appraiseTime}
  26. </Text>
  27. </Div>
  28. <Text my={5} textAlign="left">
  29. {info.goodsAppraise}
  30. </Text>
  31. <Div row>
  32. {imgs.map((item, index) => {
  33. return (
  34. <Image
  35. key={index}
  36. mt={5}
  37. mr={5}
  38. source={{ uri: item }}
  39. w={imageSize}
  40. h={imageSize}
  41. rounded={3}
  42. />
  43. );
  44. })}
  45. </Div>
  46. </Div>
  47. </Div>
  48. );
  49. }