-
-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wiring up new homepage to new dashboard #281
Changes from 3 commits
e0daf87
b96c624
c7c43f1
edae52c
60d5d9b
192aa3b
d65d363
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,15 @@ import React, { Component } from 'react' | |
import Layout from '../interface/Layout' | ||
import CreatorAccount from './CreatorAccount' | ||
import CreatorLocks from './CreatorLocks' | ||
import {setTransaction} from '../../actions/transaction' | ||
import { connect } from 'react-redux' | ||
|
||
export default class Dashboard extends Component { | ||
export class Dashboard extends Component { | ||
render() { | ||
if (!this.props.account) { | ||
return null //loading | ||
} | ||
|
||
return ( | ||
<Layout title="Creator Dashboard"> | ||
<CreatorAccount network={this.props.network} account={this.props.account} /> | ||
|
@@ -22,3 +28,18 @@ Dashboard.propTypes = { | |
transactions: UnlockPropTypes.transactions, | ||
locks: UnlockPropTypes.locks, | ||
} | ||
|
||
const mapStateToProps = state => { | ||
return { | ||
account: state.network.account, // TODO change account to base level | ||
network: state.network, | ||
transactions: state.transactions, | ||
locks: state.locks, | ||
} | ||
} | ||
|
||
const mapDispatchToProps = dispatch => ({ | ||
setTransaction: (transaction) => dispatch(setTransaction(transaction)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we actually calling this anywhere in the component? |
||
}) | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(Dashboard) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
import styled from 'styled-components' | ||
import React, { PureComponent } from 'react' | ||
import UnlockPropTypes from '../../propTypes' | ||
import Layout from '../interface/Layout' | ||
import { Section, Headline, SubTitle, CallToAction, ThreeColumns, Column } from './Components' | ||
import { ActionButton } from '../creator/CreatorLocks' | ||
|
||
export default class Home extends PureComponent { | ||
constructor(props) { | ||
super(props) | ||
this.dashboardClick = this.dashboardClick.bind(this) | ||
} | ||
|
||
dashboardClick() { | ||
this.props.history.push('/dashboard') | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hum, I would expect react router to handle that for you? |
||
|
||
render() { | ||
return ( | ||
<Layout forContent={true}> | ||
|
@@ -13,7 +23,7 @@ export default class Home extends PureComponent { | |
Unlock is a protocol which enables creators to monetize their content with a few lines of code in a fully decentralized way. | ||
</Headline> | ||
|
||
<Action> | ||
<Action onClick={this.dashboardClick}> | ||
<HomepageButton>Go to Your Dashboard</HomepageButton> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, you should probably use |
||
<ButtonLabel>Requires a browser with an Ethereum wallet</ButtonLabel> | ||
</Action> | ||
|
@@ -51,6 +61,10 @@ export default class Home extends PureComponent { | |
} | ||
} | ||
|
||
Home.propTypes = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can probably get rid of this ;) |
||
history: UnlockPropTypes.Object, | ||
} | ||
|
||
const ImageWithHover = styled.div` | ||
border-style: none; | ||
background: url(${props => (`/images/pages/png/${props.base}.png`)}) no-repeat center/contain; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably eventually handle that at a higher level.. But that'll do for now!