-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from thasup/dev
Change side product image styles
- Loading branch information
Showing
5 changed files
with
304 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,92 +1,92 @@ | ||
import { faInfoCircle } from "@fortawesome/free-solid-svg-icons"; | ||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||
import Link from "next/link"; | ||
import React from "react"; | ||
import { Button, Col, Row, Table } from "react-bootstrap"; | ||
|
||
import CustomTooltip from "../common/CustomTooltip"; | ||
import Rating from "../common/Rating"; | ||
|
||
const UserReviewList = ({ myReviews, products }) => { | ||
return ( | ||
<Row className="align-items-center"> | ||
<Col> | ||
<Table striped bordered hover responsive className="table-sm"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>MY RATING</th> | ||
<th>OVERALL RATING</th> | ||
<th>TITLE</th> | ||
<th>DATE</th> | ||
<th>TIME</th> | ||
<th>DETAILS</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{myReviews.map((review, index) => ( | ||
<tr key={review.id}> | ||
<td> | ||
<CustomTooltip index={index} mongoId={review.id} />{" "} | ||
</td> | ||
<td> | ||
<Link | ||
href={`/products/[productId]`} | ||
as={`/products/${review.productId}`} | ||
> | ||
<a> | ||
{review.productTitle | ||
? review.productTitle | ||
: products.find( | ||
(product) => product.id === review.productId | ||
)?.title} | ||
</a> | ||
</Link> | ||
</td> | ||
<td> | ||
<Rating value={review.rating} mobile={false} /> ( | ||
{review.rating}) | ||
</td> | ||
<td> | ||
<Rating | ||
value={ | ||
products.find( | ||
(product) => product.id === review.productId | ||
)?.rating | ||
} | ||
mobile={false} | ||
/> | ||
( | ||
{ | ||
products.find((product) => product.id === review.productId) | ||
?.rating | ||
} | ||
) | ||
</td> | ||
<td>{review.title}</td> | ||
<td>{review.createdAt.substring(0, 10)}</td> | ||
<td> | ||
{new Date(`${review.createdAt}`).toString().substring(16, 21)} | ||
</td> | ||
<td> | ||
<Link | ||
href={"/products/[productId]"} | ||
as={`/products/${review.productId}`} | ||
passHref | ||
> | ||
<Button className="btn-sm" variant="light"> | ||
<FontAwesomeIcon icon={faInfoCircle} /> Details | ||
</Button> | ||
</Link> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default UserReviewList; | ||
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
import { Button, Col, Row, Table } from 'react-bootstrap'; | ||
|
||
import CustomTooltip from '../common/CustomTooltip'; | ||
import Rating from '../common/Rating'; | ||
|
||
const UserReviewList = ({ myReviews, products }) => { | ||
return ( | ||
<Row className="align-items-center"> | ||
<Col> | ||
<Table striped bordered hover responsive className="table-sm"> | ||
<thead> | ||
<tr> | ||
<th>ID</th> | ||
<th>PRODUCT</th> | ||
<th>MY RATING</th> | ||
<th>OVERALL RATING</th> | ||
<th>TITLE</th> | ||
<th>DATE</th> | ||
<th>TIME</th> | ||
<th>DETAILS</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{myReviews.map((review, index) => ( | ||
<tr key={review.id}> | ||
<td> | ||
<CustomTooltip index={index} mongoId={review.id} />{' '} | ||
</td> | ||
<td> | ||
<Link | ||
href={'/products/[productId]'} | ||
as={`/products/${review.productId}`} | ||
> | ||
<a> | ||
{review.productTitle | ||
? review.productTitle | ||
: products.find( | ||
(product) => product.id === review.productId | ||
)?.title} | ||
</a> | ||
</Link> | ||
</td> | ||
<td> | ||
<Rating value={review.rating} mobile={false} /> ( | ||
{review.rating}) | ||
</td> | ||
<td> | ||
<Rating | ||
value={ | ||
products.find( | ||
(product) => product.id === review.productId | ||
)?.rating | ||
} | ||
mobile={false} | ||
/> | ||
( | ||
{ | ||
products.find((product) => product.id === review.productId) | ||
?.rating | ||
} | ||
) | ||
</td> | ||
<td>{review.title}</td> | ||
<td>{review.createdAt.substring(0, 10)}</td> | ||
<td> | ||
{new Date(`${review.createdAt}`).toString().substring(16, 21)} | ||
</td> | ||
<td> | ||
<Link | ||
href={'/products/[productId]'} | ||
as={`/products/${review.productId}`} | ||
passHref | ||
> | ||
<Button className="btn-sm" variant="light"> | ||
<FontAwesomeIcon icon={faInfoCircle} /> Details | ||
</Button> | ||
</Link> | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</Table> | ||
</Col> | ||
</Row> | ||
); | ||
}; | ||
|
||
export default UserReviewList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.