mirror of
https://github.com/status-im/dreddit-dapp.git
synced 2025-02-23 11:48:23 +00:00
UI changes and sending wallet
This commit is contained in:
parent
998e5e0208
commit
fabad3e1fd
@ -57,7 +57,7 @@ MongoClient.connect(connString, {useNewUrlParser:true}, function (err, client) {
|
||||
{'id': vote.id},
|
||||
{
|
||||
'$inc': {score: choice},
|
||||
'$push': {'votes': {'account': vote.account, choice}}
|
||||
'$push': {'votes': {'account': vote.account, wallet: vote.wallet, choice}}
|
||||
},
|
||||
(err) => {
|
||||
if(err){
|
||||
|
@ -124,7 +124,7 @@ class App extends Component {
|
||||
<Header toggleForm={this._toggleForm} sortOrder={this._setSortOrder} search={this._search} />
|
||||
{ displayForm && <Create afterPublish={this._loadPosts} /> }
|
||||
{ !account && <SnackbarContent message="This DApp requires CONTACT_CODE permission from the Status app to enable voting" /> }
|
||||
{ orderedList.length == 0 && <Typography variant="display2" style={{marginTop: 30, textAlign: 'center'}}>
|
||||
{ orderedList.length == 0 && <Typography variant="display1" style={{marginTop: 40, textAlign: 'center'}}>
|
||||
Loading items... <CircularProgress />
|
||||
</Typography> }
|
||||
{ orderedList.map((record) => <Post account={account} key={record.id} {...record} filterBy={filterBy} updateVotes={this._updateVotes} votingEnabled={account !== null && !votes.includes(record.hash) && canVote} />) }
|
||||
|
@ -67,8 +67,8 @@ class Header extends Component {
|
||||
<SearchBar
|
||||
placeholder="Search..."
|
||||
style={{
|
||||
margin: '10px 10px',
|
||||
maxWidth: 280
|
||||
marginTop: '10px',
|
||||
marginBottom: '10px'
|
||||
}}
|
||||
onChange={(searchValue) => search(searchValue)}
|
||||
/>
|
||||
|
@ -12,6 +12,7 @@ import Grid from '@material-ui/core/Grid';
|
||||
import axios from 'axios';
|
||||
import config from '../config';
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import web3 from 'Embark/web3';
|
||||
|
||||
const styles = theme => ({
|
||||
actions: {
|
||||
@ -98,7 +99,7 @@ class Post extends Component {
|
||||
});
|
||||
|
||||
const ipfsHash = this.props.hash;
|
||||
await axios.post(config.server + '/vote', {id: ipfsHash, account: this.props.account, selection: choice});
|
||||
await axios.post(config.server + '/vote', {id: ipfsHash, account: this.props.account, wallet: web3.eth.defaultAccount, selection: choice});
|
||||
|
||||
this.props.updateVotes(this.props.id);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user