Skip to content

Commit 0603d66

Browse files
committed
add edit button
1 parent 9ed4619 commit 0603d66

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

pages/article.js

+24-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ export default function MyAssets() {
4444
}
4545
}
4646

47+
async function gotoEdit() {
48+
if ("cid" in router.query) {
49+
cid = router.query.cid
50+
}
51+
if (!cid) {
52+
return
53+
}
54+
router.push(`/edit?cid=${cid}`)
55+
}
56+
57+
4758
async function storeNFTtoFilecoin() {
4859
await window.ethereum.enable()
4960
const provider = new providers.Web3Provider(window.ethereum)
@@ -195,16 +206,27 @@ export default function MyAssets() {
195206
{!("minted" in nft) && nft.authors[0].wallet.eth == myethAccount && (
196207
<button
197208
onClick={createMint}
198-
className="font-bold mt-4 bg-pink-500 text-white rounded p-4 shadow-lg"
209+
className="font-bold mt-4 bg-blue-500 text-white rounded p-4 shadow-lg"
199210
>
200211
Mint (Will sign 2 times. Be patient...)
201212
</button>
202213
)}
203214
<br />
215+
216+
{nft.authors[0].wallet.eth == myethAccount && (
217+
<button
218+
onClick={gotoEdit}
219+
className="font-bold mt-4 bg-blue-500 text-white rounded p-4 shadow-lg"
220+
>
221+
Edit
222+
</button>
223+
)}
224+
<br />
225+
204226
{nft.authors[0].wallet.eth == myethAccount && (
205227
<button
206228
onClick={storeNFTtoFilecoin}
207-
className="font-bold mt-4 bg-pink-500 text-white rounded p-4 shadow-lg"
229+
className="font-bold mt-4 bg-blue-500 text-white rounded p-4 shadow-lg"
208230
>
209231
Store NFT on the Filecoin network(optional)
210232
</button>

0 commit comments

Comments
 (0)