HomeScreenPage2.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import * as React from "react";
  2. import { Layout, Button } from "@ui-kitten/components";
  3. import { StyleSheet } from "react-native";
  4. import { useModel } from "flooks";
  5. import CommentCard from "../components/Comment";
  6. import Badge from "../components/Badge";
  7. import * as RootNavigation from "../navigation/RootNavigation";
  8. const styles = StyleSheet.create({
  9. tabContainer: {
  10. backgroundColor: "#fff",
  11. paddingTop: 20,
  12. paddingBottom: 80,
  13. flex: 1,
  14. },
  15. bageList: {
  16. flexDirection: "row",
  17. flexWrap: "wrap",
  18. paddingHorizontal: 15,
  19. paddingBottom: 9,
  20. },
  21. back: {
  22. paddingHorizontal: 13,
  23. paddingVertical: 5,
  24. flexDirection: "row",
  25. justifyContent: "flex-end",
  26. },
  27. backText: {
  28. width: 200,
  29. borderRadius: 3,
  30. backgroundColor: "#EEEEEE",
  31. height: 23,
  32. lineHeight: 23,
  33. paddingLeft: 5,
  34. },
  35. backButtn: {
  36. marginLeft: 10,
  37. },
  38. container: {},
  39. });
  40. export default function HomePage2() {
  41. // eslint-disable-next-line no-unused-vars
  42. const [commentList, setCommentList] = React.useState([{}, {}, {}]);
  43. const { editAutoBack, TCSOVO, BWEOYE, POKFOW } = useModel("wordsModel");
  44. const allCommentList = () => {
  45. return commentList.map((item, index) => {
  46. return <CommentCard key={index} />;
  47. });
  48. };
  49. return (
  50. <Layout style={styles.tabContainer}>
  51. <Layout style={styles.bageList}>
  52. <Badge appearance="filled" status="warning" right={5} bottom={4}>
  53. {TCSOVO}
  54. </Badge>
  55. <Badge appearance="filled" right={5} bottom={4}>
  56. {BWEOYE}
  57. </Badge>
  58. <Badge appearance="filled" right={5} bottom={4}>
  59. {POKFOW}
  60. </Badge>
  61. <Badge appearance="filled" status="info" right={5} bottom={4}>
  62. 差评
  63. </Badge>
  64. </Layout>
  65. <Layout style={styles.back}>
  66. <Button
  67. style={styles.backButtn}
  68. onPress={() => {
  69. RootNavigation.navigate("Automatic");
  70. }}
  71. >
  72. {editAutoBack}
  73. </Button>
  74. </Layout>
  75. <Layout style={styles.container}>{allCommentList()}</Layout>
  76. </Layout>
  77. );
  78. }