diff --git a/.eslintrc.js b/.eslintrc.js index 5e378146d9c..07dce492d8d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,6 +3,12 @@ module.exports = { root: true, parser: 'babel-eslint', extends: ['@react-native-community', 'eslint:recommended', 'plugin:import/warnings', 'plugin:react/recommended'], + overrides: [ + { + files: ['*.{ts,tsx}'], + extends: ['@metamask/eslint-config-typescript'], + }, + ], globals: { process: true, beforeAll: true, @@ -18,12 +24,12 @@ module.exports = { beforeEach: true, device: true, waitFor: true, - __DEV__: true + __DEV__: true, }, settings: { 'import/resolver': { - typescript: {} // this loads /tsconfig.json to eslint - } + typescript: {}, // this loads /tsconfig.json to eslint + }, }, rules: { 'no-catch-shadow': 0, @@ -33,8 +39,8 @@ module.exports = { 'single', { avoidEscape: true, - allowTemplateLiterals: true - } + allowTemplateLiterals: true, + }, ], 'comma-dangle': 0, curly: 0, @@ -65,8 +71,8 @@ module.exports = { 'no-constant-condition': [ 2, { - checkLoops: false - } + checkLoops: false, + }, ], 'no-duplicate-imports': 2, 'no-empty-function': 2, @@ -89,8 +95,8 @@ module.exports = { 'no-unneeded-ternary': [ 2, { - defaultAssignment: false - } + defaultAssignment: false, + }, ], 'no-unsafe-negation': 2, 'no-unused-expressions': 'off', @@ -126,13 +132,13 @@ module.exports = { 'react/no-multi-comp': [ 2, { - ignoreStateless: true - } + ignoreStateless: true, + }, ], 'react/no-render-return-value': 2, 'react/no-string-refs': 2, 'react/no-unused-prop-types': 2, 'react/prefer-es6-class': 2, - radix: 0 - } + radix: 0, + }, }; diff --git a/app/__mocks__/@react-native-community/async-storage.js b/app/__mocks__/@react-native-community/async-storage.js index 8557eb27f8b..a0727d68263 100644 --- a/app/__mocks__/@react-native-community/async-storage.js +++ b/app/__mocks__/@react-native-community/async-storage.js @@ -1,9 +1,9 @@ -const _isObject = obj => typeof obj === 'object' && !Array.isArray(obj); +const _isObject = (obj) => typeof obj === 'object' && !Array.isArray(obj); const _deepMergeInto = (oldObject, newObject) => { const newKeys = Object.keys(newObject); const mergedObject = oldObject; - newKeys.forEach(key => { + newKeys.forEach((key) => { const oldValue = mergedObject[key]; const newValue = newObject[key]; @@ -46,11 +46,11 @@ const asMock = { multiGet: _multiGet, multiSet: _multiSet, multiRemove: _multiRemove, - multiMerge: _multiMerge + multiMerge: _multiMerge, }; async function _multiSet(keyValuePairs, callback) { - keyValuePairs.forEach(keyValue => { + keyValuePairs.forEach((keyValue) => { const key = keyValue[0]; asMock.__INTERNAL_MOCK_STORAGE__[key] = keyValue[1]; @@ -60,14 +60,14 @@ async function _multiSet(keyValuePairs, callback) { } async function _multiGet(keys, callback) { - const values = keys.map(key => [key, asMock.__INTERNAL_MOCK_STORAGE__[key] || null]); + const values = keys.map((key) => [key, asMock.__INTERNAL_MOCK_STORAGE__[key] || null]); callback && callback(null, values); return values; } async function _multiRemove(keys, callback) { - keys.forEach(key => { + keys.forEach((key) => { if (asMock.__INTERNAL_MOCK_STORAGE__[key]) { delete asMock.__INTERNAL_MOCK_STORAGE__[key]; } @@ -90,7 +90,7 @@ async function _getAllKeys() { } async function _multiMerge(keyValuePairs, callback) { - keyValuePairs.forEach(keyValue => { + keyValuePairs.forEach((keyValue) => { const key = keyValue[0]; const value = JSON.parse(keyValue[1]); diff --git a/app/__mocks__/react-native-splash-screen.js b/app/__mocks__/react-native-splash-screen.js index 2d1f2115c3f..09d54d52bc2 100644 --- a/app/__mocks__/react-native-splash-screen.js +++ b/app/__mocks__/react-native-splash-screen.js @@ -6,5 +6,5 @@ export default { hide: jest.fn().mockImplementation(() => { // eslint-disable-next-line no-console console.log('hide splash screen'); - }) + }), }; diff --git a/app/__mocks__/rn-fetch-blob.js b/app/__mocks__/rn-fetch-blob.js index efdd761092c..4762025727a 100644 --- a/app/__mocks__/rn-fetch-blob.js +++ b/app/__mocks__/rn-fetch-blob.js @@ -13,8 +13,8 @@ export default { exists: () => Promise.resolve(), dirs: { CacheDir: noop, - DocumentDir: noop - } + DocumentDir: noop, + }, }, - wrap: noop + wrap: noop, }; diff --git a/app/actions/alert/index.js b/app/actions/alert/index.js index ff45ad9ce55..4e3d0a0ed0a 100644 --- a/app/actions/alert/index.js +++ b/app/actions/alert/index.js @@ -1,6 +1,6 @@ export function dismissAlert() { return { - type: 'HIDE_ALERT' + type: 'HIDE_ALERT', }; } @@ -10,6 +10,6 @@ export function showAlert({ isVisible, autodismiss, content, data }) { isVisible, autodismiss, content, - data + data, }; } diff --git a/app/actions/bookmarks/index.js b/app/actions/bookmarks/index.js index 12e26dcf007..c6c9a007ea5 100644 --- a/app/actions/bookmarks/index.js +++ b/app/actions/bookmarks/index.js @@ -1,13 +1,13 @@ export function addBookmark(bookmark) { return { type: 'ADD_BOOKMARK', - bookmark + bookmark, }; } export function removeBookmark(bookmark) { return { type: 'REMOVE_BOOKMARK', - bookmark + bookmark, }; } diff --git a/app/actions/browser/index.js b/app/actions/browser/index.js index 3e13c02e4c6..7cf6f908e60 100644 --- a/app/actions/browser/index.js +++ b/app/actions/browser/index.js @@ -9,7 +9,7 @@ export function addToHistory({ url, name }) { return { type: 'ADD_TO_BROWSER_HISTORY', url, - name + name, }; } @@ -18,7 +18,7 @@ export function addToHistory({ url, name }) { */ export function clearHistory() { return { - type: 'CLEAR_BROWSER_HISTORY' + type: 'CLEAR_BROWSER_HISTORY', }; } @@ -30,7 +30,7 @@ export function clearHistory() { export function addToWhitelist(url) { return { type: 'ADD_TO_BROWSER_WHITELIST', - url + url, }; } @@ -39,7 +39,7 @@ export function addToWhitelist(url) { */ export function closeAllTabs() { return { - type: 'CLOSE_ALL_TABS' + type: 'CLOSE_ALL_TABS', }; } @@ -52,7 +52,7 @@ export function createNewTab(url) { return { type: 'CREATE_NEW_TAB', url, - id: Date.now() + id: Date.now(), }; } @@ -64,7 +64,7 @@ export function createNewTab(url) { export function closeTab(id) { return { type: 'CLOSE_TAB', - id + id, }; } @@ -76,7 +76,7 @@ export function closeTab(id) { export function setActiveTab(id) { return { type: 'SET_ACTIVE_TAB', - id + id, }; } @@ -90,6 +90,6 @@ export function updateTab(id, data) { return { type: 'UPDATE_TAB', id, - data + data, }; } diff --git a/app/actions/collectibles/index.js b/app/actions/collectibles/index.js index 7a3b3062dc0..9b2daf056ab 100644 --- a/app/actions/collectibles/index.js +++ b/app/actions/collectibles/index.js @@ -4,12 +4,12 @@ export const addFavoriteCollectible = (selectedAddress, chainId, collectible) => type: ADD_FAVORITE_COLLECTIBLE, selectedAddress, chainId, - collectible + collectible, }); export const removeFavoriteCollectible = (selectedAddress, chainId, collectible) => ({ type: REMOVE_FAVORITE_COLLECTIBLE, selectedAddress, chainId, - collectible + collectible, }); diff --git a/app/actions/infuraAvailability/index.js b/app/actions/infuraAvailability/index.js index 7fd1b8ec23d..93b92eabebc 100644 --- a/app/actions/infuraAvailability/index.js +++ b/app/actions/infuraAvailability/index.js @@ -2,12 +2,12 @@ import { INFURA_AVAILABILITY_BLOCKED, INFURA_AVAILABILITY_NOT_BLOCKED } from '.. export function setInfuraAvailabilityBlocked() { return { - type: INFURA_AVAILABILITY_BLOCKED + type: INFURA_AVAILABILITY_BLOCKED, }; } export function setInfuraAvailabilityNotBlocked() { return { - type: INFURA_AVAILABILITY_NOT_BLOCKED + type: INFURA_AVAILABILITY_NOT_BLOCKED, }; } diff --git a/app/actions/modals/index.js b/app/actions/modals/index.js index 54666a5789e..3b7f3168a56 100644 --- a/app/actions/modals/index.js +++ b/app/actions/modals/index.js @@ -1,39 +1,39 @@ // eslint-disable-next-line import/prefer-default-export export function toggleNetworkModal() { return { - type: 'TOGGLE_NETWORK_MODAL' + type: 'TOGGLE_NETWORK_MODAL', }; } export function toggleAccountsModal() { return { - type: 'TOGGLE_ACCOUNT_MODAL' + type: 'TOGGLE_ACCOUNT_MODAL', }; } export function toggleCollectibleContractModal() { return { - type: 'TOGGLE_COLLECTIBLE_CONTRACT_MODAL' + type: 'TOGGLE_COLLECTIBLE_CONTRACT_MODAL', }; } export function toggleReceiveModal(asset) { return { type: 'TOGGLE_RECEIVE_MODAL', - asset + asset, }; } export function toggleDappTransactionModal(show) { return { type: 'TOGGLE_DAPP_TRANSACTION_MODAL', - show + show, }; } export function toggleApproveModal(show) { return { type: 'TOGGLE_APPROVE_MODAL', - show + show, }; } diff --git a/app/actions/notification/index.js b/app/actions/notification/index.js index 142c3b8a250..cfa6852942d 100644 --- a/app/actions/notification/index.js +++ b/app/actions/notification/index.js @@ -1,13 +1,13 @@ export function hideCurrentNotification() { return { - type: 'HIDE_CURRENT_NOTIFICATION' + type: 'HIDE_CURRENT_NOTIFICATION', }; } export function hideNotificationById(id) { return { type: 'HIDE_NOTIFICATION_BY_ID', - id + id, }; } @@ -16,7 +16,7 @@ export function modifyOrShowTransactionNotificationById({ autodismiss, transacti type: 'MODIFY_OR_SHOW_TRANSACTION_NOTIFICATION', autodismiss, transaction, - status + status, }; } @@ -26,7 +26,7 @@ export function modifyOrShowSimpleNotificationById({ autodismiss, title, descrip autodismiss, title, description, - status + status, }; } @@ -34,20 +34,20 @@ export function replaceNotificationById(notification) { return { type: 'REPLACE_NOTIFICATION_BY_ID', notification, - id: notification.id + id: notification.id, }; } export function removeNotificationById(id) { return { type: 'REMOVE_NOTIFICATION_BY_ID', - id + id, }; } export function removeCurrentNotification() { return { - type: 'REMOVE_CURRENT_NOTIFICATION' + type: 'REMOVE_CURRENT_NOTIFICATION', }; } @@ -58,7 +58,7 @@ export function showSimpleNotification({ autodismiss, title, description, status autodismiss, title, description, - status + status, }; } @@ -67,12 +67,12 @@ export function showTransactionNotification({ autodismiss, transaction, status } type: 'SHOW_TRANSACTION_NOTIFICATION', autodismiss, transaction, - status + status, }; } export function removeNotVisibleNotifications() { return { - type: 'REMOVE_NOT_VISIBLE_NOTIFICATIONS' + type: 'REMOVE_NOT_VISIBLE_NOTIFICATIONS', }; } diff --git a/app/actions/onboarding/index.js b/app/actions/onboarding/index.js index 75682bb0f05..2873e957fee 100644 --- a/app/actions/onboarding/index.js +++ b/app/actions/onboarding/index.js @@ -6,7 +6,7 @@ export function saveOnboardingEvent(event) { return { type: 'SAVE_EVENT', - event + event, }; } @@ -15,6 +15,6 @@ export function saveOnboardingEvent(event) { */ export function clearOnboardingEvents() { return { - type: 'CLEAR_EVENTS' + type: 'CLEAR_EVENTS', }; } diff --git a/app/actions/privacy/index.js b/app/actions/privacy/index.js index 600c9896849..0f088d92fdd 100644 --- a/app/actions/privacy/index.js +++ b/app/actions/privacy/index.js @@ -1,14 +1,14 @@ export function approveHost(hostname) { return { type: 'APPROVE_HOST', - hostname + hostname, }; } export function rejectHost(hostname) { return { type: 'REJECT_HOST', - hostname + hostname, }; } @@ -19,13 +19,13 @@ export function clearHosts() { export function setPrivacyMode(enabled) { return { type: 'SET_PRIVACY_MODE', - enabled + enabled, }; } export function setThirdPartyApiMode(enabled) { return { type: 'SET_THIRD_PARTY_API_MODE', - enabled + enabled, }; } diff --git a/app/actions/recents/index.js b/app/actions/recents/index.js index 53c6e38242b..6297c1e1924 100644 --- a/app/actions/recents/index.js +++ b/app/actions/recents/index.js @@ -1,6 +1,6 @@ export default function addRecent(recent) { return { type: 'ADD_RECENT', - recent + recent, }; } diff --git a/app/actions/settings/index.js b/app/actions/settings/index.js index eca421a12c9..0bc52f7ab96 100644 --- a/app/actions/settings/index.js +++ b/app/actions/settings/index.js @@ -1,48 +1,48 @@ export function setSearchEngine(searchEngine) { return { type: 'SET_SEARCH_ENGINE', - searchEngine + searchEngine, }; } export function setShowHexData(showHexData) { return { type: 'SET_SHOW_HEX_DATA', - showHexData + showHexData, }; } export function setShowCustomNonce(showCustomNonce) { return { type: 'SET_SHOW_CUSTOM_NONCE', - showCustomNonce + showCustomNonce, }; } export function setHideZeroBalanceTokens(hideZeroBalanceTokens) { return { type: 'SET_HIDE_ZERO_BALANCE_TOKENS', - hideZeroBalanceTokens + hideZeroBalanceTokens, }; } export function setLockTime(lockTime) { return { type: 'SET_LOCK_TIME', - lockTime + lockTime, }; } export function setPrimaryCurrency(primaryCurrency) { return { type: 'SET_PRIMARY_CURRENCY', - primaryCurrency + primaryCurrency, }; } export function setUseBlockieIcon(useBlockieIcon) { return { type: 'SET_USE_BLOCKIE_ICON', - useBlockieIcon + useBlockieIcon, }; } diff --git a/app/actions/transaction/index.js b/app/actions/transaction/index.js index ee514d97cc7..e340e0e0917 100644 --- a/app/actions/transaction/index.js +++ b/app/actions/transaction/index.js @@ -1,7 +1,7 @@ import TransactionTypes from '../../core/TransactionTypes'; const { - ASSET: { ETH, ERC20, ERC721 } + ASSET: { ETH, ERC20, ERC721 }, } = TransactionTypes; /** @@ -9,7 +9,7 @@ const { */ export function resetTransaction() { return { - type: 'RESET_TRANSACTION' + type: 'RESET_TRANSACTION', }; } @@ -22,7 +22,7 @@ export function newAssetTransaction(selectedAsset) { return { type: 'NEW_ASSET_TRANSACTION', selectedAsset, - assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20 + assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20, }; } @@ -42,7 +42,7 @@ export function setRecipient(from, to, ensRecipient, transactionToName, transact to, ensRecipient, transactionToName, - transactionFromName + transactionFromName, }; } @@ -55,7 +55,7 @@ export function setSelectedAsset(selectedAsset) { return { type: 'SET_SELECTED_ASSET', selectedAsset, - assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20 + assetType: selectedAsset.isETH ? ETH : selectedAsset.tokenId ? ERC721 : ERC20, }; } @@ -67,7 +67,7 @@ export function setSelectedAsset(selectedAsset) { export function prepareTransaction(transaction) { return { type: 'PREPARE_TRANSACTION', - transaction + transaction, }; } @@ -88,7 +88,7 @@ export function prepareFullTransaction({ transactionToName, transactionFromName, selectedAsset, - assetType + assetType, }) { return { type: 'PREPARE_FULL_TRANSACTION', @@ -97,7 +97,7 @@ export function prepareFullTransaction({ transactionToName, transactionFromName, selectedAsset, - assetType + assetType, }; } @@ -109,7 +109,7 @@ export function prepareFullTransaction({ export function setTransactionObject(transaction) { return { type: 'SET_TRANSACTION_OBJECT', - transaction + transaction, }; } @@ -121,7 +121,7 @@ export function setTransactionObject(transaction) { export function setTokensTransaction(asset) { return { type: 'SET_TOKENS_TRANSACTION', - asset + asset, }; } @@ -133,7 +133,7 @@ export function setTokensTransaction(asset) { export function setEtherTransaction(transaction) { return { type: 'SET_ETHER_TRANSACTION', - transaction + transaction, }; } @@ -145,7 +145,7 @@ export function setEtherTransaction(transaction) { export function setIndividualTokenTransaction(token) { return { type: 'SET_INDIVIDUAL_TOKEN_TRANSACTION', - token + token, }; } @@ -157,7 +157,7 @@ export function setIndividualTokenTransaction(token) { export function setIndividualCollectibleTransaction(collectible) { return { type: 'SET_INDIVIDUAL_COLLECTIBLE_TRANSACTION', - collectible + collectible, }; } @@ -169,20 +169,20 @@ export function setIndividualCollectibleTransaction(collectible) { export function setCollectibleContractTransaction(collectible) { return { type: 'SET_COLLECTIBLE_CONTRACT_TRANSACTION', - collectible + collectible, }; } export function setNonce(nonce) { return { type: 'SET_NONCE', - nonce + nonce, }; } export function setProposedNonce(proposedNonce) { return { type: 'SET_PROPOSED_NONCE', - proposedNonce + proposedNonce, }; } diff --git a/app/actions/user/index.js b/app/actions/user/index.js index 1599bd5665d..8bb945d4131 100644 --- a/app/actions/user/index.js +++ b/app/actions/user/index.js @@ -1,66 +1,66 @@ export function passwordSet() { return { - type: 'PASSWORD_SET' + type: 'PASSWORD_SET', }; } export function passwordUnset() { return { - type: 'PASSWORD_UNSET' + type: 'PASSWORD_UNSET', }; } export function seedphraseBackedUp() { return { - type: 'SEEDPHRASE_BACKED_UP' + type: 'SEEDPHRASE_BACKED_UP', }; } export function seedphraseNotBackedUp() { return { - type: 'SEEDPHRASE_NOT_BACKED_UP' + type: 'SEEDPHRASE_NOT_BACKED_UP', }; } export function backUpSeedphraseAlertVisible() { return { - type: 'BACK_UP_SEEDPHRASE_VISIBLE' + type: 'BACK_UP_SEEDPHRASE_VISIBLE', }; } export function backUpSeedphraseAlertNotVisible() { return { - type: 'BACK_UP_SEEDPHRASE_NOT_VISIBLE' + type: 'BACK_UP_SEEDPHRASE_NOT_VISIBLE', }; } export function protectWalletModalVisible() { return { - type: 'PROTECT_MODAL_VISIBLE' + type: 'PROTECT_MODAL_VISIBLE', }; } export function protectWalletModalNotVisible() { return { - type: 'PROTECT_MODAL_NOT_VISIBLE' + type: 'PROTECT_MODAL_NOT_VISIBLE', }; } export function loadingSet(loadingMsg) { return { type: 'LOADING_SET', - loadingMsg + loadingMsg, }; } export function loadingUnset() { return { - type: 'LOADING_UNSET' + type: 'LOADING_UNSET', }; } export function setGasEducationCarouselSeen() { return { - type: 'SET_GAS_EDUCATION_CAROUSEL_SEEN' + type: 'SET_GAS_EDUCATION_CAROUSEL_SEEN', }; } diff --git a/app/actions/wizard/index.js b/app/actions/wizard/index.js index 1040ce526e4..01ce3d6fbb9 100644 --- a/app/actions/wizard/index.js +++ b/app/actions/wizard/index.js @@ -4,6 +4,6 @@ export default function setOnboardingWizardStep(step) { return { type: 'SET_ONBOARDING_WIZARD_STEP', - step + step, }; } diff --git a/app/components/Base/Alert.js b/app/components/Base/Alert.js index 1c454cab08e..f96110130e2 100644 --- a/app/components/Base/Alert.js +++ b/app/components/Base/Alert.js @@ -10,30 +10,30 @@ const styles = StyleSheet.create({ paddingVertical: 12, borderWidth: 1, borderRadius: 4, - flexDirection: 'row' + flexDirection: 'row', }, baseSmall: { - paddingVertical: 8 + paddingVertical: 8, }, info: { backgroundColor: colors.blue100, - borderColor: colors.blue + borderColor: colors.blue, }, warning: { backgroundColor: colors.yellow100, - borderColor: colors.yellow + borderColor: colors.yellow, }, error: { backgroundColor: colors.red000, - borderColor: colors.red + borderColor: colors.red, }, textInfo: { color: colors.blue, flexShrink: 1, lineHeight: 16.8 }, textWarning: { color: colors.yellow700, flexShrink: 1, lineHeight: 16.8 }, textError: { color: colors.red, flexShrink: 1, lineHeight: 16.8 }, textIconStyle: { marginRight: 12 }, iconWrapper: { - alignItems: 'center' - } + alignItems: 'center', + }, }); function getStyles(type) { @@ -75,7 +75,7 @@ Alert.propTypes = { small: PropTypes.bool, renderIcon: PropTypes.func, onPress: PropTypes.func, - children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]) + children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), }; export default Alert; diff --git a/app/components/Base/DetailsModal.js b/app/components/Base/DetailsModal.js index bbdbd3f8a4c..929dee118bf 100644 --- a/app/components/Base/DetailsModal.js +++ b/app/components/Base/DetailsModal.js @@ -10,18 +10,18 @@ const styles = StyleSheet.create({ modalContainer: { width: '100%', backgroundColor: colors.white, - borderRadius: 10 + borderRadius: 10, }, modalView: { flexDirection: 'column', justifyContent: 'center', - alignItems: 'center' + alignItems: 'center', }, header: { borderBottomWidth: StyleSheet.hairlineWidth, borderColor: colors.grey100, flexDirection: 'row', - paddingHorizontal: 16 + paddingHorizontal: 16, }, title: { flex: 1, @@ -30,32 +30,32 @@ const styles = StyleSheet.create({ marginVertical: 12, marginHorizontal: 24, color: colors.fontPrimary, - ...fontStyles.bold + ...fontStyles.bold, }, closeIcon: { paddingTop: 4, position: 'absolute', right: 16 }, body: { - paddingHorizontal: 15 + paddingHorizontal: 15, }, section: { paddingVertical: 16, - flexDirection: 'row' + flexDirection: 'row', }, sectionBorderBottom: { borderBottomColor: colors.grey100, - borderBottomWidth: 1 + borderBottomWidth: 1, }, column: { - flex: 1 + flex: 1, }, columnEnd: { - alignItems: 'flex-end' + alignItems: 'flex-end', }, sectionTitle: { ...fontStyles.normal, fontSize: 10, color: colors.grey500, - marginBottom: 8 - } + marginBottom: 8, + }, }); const DetailsModal = ({ children }) => ( @@ -93,36 +93,36 @@ DetailsModal.Column = DetailsModalColumn; const stylePropType = PropTypes.oneOfType([PropTypes.object, PropTypes.array]); DetailsModal.propTypes = { - children: PropTypes.node + children: PropTypes.node, }; DetailsModalHeader.propTypes = { - style: stylePropType + style: stylePropType, }; DetailsModalTitle.propTypes = { - style: stylePropType + style: stylePropType, }; DetailsModalCloseIcon.propTypes = { - style: stylePropType + style: stylePropType, }; DetailsModalBody.propTypes = { - style: stylePropType + style: stylePropType, }; DetailsModalSection.propTypes = { style: stylePropType, /** * Adds a border to the bottom of the section */ - borderBottom: PropTypes.bool + borderBottom: PropTypes.bool, }; DetailsModalSectionTitle.propTypes = { - style: stylePropType + style: stylePropType, }; DetailsModalColumn.propTypes = { style: stylePropType, /** * Aligns column content to flex-end */ - end: PropTypes.bool + end: PropTypes.bool, }; export default DetailsModal; diff --git a/app/components/Base/HorizontalSelector/index.js b/app/components/Base/HorizontalSelector/index.js index 079a400d545..c455827667b 100644 --- a/app/components/Base/HorizontalSelector/index.js +++ b/app/components/Base/HorizontalSelector/index.js @@ -11,22 +11,22 @@ const styles = StyleSheet.create({ display: 'flex', flexDirection: 'row', justifyContent: 'space-around', - alignItems: 'center' + alignItems: 'center', }, labels: { display: 'flex', flexDirection: 'row', justifyContent: 'space-around', - alignItems: 'flex-start' + alignItems: 'flex-start', }, option: { width: OPTION_WIDTH, display: 'flex', alignItems: 'center', flex: 0, - flexDirection: 'column' + flexDirection: 'column', }, - circle: size => ({ + circle: (size) => ({ width: size, height: size, flexShrink: 0, @@ -36,27 +36,27 @@ const styles = StyleSheet.create({ justifyContent: 'center', borderWidth: 2, borderRadius: 9999, - borderColor: colors.grey200 + borderColor: colors.grey200, }), circleSelected: { - borderColor: colors.blue + borderColor: colors.blue, }, circleError: { - borderColor: colors.red + borderColor: colors.red, }, circleDisabled: { - opacity: 0.4 + opacity: 0.4, }, - innerCircle: size => ({ + innerCircle: (size) => ({ width: size * INNER_CIRCLE_SCALE, height: size * INNER_CIRCLE_SCALE, flexShrink: 0, flexGrow: 0, backgroundColor: colors.blue, - borderRadius: 999 + borderRadius: 999, }), innerCircleError: { - backgroundColor: colors.red + backgroundColor: colors.red, }, verticalLine: { marginTop: 2, @@ -64,7 +64,7 @@ const styles = StyleSheet.create({ width: 0, height: 4, borderLeftWidth: 1, - borderColor: colors.grey200 + borderColor: colors.grey200, }, topVerticalLine: { marginTop: 0, @@ -72,33 +72,33 @@ const styles = StyleSheet.create({ width: 0, height: 4, borderLeftWidth: 1, - borderColor: colors.blue + borderColor: colors.blue, }, line: { alignItems: 'center', flexDirection: 'row', justifyContent: 'space-around', width: '100%', - marginBottom: 2 + marginBottom: 2, }, lineHolder: { flexDirection: 'row', alignItems: 'center', - borderWidth: 0 + borderWidth: 0, }, lineFill: { - flex: 1 + flex: 1, }, lineVisible: { borderTopWidth: 1, - borderColor: colors.grey200 + borderColor: colors.grey200, }, circleHitSlop: { top: 0, bottom: 20, left: 0, - right: 0 - } + right: 0, + }, }); function Circle({ size = 22, selected, disabled, error }) { @@ -108,7 +108,7 @@ function Circle({ size = 22, selected, disabled, error }) { styles.circle(size), selected && styles.circleSelected, selected && error && styles.circleError, - disabled && styles.circleDisabled + disabled && styles.circleDisabled, ]} > {selected && ( @@ -116,7 +116,7 @@ function Circle({ size = 22, selected, disabled, error }) { style={[ styles.innerCircle(size), selected && error && styles.innerCircleError, - { width: size * INNER_CIRCLE_SCALE, height: size * INNER_CIRCLE_SCALE } + { width: size * INNER_CIRCLE_SCALE, height: size * INNER_CIRCLE_SCALE }, ]} /> )} @@ -127,7 +127,7 @@ Circle.propTypes = { size: PropTypes.number, selected: PropTypes.bool, disabled: PropTypes.bool, - error: PropTypes.bool + error: PropTypes.bool, }; function Option({ onPress, name, ...props }) { @@ -137,16 +137,16 @@ function Option({ onPress, name, ...props }) { Option.propTypes = { onPress: PropTypes.func, - name: PropTypes.string + name: PropTypes.string, }; function HorizontalSelector({ options = [], selected, circleSize, onPress, disabled, ...props }) { - const hasTopLabels = useMemo(() => options.some(option => option.topLabel), [options]); + const hasTopLabels = useMemo(() => options.some((option) => option.topLabel), [options]); return ( {hasTopLabels && ( - {options.map(option => + {options.map((option) => option.topLabel ? ( {typeof option.topLabel === 'string' ? ( @@ -167,7 +167,7 @@ function HorizontalSelector({ options = [], selected, circleSize, onPress, disab )} - {options.map(option => ( + {options.map((option) => (