Redux #115

Merged
6ea86b96 merged 57 commits from redux into redux 2017-05-05 22:55:12 +02:00
3 changed files with 8 additions and 8 deletions
Showing only changes of commit d5b411b572 - Show all commits

View file

@ -7,16 +7,17 @@ const DrawerItem = (props) => {
currentPage, currentPage,
href, href,
subPages, subPages,
badge,
label, label,
linkClick, linkClick,
icon, icon,
} = props } = props
const isSelected = ( const isSelected = (
currentPage == href.substr(1) || currentPage == href.substr(0) ||
(subPages && subPages.indexOf(currentPage) != -1) (subPages && subPages.indexOf(currentPage) != -1)
) )
return <Link icon={icon} label={label} onClick={() => linkClick(href)} className={ 'drawer-item ' + (isSelected ? 'drawer-item-selected' : '') } /> return <Link icon={icon} badge={badge} label={label} onClick={() => linkClick(href)} className={ 'drawer-item ' + (isSelected ? 'drawer-item-selected' : '') } />
} }
var drawerImageStyle = { //@TODO: remove this, img should be properly scaled once size is settled var drawerImageStyle = { //@TODO: remove this, img should be properly scaled once size is settled
@ -32,9 +33,9 @@ class Drawer extends React.Component {
componentDidMount() { componentDidMount() {
const { updateBalance } = this.props const { updateBalance } = this.props
this._balanceSubscribeId = lbry.balanceSubscribe(function(balance) { this._balanceSubscribeId = lbry.balanceSubscribe((balance) => {
updateBalance(balance) updateBalance(balance)
}.bind(this)); });
} }
componentWillUnmount() { componentWillUnmount() {
if (this._balanceSubscribeId) { if (this._balanceSubscribeId) {
@ -46,7 +47,6 @@ class Drawer extends React.Component {
const { const {
closeDrawerClick, closeDrawerClick,
logoClick, logoClick,
currentPage,
balance, balance,
} = this.props } = this.props
@ -58,7 +58,7 @@ class Drawer extends React.Component {
<DrawerItem {...this.props} href='discover' label="Discover" icon="icon-search" /> <DrawerItem {...this.props} href='discover' label="Discover" icon="icon-search" />
<DrawerItem {...this.props} href='publish' label="Publish" icon="icon-upload" /> <DrawerItem {...this.props} href='publish' label="Publish" icon="icon-upload" />
<DrawerItem {...this.props} href='downloaded' subPages={['published']} label="My Files" icon='icon-cloud-download' /> <DrawerItem {...this.props} href='downloaded' subPages={['published']} label="My Files" icon='icon-cloud-download' />
<DrawerItem {...this.props} href="wallet" subPages={['send', 'receive', 'claim', 'referral']} label="My Wallet" badge={lbry.formatCredits(balance) } icon="icon-bank" /> <DrawerItem {...this.props} href="wallet" subPages={['send', 'receive', 'claim']} label="My Wallet" badge={lbry.formatCredits(balance) } icon="icon-bank" />
<DrawerItem {...this.props} href='settings' label="Settings" icon='icon-gear' /> <DrawerItem {...this.props} href='settings' label="Settings" icon='icon-gear' />
<DrawerItem {...this.props} href='help' label="Help" icon='icon-question-circle' /> <DrawerItem {...this.props} href='help' label="Help" icon='icon-question-circle' />
</nav>) </nav>)

View file

@ -15,7 +15,7 @@ const Link = (props) => {
disabled, disabled,
} = props } = props
console.log(props);
const className = (props.className || '') + const className = (props.className || '') +
(!props.className && !props.button ? 'button-text' : '') + // Non-button links get the same look as text buttons (!props.className && !props.button ? 'button-text' : '') + // Non-button links get the same look as text buttons
(props.button ? ' button-block button-' + props.button + ' button-set-item' : '') + (props.button ? ' button-block button-' + props.button + ' button-set-item' : '') +