forked from scottrepreneur/pool-together
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70a6883
commit b88a7ee
Showing
15 changed files
with
616 additions
and
1,941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
|
||
Run locally with `docker-compose up` inside the main repo. Check out [.env.sample](https://github.com/scottrepreneur/pool-together/blob/master/.env.sample) for necessary environment variables. | ||
|
||
TODO: fix installing web3 on build seems to be failing --> current workaround is to manually install [email protected] | ||
TODO: (docker) fix installing web3 on build seems to be failing --> current workaround is to manually install [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,65 @@ | ||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
|
||
import Button from '../../components/UI/Button/Button'; | ||
import classes from './Manage.module.css'; | ||
import * as actions from '../../store/actions/index'; | ||
|
||
class Manage extends Component { | ||
componentWillMount() { | ||
this.props.onFetchPoolState(window.web3); | ||
this.props.onFetchManager(window.web3); | ||
this.props.onFetchCurrentPool(window.web3); | ||
this.props.onFetchCurrentApr(window.web3); | ||
this.props.onFetchEntrants(window.web3); | ||
} | ||
|
||
render () { | ||
let poolState = "Open for Savings!"; | ||
if (this.props.poolState === 1) { | ||
poolState = "Compounding Winnings!" | ||
} | ||
if (this.props.poolState === 2) { | ||
poolState = "Ready to withdrawal savings" | ||
} | ||
return ( | ||
<div className={classes.Manage}> | ||
|
||
<h2>Manage Savings</h2> | ||
<p>This pool's contract: {' '} | ||
<a href={'http://rinkeby.etherscan.io/address/' + process.env.REACT_APP_LOTTERY_CONTRACT_ADDRESS}> | ||
{process.env.REACT_APP_LOTTERY_CONTRACT_ADDRESS} | ||
</a> | ||
</p> | ||
<p>This pool is managed by: {this.props.manager}</p> | ||
<p>Pool State: {poolState}</p> | ||
|
||
<Button>Earn Interest</Button> | ||
<Button>Pick Winner</Button> | ||
<Button>Reset Pool</Button> | ||
|
||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Manage; | ||
const mapStateToProps = state => { | ||
return { | ||
poolState: state.lottery.poolState, | ||
currentPool: state.lottery.currentPool, | ||
currentApr: state.lottery.currentApr, | ||
entrants: state.lottery.entrants, | ||
manager: state.manage.manager | ||
} | ||
} | ||
|
||
const mapDispatchToProps = dispatch => { | ||
return { | ||
onFetchPoolState: (web3) => dispatch(actions.fetchPoolState(web3)), | ||
onFetchCurrentPool: (web3) => dispatch(actions.fetchCurrentPool(web3)), | ||
onFetchCurrentApr: () => dispatch(actions.fetchCurrentApr()), | ||
onFetchEntrants: (web3) => dispatch(actions.fetchEntrants(web3)), | ||
onFetchManager: (web3) => dispatch(actions.fetchManager(web3)) | ||
} | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(Manage); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
.Manage { | ||
|
||
text-align: center; | ||
color: black; | ||
height: 575px; | ||
width: 100%; | ||
background-color: #fff; | ||
border-radius: 8px; | ||
} | ||
|
||
.Manage h2 { | ||
padding-top: 50px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,6 @@ export { | |
withdrawDai, | ||
} from './lottery'; | ||
export { | ||
setPoolState, | ||
fetchManager, | ||
pickWinner | ||
} from './manage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.