Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FE]: Display a table in the MyGreenNFT page #25

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 56 additions & 56 deletions frontend/src/components/Pages/GreenNFTMarketplace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ export default class GreenNFTMarketplace extends Component {

return (
<div className={styles.contracts}>
<h2>Green NFT (Carbon Credits) MarketPlace</h2>
<h2>Green NFT (Carbon Credits) MarketPlace</h2>

<Card width={"360px"}
<Card width={"360px"}
maxWidth={"360px"}
mx={"auto"}
my={5}
p={20}
borderColor={"#E8E8E8"}
>
>
<h2>Buy Carbon Credits</h2>

<Field label="Green NFT's address">
Expand Down Expand Up @@ -247,77 +247,77 @@ export default class GreenNFTMarketplace extends Component {
<Button size={'medium'} width={1} onClick={this.buyCarbonCredits}> Buy Carbon Credits </Button>

<span style={{ padding: "5px" }}></span>
</Card>
</Card>

{ greenNFTMetadatas.map((greenNFTMetadata, key) => {
return (
<div key={key} className="">
<div className={styles.widgets}>
{ currentAccount != greenNFTMetadata.projectOwner && greenNFTMetadata.greenNFTStatus == "1" ?
<Card width={"360px"}
maxWidth={"360px"}
mx={"auto"}
my={5}
p={20}
borderColor={"#E8E8E8"}
>
<span style={{ padding: "20px" }}></span>
{ greenNFTMetadatas.map((greenNFTMetadata, key) => {
return (
<div key={key} className="">
<div className={styles.widgets}>
{ currentAccount != greenNFTMetadata.projectOwner && greenNFTMetadata.greenNFTStatus == "1" ?
<Card width={"360px"}
maxWidth={"360px"}
mx={"auto"}
my={5}
p={20}
borderColor={"#E8E8E8"}
>
<span style={{ padding: "20px" }}></span>

<p>Project ID: { greenNFTMetadata.projectId }</p>
<p>Project ID: { greenNFTMetadata.projectId }</p>

<p>Claim ID: { greenNFTMetadata.claimId }</p>
<p>Claim ID: { greenNFTMetadata.claimId }</p>

<p>Green NFT: { greenNFTMetadata.greenNFT }</p>
<p>Green NFT: { greenNFTMetadata.greenNFT }</p>

<p>Issued by (Auditor): { greenNFTMetadata.auditor }</p>
<p>Issued by (Auditor): { greenNFTMetadata.auditor }</p>

<p>Issued to (Project Owner): { greenNFTMetadata.projectOwner }</p>
<p>Issued to (Project Owner): { greenNFTMetadata.projectOwner }</p>

<p>Issued at (Timestamp): {
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getDate() }` + " " +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getHours() }` + ":" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getMinutes() }` + ":" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getSeconds() }`
}</p>
<p>Issued at (Timestamp): {
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getDate() }` + " " +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getHours() }` + ":" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getMinutes() }` + ":" +
`${ new Date(Number(greenNFTMetadata.timestampOfissuedDate) * 1000).getSeconds() }`
}</p>

<p>Verification period is started from: {
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getDate() }`
}</p>
<p>Verification period is started from: {
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.startOfPeriod) * 1000).getDate() }`
}</p>

<p>Verification period is ended until: {
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getDate() }`
}</p>
<p>Verification period is ended until: {
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getFullYear() }` + "/" +
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getMonth() + 1 }` + "/" +
`${ new Date(Number(greenNFTMetadata.endOfPeriod) * 1000).getDate() }`
}</p>

<p>Audited Report: <a href={ `https://ipfs.io/ipfs/${greenNFTMetadata.auditedReport}` }>{ greenNFTMetadata.auditedReport }</a></p>
<p>Audited Report: <a href={ `https://ipfs.io/ipfs/${greenNFTMetadata.auditedReport}` }>{ greenNFTMetadata.auditedReport }</a></p>

{/***** [Todo]: Display the GreenNFTEmissonData struct-related data *****/}
{/***** [Todo]: Display the GreenNFTEmissonData struct-related data *****/}

{/* <p>CO2 Emissions: { web3.utils.fromWei(`${greenNFTEmissonData.co2Emissions}`, 'ether') } ETH</p> */}
{/* <p>CO2 Emissions: { web3.utils.fromWei(`${greenNFTEmissonData.co2Emissions}`, 'ether') } ETH</p> */}

{/* <p>CO2 Reductions: { web3.utils.fromWei(`${greenNFTEmissonData.co2Reductions}`, 'ether') } ETH</p> */}
{/* <p>CO2 Reductions: { web3.utils.fromWei(`${greenNFTEmissonData.co2Reductions}`, 'ether') } ETH</p> */}

{/* <p>Carbon Credits: { web3.utils.fromWei(`${greenNFTEmissonData.carbonCredits}`, 'ether') } ETH</p> */}
{/* <p>Carbon Credits: { web3.utils.fromWei(`${greenNFTEmissonData.carbonCredits}`, 'ether') } ETH</p> */}

{/* <p>Buyable Carbon Credits: { web3.utils.fromWei(`${greenNFTEmissonData.buyableCarbonCredits}`, 'ether') } ETH</p> */}
{/* <p>Buyable Carbon Credits: { web3.utils.fromWei(`${greenNFTEmissonData.buyableCarbonCredits}`, 'ether') } ETH</p> */}

<br />
<br />

<span style={{ padding: "5px" }}></span>
</Card>
:
""
}
<span style={{ padding: "5px" }}></span>
</Card>
:
""
}

</div>
</div>
)
}) }
</div>
</div>
)
})}
</div>
);
}
Expand Down
Loading