MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / Rating

Function Rating

frontend/src/components/Rating.js:3–66  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

1import React from 'react';
2
3export default function Rating(props) {
4 return !props.value ? (
5 <div></div>
6 ) : (
7 <div className="rating">
8 <span>
9 <i
10 className={
11 props.value >= 1
12 ? 'fa fa-star'
13 : props.value >= 0.5
14 ? 'fa fa-star-half-o'
15 : 'fa fa-star-o'
16 }
17 ></i>
18 </span>
19 <span>
20 <i
21 className={
22 props.value >= 2
23 ? 'fa fa-star'
24 : props.value >= 1.5
25 ? 'fa fa-star-half-o'
26 : 'fa fa-star-o'
27 }
28 ></i>
29 </span>
30 <span>
31 <i
32 className={
33 props.value >= 3
34 ? 'fa fa-star'
35 : props.value >= 2.5
36 ? 'fa fa-star-half-o'
37 : 'fa fa-star-o'
38 }
39 ></i>
40 </span>
41 <span>
42 <i
43 className={
44 props.value >= 4
45 ? 'fa fa-star'
46 : props.value >= 3.5
47 ? 'fa fa-star-half-o'
48 : 'fa fa-star-o'
49 }
50 ></i>
51 </span>
52 <span>
53 <i
54 className={
55 props.value >= 5
56 ? 'fa fa-star'
57 : props.value >= 4.5
58 ? 'fa fa-star-half-o'
59 : 'fa fa-star-o'
60 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected