Email.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import React from "react";
  2. import { StyleSheet } from "react-native";
  3. import {
  4. Card,
  5. Text,
  6. Button,
  7. Layout,
  8. Avatar,
  9. } from "@ui-kitten/components";
  10. const styles = StyleSheet.create({
  11. main: {
  12. flexDirection: "row",
  13. alignItems: "center",
  14. backgroundColor: "transparent",
  15. },
  16. avatar: {
  17. width: 33,
  18. height: 33,
  19. backgroundColor: "#eee",
  20. },
  21. center: {
  22. flex: 1,
  23. marginLeft: 14,
  24. backgroundColor: "transparent",
  25. },
  26. top: {
  27. flexDirection: "row",
  28. alignItems: "center",
  29. backgroundColor: "transparent",
  30. justifyContent: "space-between",
  31. },
  32. time: {
  33. color: "#787878",
  34. },
  35. btn: {
  36. maxWidth: 10,
  37. width: 10,
  38. height: 10,
  39. borderRadius: 10,
  40. marginRight: 10,
  41. paddingHorizontal: 0,
  42. },
  43. });
  44. export default function Email(props) {
  45. // const { } = useModel("wordsModel");
  46. const { info, pressEvent } = props;
  47. const { avatar, name, sendTime, content } = info || {};
  48. return (
  49. <Card appearance='walletCard' onPress={pressEvent}>
  50. <Layout style={styles.main}>
  51. <Button size='tiny' style={styles.btn} status='primary' />
  52. {/* <Button size='tiny' style={styles.btn} status='info' /> */}
  53. <Avatar
  54. style={styles.avatar}
  55. shape='rounded'
  56. source={{
  57. uri: avatar,
  58. }}
  59. />
  60. <Layout style={styles.center}>
  61. <Layout style={styles.top}>
  62. <Text category='c1'>{name || "系统提醒"}</Text>
  63. <Text category='h1' style={styles.time}>
  64. {sendTime || "12月26日"}
  65. </Text>
  66. </Layout>
  67. <Text
  68. category='h1'
  69. status='info'
  70. numberOfLines={1}
  71. ellipsizeMode='tail'
  72. >
  73. {content ||
  74. "您的订单已经被取消收款方老司机的发链接SDK溜老司机的您的订单已经被取消收款方老司机的发链接SDK溜老司机的"}
  75. </Text>
  76. </Layout>
  77. </Layout>
  78. </Card>
  79. );
  80. }