Skip to content

Commit

Permalink
get form values
Browse files Browse the repository at this point in the history
  • Loading branch information
bernatmarcilla committed Oct 11, 2021
1 parent 6cbc4cb commit 574a868
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/dapp/NFTs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,6 @@ export function addNFT(name, description, image_https, image_ipfs, tokenId) {
}
}

console.log(values[2], values[3])

}
13 changes: 8 additions & 5 deletions src/pages/minting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ const options = [
function Minting() {
let selectedOption;
const [ipfs, setIpfs] = useState([])
const [name, setName] = useState([])
const [description, setDescription] = useState([])
const [ipfsLink, setIpfsLink] = useState([])

function mintToken() {
console.log("Minting token...");

addNFT('Test', 'Test', 'Test', 'Test', 'Test');
addNFT(name, description, 'https', ipfsLink, '123');
}

function handleChange(selectedOption) {
Expand All @@ -55,10 +58,10 @@ function Minting() {
<br />
<form>
<h1>Name:</h1>
<input type="text" id="fname" name="fname" /><br /><br />
<input type="text" id="fname" name="fname" onChange={(e) => setName(e.target.value)} /><br /><br />

<h1>Description:</h1>
<textarea name="message" rows="5" cols="30">The cat was playing in the garden.</textarea><br /><br />
<h1>Description: </h1>
<textarea name="message" rows="5" cols="30" onChange={(e) => setDescription(e.target.value)}> </textarea><br /><br />

<h1>Is the NFT File deployed in the IPFS?:</h1>
<Select options={options} value={selectedOption} onChange={handleChange} />
Expand All @@ -68,7 +71,7 @@ function Minting() {
? <div>
<br />
<h1>IPFS File url:</h1>
<input type="text" id="lname" /> <br /> <br />
<input type="text" id="lname" onChange={(e) => setIpfsLink(e.target.value)} /> <br /> <br />
</div>
: <div id='Dropzone'>
<br />
Expand Down

0 comments on commit 574a868

Please sign in to comment.