- {btc.renderCurrency(ticker.currency)}
-
-
-
+
+ {currencyName}
+ setWalletCurrencyFilters(!info.showWalletCurrencyFilters)}>
+
+
+
+
+ {
+ currentCurrencyFilters.map(filter =>
+ - onCurrencyFilterClick(filter.key)}>{filter.name}
)
+ }
+
+
≈ ${usdAmount ? usdAmount.toLocaleString() : ''}
@@ -113,7 +133,11 @@ Wallet.propTypes = {
openReceiveModal: PropTypes.func.isRequired,
showPayLoadingScreen: PropTypes.bool.isRequired,
showSuccessPayScreen: PropTypes.bool.isRequired,
- successTransactionScreen: PropTypes.object.isRequired
+ successTransactionScreen: PropTypes.object.isRequired,
+ currentCurrencyFilters: PropTypes.array.isRequired,
+ currencyName: PropTypes.string.isRequired,
+ setCurrency: PropTypes.func.isRequired,
+ setWalletCurrencyFilters: PropTypes.func.isRequired
}
export default Wallet
diff --git a/app/components/Wallet/Wallet.scss b/app/components/Wallet/Wallet.scss
index 2ad5670f..7b9b8ecd 100644
--- a/app/components/Wallet/Wallet.scss
+++ b/app/components/Wallet/Wallet.scss
@@ -43,8 +43,12 @@
display: flex;
flex-direction: row;
+ .qrCode {
+ cursor: pointer;
+ }
+
.bitcoinLogo svg {
- width: 32px;
+ width: 20px;
height: 32px;
}
@@ -83,6 +87,40 @@
.currency {
margin-left: 2.5px;
}
+
+ .currencyContainer {
+ position: relative;
+ display: inline-block;
+
+ svg {
+ width: 25px;
+ height: 32px;
+ color: $white;
+ }
+
+ ul {
+ visibility: hidden;
+ position: absolute;
+ top: 30px;
+
+ &.active {
+ visibility: visible;
+ }
+
+ li {
+ font-size: 12px;
+ padding: 0px 15px;
+ background: #191919;
+ cursor: pointer;
+ transition: 0.25s hover;
+ border-bottom: 1px solid #0f0f0f;
+
+ &:hover {
+ background: #0f0f0f;
+ }
+ }
+ }
+ }
}
.tickerButtons {
diff --git a/app/reducers/contactsform.js b/app/reducers/contactsform.js
index 6c9f6f8c..5dd7ee1d 100644
--- a/app/reducers/contactsform.js
+++ b/app/reducers/contactsform.js
@@ -15,7 +15,7 @@ const initialState = {
searchQuery: '',
manualSearchQuery: '',
- contactCapacity: 0.1,
+ contactCapacity: 0,
node: {},
showErrors: {
manualInput: false
diff --git a/app/reducers/info.js b/app/reducers/info.js
index 69f16f33..1de99d91 100644
--- a/app/reducers/info.js
+++ b/app/reducers/info.js
@@ -7,6 +7,7 @@ import { blockExplorer } from 'utils'
// ------------------------------------
export const GET_INFO = 'GET_INFO'
export const RECEIVE_INFO = 'RECEIVE_INFO'
+export const SET_WALLET_CURRENCY_FILTERS = 'SET_WALLET_CURRENCY_FILTERS'
// ------------------------------------
// Actions
@@ -17,6 +18,13 @@ export function getInfo() {
}
}
+export function setWalletCurrencyFilters(showWalletCurrencyFilters) {
+ return {
+ type: SET_WALLET_CURRENCY_FILTERS,
+ showWalletCurrencyFilters
+ }
+}
+
// Send IPC event for getinfo
export const fetchInfo = () => async (dispatch) => {
dispatch(getInfo())
@@ -36,7 +44,8 @@ export const receiveInfo = (event, data) => (dispatch) => {
// ------------------------------------
const ACTION_HANDLERS = {
[GET_INFO]: state => ({ ...state, infoLoading: true }),
- [RECEIVE_INFO]: (state, { data }) => ({ ...state, infoLoading: false, data })
+ [RECEIVE_INFO]: (state, { data }) => ({ ...state, infoLoading: false, data }),
+ [SET_WALLET_CURRENCY_FILTERS]: (state, { showWalletCurrencyFilters }) => ({ ...state, showWalletCurrencyFilters })
}
// ------------------------------------
@@ -44,7 +53,8 @@ const ACTION_HANDLERS = {
// ------------------------------------
const initialState = {
infoLoading: false,
- data: {}
+ data: {},
+ showWalletCurrencyFilters: false
}
// Selectors
diff --git a/app/reducers/ticker.js b/app/reducers/ticker.js
index 0350aff2..4069643a 100644
--- a/app/reducers/ticker.js
+++ b/app/reducers/ticker.js
@@ -64,7 +64,7 @@ export const receiveCryptocurrency = (event, currency) => (dispatch) => {
// Action Handlers
// ------------------------------------
const ACTION_HANDLERS = {
- [SET_CURRENCY]: (state, { currency }) => ({ ...state, currency }),
+ [SET_CURRENCY]: (state, { currency }) => ({ ...state, fromCurrency: state.currency, currency }),
[SET_CRYPTO]: (state, { crypto }) => ({ ...state, crypto }),
[GET_TICKERS]: state => ({ ...state, tickerLoading: true }),
[RECIEVE_TICKERS]: (state, { btcTicker, ltcTicker }) => (
@@ -113,6 +113,7 @@ export { tickerSelectors }
const initialState = {
tickerLoading: false,
currency: '',
+ fromCurrency: 'sats',
crypto: '',
btcTicker: null,
ltcTicker: null,
diff --git a/app/routes/activity/containers/ActivityContainer.js b/app/routes/activity/containers/ActivityContainer.js
index 8f2b1f75..3fc3702e 100644
--- a/app/routes/activity/containers/ActivityContainer.js
+++ b/app/routes/activity/containers/ActivityContainer.js
@@ -25,6 +25,8 @@ import { setFormType } from 'reducers/form'
import { payFormSelectors } from 'reducers/payform'
+import { setWalletCurrencyFilters } from 'reducers/info'
+
import Activity from '../components/Activity'
const mapDispatchToProps = {
@@ -42,7 +44,8 @@ const mapDispatchToProps = {
openWalletModal,
fetchBalance,
updateSearchText,
- setFormType
+ setFormType,
+ setWalletCurrencyFilters
}
const mapStateToProps = state => ({
@@ -64,6 +67,8 @@ const mapStateToProps = state => ({
invoiceModalOpen: invoiceSelectors.invoiceModalOpen(state),
currentTicker: tickerSelectors.currentTicker(state),
+ currentCurrencyFilters: tickerSelectors.currentCurrencyFilters(state),
+ currencyName: tickerSelectors.currencyName(state),
currentActivity: activitySelectors.currentActivity(state)(state),
nonActiveFilters: activitySelectors.nonActiveFilters(state),
@@ -81,8 +86,11 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
showPayLoadingScreen: stateProps.showPayLoadingScreen,
showSuccessPayScreen: stateProps.payment.showSuccessPayScreen,
successTransactionScreen: stateProps.transaction.successTransactionScreen,
+ currentCurrencyFilters: stateProps.currentCurrencyFilters,
+ currencyName: stateProps.currencyName,
setCurrency: dispatchProps.setCurrency,
+ setWalletCurrencyFilters: dispatchProps.setWalletCurrencyFilters,
newAddress: dispatchProps.newAddress,
openReceiveModal: dispatchProps.openWalletModal,
openPayForm: () => dispatchProps.setFormType('PAY_FORM'),
diff --git a/app/utils/btc.js b/app/utils/btc.js
index 5abef070..cc17ac97 100644
--- a/app/utils/btc.js
+++ b/app/utils/btc.js
@@ -52,6 +52,7 @@ export function bitsToUsd(bits, price) {
export function satoshisToBtc(satoshis) {
if (satoshis === undefined || satoshis === null || satoshis === '') return null
+ console.log('satoshis: ', satoshis)
const btcAmount = sb.toBitcoin(satoshis).toFixed(8)
return btcAmount > 0 ? btcAmount : btcAmount * -1
}
diff --git a/test/reducers/__snapshots__/info.spec.js.snap b/test/reducers/__snapshots__/info.spec.js.snap
index 1fd77f2b..00700f8d 100644
--- a/test/reducers/__snapshots__/info.spec.js.snap
+++ b/test/reducers/__snapshots__/info.spec.js.snap
@@ -4,6 +4,7 @@ exports[`reducers infoReducer should correctly getInfo 1`] = `
Object {
"data": Object {},
"infoLoading": true,
+ "showWalletCurrencyFilters": false,
}
`;
@@ -11,6 +12,7 @@ exports[`reducers infoReducer should correctly receiveInfo 1`] = `
Object {
"data": "foo",
"infoLoading": false,
+ "showWalletCurrencyFilters": false,
}
`;
@@ -18,5 +20,6 @@ exports[`reducers infoReducer should handle initial state 1`] = `
Object {
"data": Object {},
"infoLoading": false,
+ "showWalletCurrencyFilters": false,
}
`;
diff --git a/test/reducers/__snapshots__/ticker.spec.js.snap b/test/reducers/__snapshots__/ticker.spec.js.snap
index 28c328ee..0126a1b1 100644
--- a/test/reducers/__snapshots__/ticker.spec.js.snap
+++ b/test/reducers/__snapshots__/ticker.spec.js.snap
@@ -19,6 +19,7 @@ Object {
"name": "satoshis",
},
],
+ "fromCurrency": "sats",
"ltcTicker": null,
"tickerLoading": true,
}
@@ -43,6 +44,7 @@ Object {
"name": "satoshis",
},
],
+ "fromCurrency": "sats",
"ltcTicker": undefined,
"tickerLoading": false,
}
@@ -67,6 +69,7 @@ Object {
"name": "satoshis",
},
],
+ "fromCurrency": "sats",
"ltcTicker": null,
"tickerLoading": false,
}
@@ -91,6 +94,7 @@ Object {
"name": "satoshis",
},
],
+ "fromCurrency": "",
"ltcTicker": null,
"tickerLoading": false,
}
@@ -115,6 +119,7 @@ Object {
"name": "satoshis",
},
],
+ "fromCurrency": "sats",
"ltcTicker": null,
"tickerLoading": false,
}