diff --git a/.eslintrc b/.eslintrc index 0816c67c1..8938b949f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -18,6 +18,8 @@ "react/jsx-handler-names": "off", // activated by standard-react config "react/display-name": "off", "react-native/no-inline-styles": "error", + "react-native/no-unused-styles": "error", + "react-native/no-single-element-style-arrays": "error", "prettier/prettier": [ "warn", { diff --git a/App.js b/App.js index e458424ed..3f5d4c518 100644 --- a/App.js +++ b/App.js @@ -386,25 +386,6 @@ const styles = StyleSheet.create({ root: { flex: 1, }, - space: { - marginHorizontal: 8, - }, - modalContent: { - padding: 22, - justifyContent: 'center', - alignItems: 'center', - borderTopLeftRadius: 16, - borderTopRightRadius: 16, - borderColor: 'rgba(0, 0, 0, 0.1)', - minHeight: 200, - height: 200, - }, - modelContentButtonLayout: { - flexDirection: 'row', - margin: 16, - justifyContent: 'space-between', - alignItems: 'flex-end', - }, }); export default App; diff --git a/UnlockWith.js b/UnlockWith.js index 54a558bd0..4780af9d9 100644 --- a/UnlockWith.js +++ b/UnlockWith.js @@ -31,10 +31,6 @@ const styles = StyleSheet.create({ width: 64, height: 64, }, - encrypted: { - width: 0.5, - height: 20, - }, }); const UnlockWith = () => { diff --git a/components/AmountInput.js b/components/AmountInput.js index aa27e7311..500862e75 100644 --- a/components/AmountInput.js +++ b/components/AmountInput.js @@ -338,7 +338,7 @@ const styles = StyleSheet.create({ disabledButton: { opacity: 0.5, }, - enabledButton: { + enabledButon: { opacity: 1, }, outdatedRateContainer: { diff --git a/components/LNNodeBar.js b/components/LNNodeBar.js index 25870d965..9fb7b97a8 100644 --- a/components/LNNodeBar.js +++ b/components/LNNodeBar.js @@ -61,9 +61,6 @@ const styles = StyleSheet.create({ nodeAlias: { marginVertical: 16, }, - pending: { - marginVertical: 8, - }, canSendBar: { height: 14, maxHeight: 14, diff --git a/components/MultipleStepsListItem.js b/components/MultipleStepsListItem.js index bcb7b25d6..49b6f8456 100644 --- a/components/MultipleStepsListItem.js +++ b/components/MultipleStepsListItem.js @@ -16,37 +16,9 @@ const MultipleStepsListItem = props => { checked = false, } = props; const stylesHook = StyleSheet.create({ - root: { - flex: 1, - backgroundColor: colors.elevated, - }, - textBtc: { - color: colors.buttonAlternativeTextColor, - }, - textDestinationFirstFour: { - color: colors.buttonAlternativeTextColor, - }, - textBtcUnitValue: { - color: colors.buttonAlternativeTextColor, - }, - textDestination: { - color: colors.foregroundColor, - }, - modalContentShort: { - backgroundColor: colors.elevated, - }, - modalContent: { - backgroundColor: colors.elevated, - }, - textFiat: { - color: colors.alternativeTextColor, - }, provideKeyButton: { backgroundColor: colors.buttonDisabledBackgroundColor, }, - exportButton: { - backgroundColor: colors.buttonDisabledBackgroundColor, - }, provideKeyButtonText: { color: colors.buttonTextColor, }, @@ -56,15 +28,9 @@ const MultipleStepsListItem = props => { vaultKeyText: { color: colors.alternativeTextColor, }, - feeFiatText: { - color: colors.alternativeTextColor, - }, vaultKeyCircleSuccess: { backgroundColor: colors.msSuccessBG, }, - vaultKeyTextSigned: { - color: colors.msSuccessBG, - }, rowPartialLeftText: { color: colors.alternativeTextColor, }, @@ -258,15 +224,6 @@ const styles = StyleSheet.create({ alignContent: 'center', justifyContent: 'center', }, - grayButton: { - marginTop: 24, - marginLeft: 40, - height: 48, - borderRadius: 8, - justifyContent: 'center', - paddingHorizontal: 16, - marginBottom: 8, - }, activityIndicator: { marginLeft: 40, }, @@ -281,15 +238,6 @@ const styles = StyleSheet.create({ rowPartialLeftText: { textAlign: 'center', }, - vaultKeyTextSignedWrapper: { justifyContent: 'center', alignItems: 'center', paddingLeft: 16 }, - vaultKeyTextSigned: { fontSize: 18, fontWeight: 'bold' }, - exportButton: { - height: 48, - borderRadius: 8, - flex: 1, - justifyContent: 'center', - paddingHorizontal: 16, - }, }); export default MultipleStepsListItem; diff --git a/components/WalletsCarousel.js b/components/WalletsCarousel.js index 603cd4da9..13eeb7649 100644 --- a/components/WalletsCarousel.js +++ b/components/WalletsCarousel.js @@ -24,7 +24,6 @@ import { BlueStorageContext } from '../blue_modules/storage-context'; import { isHandset, isTablet, isDesktop } from '../blue_modules/environment'; const nStyles = StyleSheet.create({ - root: {}, container: { borderRadius: 10, minHeight: Platform.OS === 'ios' ? 164 : 181, @@ -118,9 +117,6 @@ const iStyles = StyleSheet.create({ fontSize: 19, writingDirection: I18nManager.isRTL ? 'rtl' : 'ltr', }, - activity: { - marginTop: 40, - }, balance: { backgroundColor: 'transparent', fontWeight: 'bold', @@ -258,17 +254,16 @@ WalletCarouselItem.propTypes = { }; const cStyles = StyleSheet.create({ - loading: { - position: 'absolute', - alignItems: 'center', - }, content: { paddingTop: 16, }, contentLargeScreen: { paddingHorizontal: 16, }, - separatorStyle: { width: 16, height: 20 }, + separatorStyle: { + width: 16, + height: 20, + }, }); const WalletsCarousel = forwardRef((props, ref) => { diff --git a/components/react-native-draggable-flatlist/components/DraggableFlatList.tsx b/components/react-native-draggable-flatlist/components/DraggableFlatList.tsx index ee664d8c3..86d639761 100644 --- a/components/react-native-draggable-flatlist/components/DraggableFlatList.tsx +++ b/components/react-native-draggable-flatlist/components/DraggableFlatList.tsx @@ -31,19 +31,11 @@ type RNGHFlatListProps = Animated.AnimateProps< } >; -const AnimatedFlatList = (Animated.createAnimatedComponent(FlatList) as unknown) as (props: RNGHFlatListProps) => React.ReactElement; +const AnimatedFlatList = Animated.createAnimatedComponent(FlatList) as unknown as (props: RNGHFlatListProps) => React.ReactElement; function DraggableFlatListInner(props: DraggableFlatListProps) { - const { - cellDataRef, - containerRef, - flatListRef, - isTouchActiveRef, - keyToIndexRef, - panGestureHandlerRef, - propsRef, - scrollOffsetRef, - } = useRefs(); + const { cellDataRef, containerRef, flatListRef, isTouchActiveRef, keyToIndexRef, panGestureHandlerRef, propsRef, scrollOffsetRef } = + useRefs(); const { activationDistance, activeCellOffset, diff --git a/screen/lnd/browser.js b/screen/lnd/browser.js index 793fbabb7..9440717df 100644 --- a/screen/lnd/browser.js +++ b/screen/lnd/browser.js @@ -229,9 +229,6 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', minHeight: 44, }, - safeBack: { - marginHorizontal: 8, - }, safeURL: { flex: 1, marginHorizontal: 8, @@ -281,6 +278,7 @@ const styles = StyleSheet.create({ colorRed: { color: 'red', }, + // eslint-disable-next-line react-native/no-unused-styles colorGray: { color: 'gray', }, diff --git a/screen/lnd/ldkInfo.tsx b/screen/lnd/ldkInfo.tsx index 8dbc8023a..3b63445ca 100644 --- a/screen/lnd/ldkInfo.tsx +++ b/screen/lnd/ldkInfo.tsx @@ -47,14 +47,10 @@ const LdkInfo = () => { // Modals const [selectedChannelIndex, setSelectedChannelIndex] = useState(); - // const stylesHook = StyleSheet.create({ root: { backgroundColor: colors.background, }, - valueText: { - color: colors.alternativeTextColor2, - }, listHeaderText: { color: colors.foregroundColor, backgroundColor: colors.background, @@ -62,27 +58,9 @@ const LdkInfo = () => { listHeaderBack: { backgroundColor: colors.background, }, - valueRoot: { - backgroundColor: colors.background, - }, - textHeader: { - color: colors.outputValue, - }, - valueSats: { - color: colors.alternativeTextColor2, - }, - paidMark: { - backgroundColor: colors.success, - }, detailsText: { color: colors.alternativeTextColor, }, - expired: { - backgroundColor: colors.success, - }, - additionalInfo: { - backgroundColor: colors.brandingColor, - }, modalContent: { backgroundColor: colors.elevated, }, @@ -257,10 +235,10 @@ const LdkInfo = () => { return ( - {loc.lnd.node_alias} + {loc.lnd.node_alias} {channelData && ( - + {LightningLdkWallet.pubkeyToAlias(channelData.remote_node_id) + ' (' + channelData.remote_node_id.substr(0, 10) + @@ -279,7 +257,7 @@ const LdkInfo = () => { itemPriceUnit={wallet.getPreferredBalanceUnit()} /> - + {status === LdkNodeInfoChannelStatus.PENDING ? loc.transactions.pending : channelData?.is_usable @@ -428,11 +406,11 @@ const LdkInfo = () => { ) : null} {maturingBalance ? ( - + Balance awaiting confirmations: {formatBalance(Number(maturingBalance), wallet.getPreferredBalanceUnit(), true)} ) : null} - {maturingEta ? ETA: {maturingEta} : null} + {maturingEta ? ETA: {maturingEta} : null}