lbry-desktop/src/ui/component/header/index.js

23 lines
729 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2019-03-28 17:53:13 +01:00
import { selectBalance } from 'lbry-redux';
2018-11-21 22:20:55 +01:00
import { formatCredits } from 'util/format-credits';
2018-03-26 23:32:43 +02:00
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded } from 'redux/selectors/app';
2018-04-18 06:03:01 +02:00
import { doDownloadUpgradeRequested } from 'redux/actions/app';
import Header from './view';
2017-04-22 15:17:01 +02:00
2017-06-06 06:21:55 +02:00
const select = state => ({
autoUpdateDownloaded: selectAutoUpdateDownloaded(state),
balance: selectBalance(state),
isUpgradeAvailable: selectIsUpgradeAvailable(state),
roundedBalance: formatCredits(selectBalance(state) || 0, 2),
2017-06-06 06:21:55 +02:00
});
2017-04-22 15:17:01 +02:00
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
downloadUpgradeRequested: () => dispatch(doDownloadUpgradeRequested()),
2017-06-06 06:21:55 +02:00
});
2017-04-22 15:17:01 +02:00
2018-06-25 08:07:45 +02:00
export default connect(
select,
perform
)(Header);