@@ -245,22 +250,31 @@ class Interface extends Component {
symbol={this.state.symbol}
/>
- }
- {this.state.value === 2 &&
+ )}
+ {this.state.value === 2 && (
-
-
- Lights
-
-
+
+
+ Lights
+
+
-
- }
+
+ )}
);
diff --git a/src/components/Dashboard/TopTabs/index.jsx b/src/components/Dashboard/TopTabs/index.jsx
index 5b89704..8690b34 100644
--- a/src/components/Dashboard/TopTabs/index.jsx
+++ b/src/components/Dashboard/TopTabs/index.jsx
@@ -17,7 +17,11 @@ class TopTabs extends Component {
this.props.tokens &&
this.props.tokens.map((token, index) => {
return (
-
this.props.history.push(`/dashboard/${token.address}`)} />
+ this.props.history.push(`/dashboard/${token.address}`)}
+ />
);
});
@@ -36,4 +40,4 @@ class TopTabs extends Component {
}
}
-export default withRouter(TopTabs);
\ No newline at end of file
+export default withRouter(TopTabs);
diff --git a/src/components/Dashboard/index.jsx b/src/components/Dashboard/index.jsx
index fd9720e..0206c77 100644
--- a/src/components/Dashboard/index.jsx
+++ b/src/components/Dashboard/index.jsx
@@ -10,7 +10,7 @@ import TopTabs from './TopTabs';
class Dashboard extends Component {
state = {
- tokens: null,
+ tokens: null
};
componentDidMount = () => {
@@ -21,26 +21,28 @@ class Dashboard extends Component {
const filter = { owner_address: drizzleState.accounts[0] };
const tokens = [];
- this._asyncRequest = makeCancelable(factoryContract.getPastEvents(
- 'Created',
- { fromBlock: 0, toBlock: 'latest', filter },
- (_, events) => {
- events.forEach(token => {
- const address = token.returnValues.token_address;
- const date = token.returnValues.time;
- const name = token.returnValues.name;
- tokens.push({ address, date, name });
- this.setState({ tokens });
- });
- }
- ));
+ this._asyncRequest = makeCancelable(
+ factoryContract.getPastEvents(
+ 'Created',
+ { fromBlock: 0, toBlock: 'latest', filter },
+ (_, events) => {
+ events.forEach(token => {
+ const address = token.returnValues.token_address;
+ const date = token.returnValues.time;
+ const name = token.returnValues.name;
+ tokens.push({ address, date, name });
+ this.setState({ tokens });
+ });
+ }
+ )
+ );
};
componentWillUnmount = () => {
if (this._asyncRequest) {
this._asyncRequest.cancel();
}
- }
+ };
render() {
return (
diff --git a/src/components/Profile/BuyAndSellButtons.jsx b/src/components/Profile/BuyAndSellButtons.jsx
index ecbe7ce..286eed0 100644
--- a/src/components/Profile/BuyAndSellButtons.jsx
+++ b/src/components/Profile/BuyAndSellButtons.jsx
@@ -17,8 +17,10 @@ class BuyAndSellButtons extends Component {
}
buyHandler = () => {
- if (!this.state.buyAmt) { return; }
-
+ if (!this.state.buyAmt) {
+ return;
+ }
+
const buyStackId = this.props.contract.methods.mint.cacheSend(addDecimals(this.state.buyAmt), {
from: this.props.drizzleState.accounts[0],
value: this.state.priceInEther
@@ -54,9 +56,7 @@ class BuyAndSellButtons extends Component {
if (name === 'sellAmt') {
let rewardInEther = 0;
if (Number(value) !== 0) {
- rewardInEther = await this.props.contract.methods
- .rewardForBurn(addDecimals(value))
- .call();
+ rewardInEther = await this.props.contract.methods.rewardForBurn(addDecimals(value)).call();
}
this.setState({
rewardInEther
@@ -65,7 +65,9 @@ class BuyAndSellButtons extends Component {
};
sellHandler = () => {
- if (!this.state.sellAmt) { return; }
+ if (!this.state.sellAmt) {
+ return;
+ }
const sellStackId = this.props.contract.methods.burn.cacheSend(
addDecimals(this.state.sellAmt),
@@ -77,7 +79,7 @@ class BuyAndSellButtons extends Component {
};
waitForMined = stackId => {
- const { enqueueSnackbar } = this.props;
+ const { enqueueSnackbar } = this.props;
const interval = setInterval(() => {
const status = this.getStatus(stackId);
if (status === 'pending' && this.state.txStatus !== 'pending') {
@@ -117,7 +119,7 @@ class BuyAndSellButtons extends Component {
/>