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,
href,
subPages,
badge,
label,
linkClick,
icon,
} = props
const isSelected = (
currentPage == href.substr(1) ||
currentPage == href.substr(0) ||
(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
@ -32,9 +33,9 @@ class Drawer extends React.Component {
componentDidMount() {
const { updateBalance } = this.props
this._balanceSubscribeId = lbry.balanceSubscribe(function(balance) {
this._balanceSubscribeId = lbry.balanceSubscribe((balance) => {
updateBalance(balance)
}.bind(this));
});
}
componentWillUnmount() {
if (this._balanceSubscribeId) {
@ -46,7 +47,6 @@ class Drawer extends React.Component {
const {
closeDrawerClick,
logoClick,
currentPage,
balance,
} = 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='publish' label="Publish" icon="icon-upload" />
<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='help' label="Help" icon='icon-question-circle' />
</nav>)

View file

@ -15,7 +15,7 @@ const Link = (props) => {
disabled,
} = props
console.log(props);
const className = (props.className || '') +
(!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' : '') +

View file

@ -35,7 +35,7 @@ var init = function() {
function onDaemonReady() {
window.sessionStorage.setItem('loaded', 'y'); //once we've made it here once per session, we don't need to show splash again
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
ReactDOM.render(<Provider store={store}><div>{ lbryio.enabled ? <AuthOverlay/> : '' }<App /><SnackBar /></div></Provider>, canvas)
}
if (window.sessionStorage.getItem('loaded') == 'y') {