Skip to content

Commit

Permalink
remove ALL errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan0905 committed Nov 25, 2022
1 parent 6cfbf02 commit 395fe0d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
54 changes: 26 additions & 28 deletions src/pages/form-page.jsx
Expand Up @@ -16,9 +16,19 @@ function FormPage (){
};

const changeHandler = async(event) => {
// if (event.target.files[0])
// {

if (event.target.files[0])
{
const data = new FormData();
data.append("file", event.target.files[0], event.target.files[0].name);
data.append("isSync", true);
const res = await starton.post('/ipfs/file',
data, {
headers: {
"x-api-key": 'sk_live_89c7396e-c994-415e-9127-8bb3f7b8a7d4',
"Content-Type": "multipart/form-data"},
})
console.log(res.data);
}
// let reader = new FileReader();
// reader.readAsDataURL(event.target.files[0]);
// reader.onload = () => {
Expand All @@ -31,30 +41,18 @@ function FormPage (){
// console.log(response.data);
// })
// }
// }


// console.log(typeof event.target.files[0])
// // console.log(event.target.files[0]);
// const file1 = new Buffer.from(JSON.stringify(event.target.files[0]));
// console.log(file1);
// // const file1 = await toBase64(event.target.files[0]);
const data = new FormData();
data.append("file", event.target.files[0], event.target.files[0].name);
data.append("isSync", true);
const res = await starton.post('/ipfs/file',
data, {
headers: {
"x-api-key": 'sk_live_89c7396e-c994-415e-9127-8bb3f7b8a7d4',
"Content-Type": "multipart/form-data"},
})
console.log(res.data);
};
return (
<>
<div>
<h1 class="logo-over-white">
PAYCONSENT<span class="dot-color">.</span>
<h1 className="logo-over-white">
PAYCONSENT<span className="dot-color">.</span>
</h1>
</div>
<div className="total-form">
Expand All @@ -67,26 +65,26 @@ function FormPage (){
</div>
<div className="status-div">
<div className="label-status">
<label class="status-title" for="contractStatus">
<label className="status-title">
Status
</label>
<p className="text-[13px]">Seller or Buyer</p>
</div>
<div className="select-box-div">
<select className="select-box">
<option value="0" selected disabled>
<option defaultValue="0" disabled>
Status
</option>
<option value="1">Buyer</option>
<option value="2">Seller</option>
<option defaultValue="1">Buyer</option>
<option defaultValue="2">Seller</option>
</select>
</div>
</div>
</div>
<div className="form-div2">
<div className="status-div">
<div className="label-status">
<label class="status-title" for="contractName">
<label className="status-title">
My Wallet ID
</label>
<p className="text-[13px]">The creator of this contract</p>
Expand All @@ -102,7 +100,7 @@ function FormPage (){
</div>
<div className="status-div">
<div className="label-status">
<label class="status-title" for="contractSubject">
<label className="status-title">
Subject
</label>
<p className="text-[13px]">About the contract</p>
Expand All @@ -118,7 +116,7 @@ function FormPage (){
</div>
<div className="status-div">
<div className="label-status">
<label class="status-title" for="contractWalletAddress">
<label className="status-title">
Sending To
</label>
<p className="text-[13px]">The receiver</p>
Expand All @@ -133,12 +131,12 @@ function FormPage (){
</div>
<div className="status-div-upload">
<div className="label-status">
<label class="status-title">File To Upload</label>
<label className="status-title">File To Upload</label>
<p className="text-[13px]">(Quotation, Specifications ...)</p>
</div>
<div>
<div class="upload-btn-wrapper">
<button class="btn" onClick={handleSubmission}>{urls.length == 2 ? "Files Uploaded":"Upload a file"}</button>
<div className="upload-btn-wrapper">
<button className="btn" onClick={handleSubmission}>{urls.length == 2 ? "Files Uploaded":"Upload a file"}</button>
<input
// onClick={starton.post('/ipfs/file',
// {
Expand All @@ -155,7 +153,7 @@ function FormPage (){
</div>
<div className="status-div">
<div className="label-status">
<label class="status-title" for="contractPrice">
<label className="status-title">
Price
</label>
</div>
Expand Down
12 changes: 6 additions & 6 deletions src/pages/main-page.jsx
Expand Up @@ -7,17 +7,17 @@ import "../assets/css/home.css";
class MainPage extends Component {
render() {
return (
<div class="w-screen h-screen">
<div className="w-screen h-screen">
<div>
<h1 class="logo-over-white">
PAYCONSENT<span class="dot-color">.</span>
<h1 className="logo-over-white">
PAYCONSENT<span className="dot-color">.</span>
</h1>
</div>
<div class="intro-div">
<h2 class="intro-title">
<div className="intro-div">
<h2 className="intro-title">
Giving You Solutions <br></br>For Smarter Contracts
</h2>
<quote class="intro-quote">
<quote className="intro-quote">
Are you tired of complex and slow administration ? <br></br>Get your
first decentralized contract, entirely <br></br>managed with
blockchain technology
Expand Down

0 comments on commit 395fe0d

Please sign in to comment.