Last change
on this file since 07f4e8b was e6c2521, checked in by darsov2 <62809499+darsov2@…>, 8 months ago |
images upload/download impl, other fixes
|
-
Property mode
set to
100644
|
File size:
1.6 KB
|
Line | |
---|
1 | import React from "react";
|
---|
2 | import { Col, Container, Row, Image } from "react-bootstrap";
|
---|
3 | import { AiOutlineStar, AiFillStar } from 'react-icons/ai';
|
---|
4 |
|
---|
5 | function Review (props) {
|
---|
6 |
|
---|
7 | const generateStars = () => {
|
---|
8 | const stars = [];
|
---|
9 | for (let i = 0; i < props.review.numStar; i++) {
|
---|
10 | stars.push(
|
---|
11 | <Col key={i} style={{display: "inline-block"}} className="w-20 px-0">
|
---|
12 | <AiFillStar size="2rem" color="#159895" />
|
---|
13 | </Col>
|
---|
14 | );
|
---|
15 | }
|
---|
16 | for (let i = 0; i < 5 - props.review.numStar; i++) {
|
---|
17 | stars.push(
|
---|
18 | <Col key={i + 3} style={{display: "inline-block"}} className="w-20 px-0">
|
---|
19 | <AiOutlineStar size="2rem" color="#159895" />
|
---|
20 | </Col>
|
---|
21 | );
|
---|
22 | }
|
---|
23 | return stars;
|
---|
24 | }
|
---|
25 |
|
---|
26 | return (
|
---|
27 | <Container style={{padding: '2em', width: '18em', height: '15em', backgroundColor: 'lightgray', borderRadius: '1rem', position: "aboslute", top: "-410px", left: "-600px"}}>
|
---|
28 | <Row>
|
---|
29 | <Col>
|
---|
30 | <Image src="https://i.pinimg.com/originals/f1/0f/f7/f10ff70a7155e5ab666bcdd1b45b726d.jpg" width={50} height={50} className="rounded-5"></Image>
|
---|
31 | </Col>
|
---|
32 | <Col className="my-auto">
|
---|
33 | <span>{props.review.title}</span>
|
---|
34 | </Col>
|
---|
35 | </Row>
|
---|
36 | <Row>
|
---|
37 | <span className="my-3 border">{props.review.description}</span>
|
---|
38 | </Row>
|
---|
39 | <Row className="w-100 mx-auto" style={{maxWidth: "100%"}}>
|
---|
40 | {generateStars()}
|
---|
41 | </Row>
|
---|
42 | </Container>
|
---|
43 | );
|
---|
44 | }
|
---|
45 |
|
---|
46 | export default Review; |
---|
Note:
See
TracBrowser
for help on using the repository browser.