-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(display right country flag on mobile phone change)
- Loading branch information
1 parent
a624899
commit fda9f68
Showing
5 changed files
with
31 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/blockchain-wallet-v4-frontend/src/modals/MobileNumberChange/selectors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import PhoneNumber from 'awesome-phonenumber' | ||
import { lift } from 'ramda' | ||
|
||
import { formValueSelector } from 'redux-form' | ||
import { selectors } from 'data' | ||
|
||
const getCountryCode = (defaultCode, currentNumber) => | ||
currentNumber ? PhoneNumber(currentNumber).getRegionCode() : defaultCode | ||
|
||
export const getData = (state) => { | ||
const currentNumber = selectors.core.settings.getSmsNumber(state) | ||
const defaultCode = selectors.core.settings.getCountryCode(state) | ||
return { | ||
mobileNumber: formValueSelector('mobileNumberChange')(state, 'mobileNumber'), | ||
countryCode: lift(getCountryCode)(defaultCode, currentNumber) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters