-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4810 from parasharrajat/locale-pick
fix Locale Picker and small picker styles
- Loading branch information
Showing
7 changed files
with
81 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
import CONST from '../../../CONST'; | ||
import getBrowser from '../../../libs/getBrowser'; | ||
import styles from '../../../styles/styles'; | ||
|
||
const pickerStyles = disabled => styles.expensiPicker(disabled); | ||
const pickerStylesWeb = () => { | ||
if (CONST.BROWSER.FIREFOX === getBrowser()) { | ||
return { | ||
textIndent: -2, | ||
}; | ||
} | ||
return {}; | ||
}; | ||
|
||
const pickerStyles = disabled => ({ | ||
...styles.expensiPicker(disabled), | ||
inputWeb: { | ||
...styles.expensiPicker(disabled).inputWeb, | ||
...pickerStylesWeb(), | ||
}, | ||
}); | ||
|
||
export default pickerStyles; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default () => ''; |
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,42 @@ | ||
import CONST from '../../CONST'; | ||
|
||
/** | ||
* Fetch browser name from UA string | ||
* | ||
* @return {String} e.g. Chrome | ||
*/ | ||
function getBrowser() { | ||
const {userAgent} = window.navigator; | ||
let match = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))/i) || []; | ||
let temp; | ||
|
||
if (/trident/i.test(match[1])) { | ||
return 'IE'; | ||
} | ||
|
||
if (match[1] && (match[1].toLowerCase() === 'chrome')) { | ||
temp = userAgent.match(/\b(OPR|Edge)\/(\d+)/); | ||
|
||
if (temp !== null) { | ||
return temp.slice(1).replace('OPR', 'Opera'); | ||
} | ||
|
||
temp = userAgent.match(/\b(Edg)\/(\d+)/); | ||
|
||
if (temp !== null) { | ||
return temp.slice(1).replace('Edg', 'Edge'); | ||
} | ||
} | ||
|
||
match = match[1] ? match[1] : navigator.appName; | ||
return match; | ||
} | ||
|
||
/** | ||
* Get the Browser name | ||
* @returns {String} | ||
*/ | ||
export default () => { | ||
const browser = getBrowser(); | ||
return browser ? browser.toLowerCase() : CONST.BROWSER.OTHER; | ||
}; |
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