forked from arpan-mondal/De-Fi-Sportify-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Album.js
130 lines (126 loc) · 4.19 KB
/
Album.js
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import React from "react";
import { useAlbum } from "../hooks/useAlbum";
import { useLocation } from "react-router";
import "./Album.css";
import Opensea from "../images/opensea.png";
import { ClockCircleOutlined } from "@ant-design/icons";
const bears = [
{
src: "https://ipfs.moralis.io:2053/ipfs/Qmf8xEYZdMtQXYv56VxxmzbtUtEVjmaFaXGCgcBqGXDAA6/music/JTwinkle.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/6/69/B.o.B_-_Strange_Clouds_-_LP_Cover.jpg",
album: "Strange Clouds",
song: "Airplanes",
duration: "0:05",
},
{
src: "https://ipfs.moralis.io:2053/ipfs/QmUUhsAiUFq1B5JtzQH733CLBbUCnRekYXETMfeYG7PaZ3/music/JTiger.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/d/d5/Ariana_Grande_My_Everything_2014_album_artwork.png",
album: "My Everything",
song: "Side To Side",
duration: "0:16",
},
{
src: "https://ipfs.moralis.io:2053/ipfs/QmUUhsAiUFq1B5JtzQH733CLBbUCnRekYXETMfeYG7PaZ3/music/JTiger.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/d/d5/Ariana_Grande_My_Everything_2014_album_artwork.png",
album: "My Everything",
song: "Pizza and A Coke",
duration: "5:01",
},
{
src: "https://ipfs.moralis.io:2053/ipfs/QmUUhsAiUFq1B5JtzQH733CLBbUCnRekYXETMfeYG7PaZ3/music/JTiger.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/d/d5/Ariana_Grande_My_Everything_2014_album_artwork.png",
album: "My Everything",
song: "Iceberg Lettuce",
duration: "0:24",
},
{
src: "https://ipfs.moralis.io:2053/ipfs/QmUUhsAiUFq1B5JtzQH733CLBbUCnRekYXETMfeYG7PaZ3/music/JTiger.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/d/d5/Ariana_Grande_My_Everything_2014_album_artwork.png",
album: "My Everything",
song: "Spitting Chicklets",
duration: "1:03",
},
{
src: "https://ipfs.moralis.io:2053/ipfs/QmUUhsAiUFq1B5JtzQH733CLBbUCnRekYXETMfeYG7PaZ3/music/JTiger.mp3",
cover:
"https://upload.wikimedia.org/wikipedia/en/d/d5/Ariana_Grande_My_Everything_2014_album_artwork.png",
album: "My Everything",
song: "Boomerang",
duration: "2:16",
},
];
const Album = ({ setNftAlbum }) => {
const { state: albumDetails } = useLocation();
const { album } = useAlbum(albumDetails.contract);
return (
<>
<div className="albumContent">
<div className="topBan">
<img
src={albumDetails.image}
alt="albumcover"
className="albumCover"
></img>
<div className="albumDeets">
<div>ALBUM</div>
<div className="title">{albumDetails.title}</div>
<div className="artist">
{album && JSON.parse(album[0].metadata).artist}
</div>
<div>
{album && JSON.parse(album[0].metadata).year} •{" "}
{album && album.length} Songs
</div>
</div>
</div>
<div className="topBan">
<div className="playButton" onClick={() => setNftAlbum(album)}>
PLAY
</div>
<div
className="openButton"
onClick={() =>
window.open(
`https://testnets.opensea.io/assets/mumbai/${albumDetails.contract}/1`
)
}
>
OpenSea
<img src={Opensea} className="openLogo" />
</div>
</div>
<div className="tableHeader">
<div className="numberHeader">#</div>
<div className="titleHeader">TITLE</div>
<div className="numberHeader">
<ClockCircleOutlined />
</div>
</div>
{album &&
album.map((nft, i) => {
nft = JSON.parse(nft.metadata);
return (
<>
<div className="tableContent">
<div className="numberHeader">{i + 1}</div>
<div
className="titleHeader"
style={{ color: "rgb(205, 203, 203)" }}
>
{nft.name}
</div>
<div className="numberHeader">{nft.duration}</div>
</div>
</>
);
})}
</div>
</>
);
};
export default Album;