您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

UserReviewsCard.js 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import React from "react";
  2. import PropTypes from "prop-types";
  3. import { ReviewList, ReviewsBox } from "./UserReviewsCard.styled";
  4. import {
  5. Avatar,
  6. Grid,
  7. ListItem,
  8. ListItemAvatar,
  9. Typography,
  10. Divider,
  11. } from "@mui/material";
  12. import Mockupdata from "./Mockupdata";
  13. import ThumbUpIcon from "@mui/icons-material/ThumbUp";
  14. import ThumbDownIcon from "@mui/icons-material/ThumbDown";
  15. import StarBorderIcon from "@mui/icons-material/StarBorder";
  16. import selectedTheme from "../../themes";
  17. const UserReviewsCard = (props) => {
  18. var dataMockupdata = JSON.parse(JSON.stringify(Mockupdata));
  19. return (
  20. <>
  21. <ReviewsBox>
  22. <Grid
  23. container
  24. direction="row"
  25. justifyContent="start"
  26. alignItems="center"
  27. sx={{ mb: 1.4 }}
  28. >
  29. <StarBorderIcon color="action" sx={{ mr: 0.9 }} />
  30. <Typography>{props.heading}</Typography>
  31. </Grid>
  32. <ReviewList>
  33. {dataMockupdata.map((review) => (
  34. <>
  35. <ListItem
  36. alignItems="flex-start"
  37. sx={{ alignItems: "center", mt: 2 }}
  38. >
  39. <ListItemAvatar sx={{ mt: 0 }}>
  40. <Avatar alt={review.name} src="/static/images/avatar/1.jpg" />
  41. </ListItemAvatar>
  42. <Typography sx={{ color: selectedTheme.primaryPurple }}>
  43. <b>{review.name}</b>
  44. </Typography>
  45. </ListItem>
  46. <Grid
  47. container
  48. direction="row"
  49. justifyContent="start"
  50. alignItems="center"
  51. spacing={2}
  52. sx={{ pl: 2, py: 2 }}
  53. >
  54. <Grid item xs={1}>
  55. {review.isGood ? (
  56. <ThumbUpIcon color="success" />
  57. ) : (
  58. <ThumbDownIcon color="error" />
  59. )}
  60. </Grid>
  61. <Grid item xs={11}>
  62. <Typography
  63. sx={{ display: "inline" }}
  64. component="span"
  65. variant="body2"
  66. color="text.primary"
  67. >
  68. &quot;{review.quote}&quot;
  69. </Typography>
  70. </Grid>
  71. </Grid>
  72. <Grid sx={{ pl: 2, pb: 2 }}>
  73. <Typography variant="body2" sx={{ display: "block" }}>
  74. Korektna komunikacija: <b>{review.isGoodCommunication}</b>
  75. </Typography>
  76. <Typography variant="body2" sx={{ display: "block" }}>
  77. Uspešna trampa: <b>{review.isSuccessfulSwap}</b>
  78. </Typography>
  79. </Grid>
  80. {review.id < dataMockupdata.length - 1 ? (
  81. <Divider variant="inset" component="li" sx={{ ml: 0 }} />
  82. ) : (
  83. <></>
  84. )}
  85. </>
  86. ))}
  87. </ReviewList>
  88. </ReviewsBox>
  89. </>
  90. );
  91. };
  92. UserReviewsCard.propTypes = {
  93. children: PropTypes.node,
  94. heading: PropTypes.string,
  95. };
  96. export default UserReviewsCard;