Skip to content

Commit

Permalink
Rework frontend.
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Hirner committed Jul 2, 2021
1 parent b8fc007 commit cb2e013
Show file tree
Hide file tree
Showing 35 changed files with 13,063 additions and 17,282 deletions.
1,918 changes: 0 additions & 1,918 deletions build/contracts/Artwork.json

This file was deleted.

2,702 changes: 0 additions & 2,702 deletions build/contracts/Marketplace.json

This file was deleted.

1,019 changes: 0 additions & 1,019 deletions build/contracts/MarketplaceCreator.json

This file was deleted.

931 changes: 0 additions & 931 deletions build/contracts/Migrations.json

This file was deleted.

3,886 changes: 0 additions & 3,886 deletions build/contracts/Ownable.json

This file was deleted.

8 changes: 4 additions & 4 deletions components/ContributeForm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import { Form, Input, Message, Button } from 'semantic-ui-react';
import Campaign from '../ethereum/campaign';
import Marketplace from '../ethereum/marketplace';
import web3 from '../ethereum/web3';
import { Router } from '../routes';

Expand All @@ -14,18 +14,18 @@ class ContributeForm extends Component {
onSubmit = async event => {
event.preventDefault();

const campaign = Campaign(this.props.address);
const marketplace = Marketplace(this.props.address);

this.setState({ loading: true, errorMessage: '' });

try {
const accounts = await web3.eth.getAccounts();
await campaign.methods.contribute().send({
await marketplace.methods.contribute().send({
from: accounts[0],
value: web3.utils.toWei(this.state.value, 'ether')
});

Router.replaceRoute(`/campaigns/${this.props.address}`);
Router.replaceRoute(`/marketplaces/${this.props.address}`);
} catch (err) {
this.setState({ errorMessage: err.message });
}
Expand Down
12 changes: 1 addition & 11 deletions components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,8 @@ export default () => {
return (
<Menu style={{ marginTop: '10px' }}>
<Link route="/">
<a className="item">This is fuckin awesome!</a>
<a className="item">Bazinga!</a>
</Link>

<Menu.Menu position="right">
<Link route="/">
<a className="item">Artwork</a>
</Link>

<Link route="/campaigns/new">
<a className="item">+</a>
</Link>
</Menu.Menu>
</Menu>
);
};
6 changes: 2 additions & 4 deletions components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Container } from 'semantic-ui-react';
import Head from 'next/head';
import Header from './Header';

const props = () => {
export default props => {
return (
<Container>
<Head>
Expand All @@ -17,6 +17,4 @@ const props = () => {
{props.children}
</Container>
);
};

export default props;
};
11 changes: 5 additions & 6 deletions components/RequestRow.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@

import React, { Component } from 'react';
import { Table, Button } from 'semantic-ui-react';
import web3 from '../ethereum/web3';
import Campaign from '../ethereum/campaign';
import Marketplace from '../ethereum/marketplace';

class RequestRow extends Component {
onApprove = async () => {
const campaign = Campaign(this.props.address);
const marketplace = Marketplace(this.props.address);

const accounts = await web3.eth.getAccounts();
await campaign.methods.approveRequest(this.props.id).send({
await marketplace.methods.approveRequest(this.props.id).send({
from: accounts[0]
});
};

onFinalize = async () => {
const campaign = Campaign(this.props.address);
const marketplace = Marketplace(this.props.address);

const accounts = await web3.eth.getAccounts();
await campaign.methods.finalizeRequest(this.props.id).send({
await marketplace.methods.finalizeRequest(this.props.id).send({
from: accounts[0]
});
};
Expand Down
3,229 changes: 2,241 additions & 988 deletions ethereum/build/contracts/Artwork.json

Large diffs are not rendered by default.

2,840 changes: 1,159 additions & 1,681 deletions ethereum/build/contracts/Marketplace.json

Large diffs are not rendered by default.

779 changes: 418 additions & 361 deletions ethereum/build/contracts/MarketplaceCreator.json

Large diffs are not rendered by default.

Loading

0 comments on commit cb2e013

Please sign in to comment.