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

25 lines
495 B
JavaScript
Raw Normal View History

2017-04-22 20:17:01 +07:00
import React from 'react'
2017-05-06 00:05:33 +07:00
import lbry from 'lbry'
2017-04-22 20:17:01 +07:00
import {
connect
} from 'react-redux'
import {
2017-05-03 23:44:08 -04:00
selectBalance
} from 'selectors/wallet'
2017-04-22 20:17:01 +07:00
import {
doNavigate,
2017-05-03 23:44:08 -04:00
doHistoryBack,
2017-04-22 20:17:01 +07:00
} from 'actions/app'
import Header from './view'
const select = (state) => ({
2017-05-03 23:44:08 -04:00
balance: lbry.formatCredits(selectBalance(state), 1)
2017-04-22 20:17:01 +07:00
})
const perform = (dispatch) => ({
navigate: (path) => dispatch(doNavigate(path)),
2017-05-03 23:44:08 -04:00
back: () => dispatch(doHistoryBack()),
2017-04-22 20:17:01 +07:00
})
export default connect(select, perform)(Header)