-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grid.tsx
62 lines (58 loc) · 1.86 KB
/
Grid.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { UniversalInfoDisplayItem } from "./Shell";
const GridItems = ({
items,
setSelectedItemIdx,
}: {
items: UniversalInfoDisplayItem[];
setSelectedItemIdx: (val: number) => any;
}) => {
return items.length ? (
<div className="item-grid">
{items.map((item, idx) => (
<div
className={`item`}
key={item.b + item.n + idx}
onClick={() => setSelectedItemIdx(item.id)}
>
<span className="title">{item.n}</span>
<div className="container">
<div className="container-text">
<span className="price">{"$" + item["$"]}</span>
<span className="choice">
{item["g"] ? item["g"].join(",") : ""}
</span>
<span className="percent">
{item["%"] ? Math.round(item["%"]) + "%" : ""}
</span>
<span className="type">{item["t"]}</span>
<span className="ppu">
{item["ppu"] ? "$" + item["ppu"] + "/g" : ""}
</span>
</div>
<div className="container-img">
{/*<div className="glow-css" />*/}
<img className="glow" src="glow.png" />
<img
className="thumb"
src={
"final.gif" /*`${
item.w === "D"
? "https://images.dutchie.com/" +
item["p"] +
"?auto=format&fit=fill&fill=solid&fillColor=%" +
"23000" +
"&__typename=ImgixSettings&ixlib=react-9.0.2&h=200&w=200"
: item["p"]
}`*/
}
loading="lazy"
alt="image"
></img>
</div>
</div>
</div>
))}
</div>
) : null;
};
export default GridItems;