diff --git a/src/components/alert-box/AlertBox.tsx b/src/components/alert-box/AlertBox.tsx deleted file mode 100644 index 635581f550..0000000000 --- a/src/components/alert-box/AlertBox.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import React from 'react'; -import {StyleSheet, Text, View} from 'react-native'; -import { - Caution, - Caution25, - NeutralSlate, - Slate, - Success, - Success25, - Warning, - Warning25, -} from '../../styles/colors'; -import {ScreenGutter} from '../styled/Containers'; - -type AlertType = - | 'caution' - | 'success' - | 'warning' - | 'default' - | null - | undefined; - -interface AlertBoxProps { - type?: AlertType; - children: React.ReactNode; -} - -type AlertPalette = { - [k in Exclude]: { - background: string; - text: string; - }; -}; - -const palette: AlertPalette = { - caution: { - background: Caution25, - text: Caution, - }, - success: { - background: Success25, - text: Success, - }, - warning: { - background: Warning25, - text: Warning, - }, - default: { - background: NeutralSlate, - text: Slate, - }, -}; - -const styles = StyleSheet.create({ - container: { - padding: parseInt(ScreenGutter, 10), - borderRadius: 4, - }, -}); - -const AlertBox: React.FC = props => { - const {type = 'default', children} = props; - const colors = palette[type || 'default'] || palette.default; - - return ( - - {children} - - ); -}; - -export default AlertBox; diff --git a/src/components/back/HeaderBackButton.tsx b/src/components/back/HeaderBackButton.tsx index 3b6b9bb4ba..dd6383e576 100644 --- a/src/components/back/HeaderBackButton.tsx +++ b/src/components/back/HeaderBackButton.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import {useTranslation} from 'react-i18next'; import {StyleSheet, View} from 'react-native'; import {TouchableOpacity} from 'react-native-gesture-handler'; import Svg, {Path} from 'react-native-svg'; @@ -36,10 +37,13 @@ const HeaderBackButton: React.FC = ({onPress}) => { } }; + const {t} = useTranslation(); const arrowFill = theme.dark ? Slate : SlateDark; return ( ({ const _SearchFilterContainer = () => { return ( { dispatch(AppActions.showChainSelectorModal({context, chainsOptions})); }}> @@ -551,8 +559,9 @@ const SearchComponent = ({ diff --git a/src/components/checkbox/Checkbox.spec.tsx b/src/components/checkbox/Checkbox.spec.tsx index 861232c607..6bf7f17508 100644 --- a/src/components/checkbox/Checkbox.spec.tsx +++ b/src/components/checkbox/Checkbox.spec.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Checkbox from './Checkbox'; import {fireEvent, render} from '@test/render'; -import {Action} from '../../styles/colors'; +import {Action, SlateDark} from '../../styles/colors'; it('renders correctly', async () => { const mockFn = jest.fn(); @@ -9,8 +9,8 @@ it('renders correctly', async () => { , ); const checkbox = await getByTestId('checkbox'); - // On light theme (used by test render), unchecked border is #E5E5F2 - expect(getByTestId('checkboxBorder')).toHaveStyle({borderColor: '#E5E5F2'}); + // On light theme (used by test render), unchecked border is SlateDark (8.6:1 on White) + expect(getByTestId('checkboxBorder')).toHaveStyle({borderColor: SlateDark}); fireEvent(checkbox, 'press'); expect(mockFn).toHaveBeenCalled(); diff --git a/src/components/checkbox/Checkbox.tsx b/src/components/checkbox/Checkbox.tsx index 6db38cfe99..53a018317b 100644 --- a/src/components/checkbox/Checkbox.tsx +++ b/src/components/checkbox/Checkbox.tsx @@ -3,7 +3,7 @@ import {useTranslation} from 'react-i18next'; import {View} from 'react-native'; import {RoundedCheckbox} from 'react-native-rounded-checkbox'; import Check from '../../../assets/img/check.svg'; -import {Action, SlateDark} from '../../styles/colors'; +import {Action, SlateDark, Slate} from '../../styles/colors'; import {useTheme} from '../../contexts'; interface Props { @@ -36,8 +36,8 @@ const Border: React.FC> = ({ : checked ? Action : theme?.dark - ? SlateDark - : '#E5E5F2'; + ? Slate + : SlateDark; return ( { + const theme = useTheme(); const isPassword = type === 'password'; const isSearch = type === 'search'; const [isFocused, setIsFocused] = useState(false); @@ -315,7 +317,7 @@ const BoxInput = React.forwardRef< = ({ diff --git a/src/components/modal/ongoing-process/OngoingProcess.tsx b/src/components/modal/ongoing-process/OngoingProcess.tsx index ce7bc48dd2..0304267b38 100644 --- a/src/components/modal/ongoing-process/OngoingProcess.tsx +++ b/src/components/modal/ongoing-process/OngoingProcess.tsx @@ -7,7 +7,7 @@ import { View, } from 'react-native'; import {useTheme} from '../../../contexts'; -import {LightBlack, SlateDark, White} from '../../../styles/colors'; +import {LightBlack, White} from '../../../styles/colors'; import {useAppSelector} from '../../../utils/hooks'; import {BlurContainer} from '../../blur/Blur'; import {BaseText} from '../../styled/Text'; @@ -61,13 +61,13 @@ const OnGoingProcessModalContent: React.FC = React.memo(() => { {backgroundColor: theme.dark ? LightBlack : White}, ]}> - + {message} ), - [message, theme.dark], + [message, theme.dark, theme.colors.description], ); return ( diff --git a/src/components/settings/Settings.tsx b/src/components/settings/Settings.tsx index 4fa37ce626..0cf4715388 100644 --- a/src/components/settings/Settings.tsx +++ b/src/components/settings/Settings.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import {useTranslation} from 'react-i18next'; import {Rect, Svg, Path} from 'react-native-svg'; import {useTheme} from '../../contexts'; import {LightBlack, NeutralSlate, Slate, SlateDark} from '../../styles/colors'; @@ -24,13 +25,18 @@ const SettingsSvg: React.FC = ({color, background}) => { }; const Settings = ({onPress}: {onPress: () => void}) => { + const {t} = useTranslation(); const theme = useTheme(); const color = theme.dark ? Slate : SlateDark; const background = theme.dark ? LightBlack : NeutralSlate; return ( - + diff --git a/src/components/styled/Containers.tsx b/src/components/styled/Containers.tsx index e06f04ffbd..42ee6b5e9f 100644 --- a/src/components/styled/Containers.tsx +++ b/src/components/styled/Containers.tsx @@ -241,7 +241,7 @@ const styles = StyleSheet.create({ importTextInput: { minHeight: 80, borderWidth: 0.75, - borderColor: Slate, + borderColor: LuckySevens, borderTopRightRadius: 4, borderTopLeftRadius: 4, textAlignVertical: 'top', @@ -277,7 +277,7 @@ const styles = StyleSheet.create({ searchContainer: { flexDirection: 'row', borderWidth: 1, - borderColor: '#9ba3ae', + borderColor: LuckySevens, alignItems: 'center', borderTopRightRadius: 4, borderTopLeftRadius: 4, @@ -314,7 +314,7 @@ const styles = StyleSheet.create({ }, copyToClipboardContainer: { borderWidth: 1, - borderColor: '#9ba3ae', + borderColor: LuckySevens, borderRadius: 4, paddingVertical: 8, paddingHorizontal: 10, @@ -1065,15 +1065,10 @@ export const SearchRoundContainer = React.forwardRef< View, React.ComponentProps >(({style, ...rest}, ref) => { - const theme = useTheme(); return ( ); diff --git a/src/components/toggle-switch/ToggleSwitch.tsx b/src/components/toggle-switch/ToggleSwitch.tsx index 4828b84d86..1f6b5f7791 100644 --- a/src/components/toggle-switch/ToggleSwitch.tsx +++ b/src/components/toggle-switch/ToggleSwitch.tsx @@ -1,6 +1,6 @@ import React from 'react'; import {StyleSheet, Switch, View} from 'react-native'; -import {Action, NeutralSlate, White} from '../../styles/colors'; +import {Action, LuckySevens, White} from '../../styles/colors'; interface Props { onChange: ((value: boolean) => any) | undefined; @@ -21,7 +21,7 @@ const ToggleSwitch = ({onChange, isEnabled, isDisabled}: Props) => { > = ({ - style, - ...rest -}) => ( - -); +const CellLetter: React.FC< + Pick & React.ComponentProps +> = ({darkModeOnly, style, ...rest}) => { + const theme = useTheme(); + return ( + + ); +}; const SymbolContainer: React.FC< SymbolContainerProps & React.ComponentProps @@ -174,6 +183,7 @@ const Cell: React.FC = ({ onCellPress?.(value)} + accessibilityLabel={value} backgroundColor={backgroundColor} context={context}> <> @@ -183,7 +193,9 @@ const Cell: React.FC = ({ context={context}> {value} - {letters ? {letters} : null} + {letters ? ( + {letters} + ) : null} @@ -245,6 +257,7 @@ const VirtualKeyboardContent: React.FC = ({ context, isSmallScreen, }) => { + const {t} = useTranslation(); const theme = useTheme(); const backgroundColor = darkModeOnly || theme.dark @@ -369,7 +382,8 @@ const VirtualKeyboardContent: React.FC = ({ isSmallScreen={_isSmallScreen} context={context} onLongPress={() => onCellPress?.('reset')} - onPress={() => onCellPress?.('backspace')}> + onPress={() => onCellPress?.('backspace')} + accessibilityLabel={t('Delete')}> diff --git a/src/components/virtual-keyboard/VirtualKeyboardButtonAnimation.tsx b/src/components/virtual-keyboard/VirtualKeyboardButtonAnimation.tsx index 022a39d04c..c91054667c 100644 --- a/src/components/virtual-keyboard/VirtualKeyboardButtonAnimation.tsx +++ b/src/components/virtual-keyboard/VirtualKeyboardButtonAnimation.tsx @@ -20,6 +20,7 @@ interface RippleProps { onLongPress?: () => void; isSmallScreen?: boolean; context?: KeyboardSizesContext; + accessibilityLabel?: string; children: React.ReactNode; } @@ -29,6 +30,7 @@ const VirtualKeyboardButtonAnimation: React.FC = ({ onLongPress, isSmallScreen, context, + accessibilityLabel, children, }) => { const didLongPress = useRef(false); @@ -51,6 +53,8 @@ const VirtualKeyboardButtonAnimation: React.FC = ({ return ( - + ), diff --git a/src/navigation/services/buy-crypto/components/PaymentMethodModal.tsx b/src/navigation/services/buy-crypto/components/PaymentMethodModal.tsx index d8390d04fb..20888f901e 100644 --- a/src/navigation/services/buy-crypto/components/PaymentMethodModal.tsx +++ b/src/navigation/services/buy-crypto/components/PaymentMethodModal.tsx @@ -24,6 +24,7 @@ import { LightBlack, SlateDark, White, + Slate30, } from '../../../../styles/colors'; import {useAppDispatch, useAppSelector} from '../../../../utils/hooks'; import {useTranslation} from 'react-i18next'; @@ -144,7 +145,7 @@ const PaymentMethodCard: React.FC< style={[ styles.paymentMethodCard, { - borderColor: selected ? Action : theme.dark ? SlateDark : '#e6e8ec', + borderColor: selected ? Action : theme.dark ? SlateDark : Slate30, backgroundColor: selected ? '#2240C440' : 'transparent', }, style, diff --git a/src/navigation/services/components/MoonpaySelectCardModal.tsx b/src/navigation/services/components/MoonpaySelectCardModal.tsx index 3cbf54a5d0..fdef2da6a4 100644 --- a/src/navigation/services/components/MoonpaySelectCardModal.tsx +++ b/src/navigation/services/components/MoonpaySelectCardModal.tsx @@ -114,7 +114,7 @@ function MoonpaySelectCardModal({ style={[ styles.cardRow, { - borderColor: selected ? Action : dark ? SlateDark : '#e6e8ec', + borderColor: selected ? Action : dark ? SlateDark : Slate30, opacity: disabled ? 0.5 : 1, }, ]} @@ -159,7 +159,7 @@ function MoonpaySelectCardModal({ {t('Add a new card')} diff --git a/src/navigation/services/components/OfferSelectorModal.tsx b/src/navigation/services/components/OfferSelectorModal.tsx index 326c435fae..9541bae41e 100644 --- a/src/navigation/services/components/OfferSelectorModal.tsx +++ b/src/navigation/services/components/OfferSelectorModal.tsx @@ -25,6 +25,8 @@ import { Slate30, Success25, LightBlue, + Caution, + CautionBright, } from '../../../styles/colors'; import {formatFiatAmount} from '../../../utils/helper-methods'; import {BuyCryptoExchangeKey} from '../buy-crypto/utils/buy-crypto-utils'; @@ -226,7 +228,6 @@ const styles = StyleSheet.create({ marginTop: 20, }, offerDataWarningMsg: { - color: '#df5264', marginRight: 10, fontSize: 12, }, @@ -432,7 +433,7 @@ const BuyCryptoExpandibleCard: React.FC< : SlateDark : selected ? Action - : '#e6e8ec', + : Slate30, backgroundColor: theme.dark ? selected ? '#2240C440' @@ -548,9 +549,20 @@ const OfferDataWarningContainer: React.FC = ({style, ...rest}) => ( const OfferDataWarningMsg = React.forwardRef< Text, React.ComponentProps ->(({style, ...rest}, ref) => ( - -)); +>(({style, ...rest}, ref) => { + const theme = useTheme(); + return ( + + ); +}); OfferDataWarningMsg.displayName = 'OfferDataWarningMsg'; const OfferDataInfoText = React.forwardRef< diff --git a/src/navigation/services/components/externalServicesOfferSelector.tsx b/src/navigation/services/components/externalServicesOfferSelector.tsx index 62e33cb8c7..bcc9df0c8c 100644 --- a/src/navigation/services/components/externalServicesOfferSelector.tsx +++ b/src/navigation/services/components/externalServicesOfferSelector.tsx @@ -3324,7 +3324,7 @@ const ExternalServicesOfferSelector: React.FC< )} {offerWarnMsg ? null : selectedOfferLoading ? ( - + ) : selectedOffer ? ( diff --git a/src/navigation/services/components/externalServicesWalletSelector.tsx b/src/navigation/services/components/externalServicesWalletSelector.tsx index fb9fa5fc99..1c30afde61 100644 --- a/src/navigation/services/components/externalServicesWalletSelector.tsx +++ b/src/navigation/services/components/externalServicesWalletSelector.tsx @@ -135,6 +135,7 @@ export const WalletSelector: React.FC< const theme = useTheme(); return ( - + ) : ( <> diff --git a/src/navigation/services/swap-crypto/components/SwapCryptoOfferSelectorModal.tsx b/src/navigation/services/swap-crypto/components/SwapCryptoOfferSelectorModal.tsx index 432e374706..fe1860b792 100644 --- a/src/navigation/services/swap-crypto/components/SwapCryptoOfferSelectorModal.tsx +++ b/src/navigation/services/swap-crypto/components/SwapCryptoOfferSelectorModal.tsx @@ -310,7 +310,7 @@ const SwapCryptoExpandibleCard: React.FC< : SlateDark : selected ? Action - : '#e6e8ec', + : Slate30, backgroundColor: theme.dark ? selected ? '#2240C440' diff --git a/src/navigation/tabs/home/components/AssetsSearchPill.tsx b/src/navigation/tabs/home/components/AssetsSearchPill.tsx deleted file mode 100644 index f8619a758c..0000000000 --- a/src/navigation/tabs/home/components/AssetsSearchPill.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import React from 'react'; -import {useTranslation} from 'react-i18next'; -import {StyleSheet, TextInput, View} from 'react-native'; -import {useTheme} from '../../../../contexts'; -import SearchSvg from '../../../../../assets/img/search.svg'; -import {Slate30, SlateDark, White} from '../../../../styles/colors'; - -const styles = StyleSheet.create({ - container: { - flex: 1, - flexDirection: 'row', - alignItems: 'center', - borderRadius: 50, - paddingVertical: 10, - paddingHorizontal: 14, - borderWidth: 1, - }, - iconContainer: { - marginRight: 10, - }, - input: { - flex: 1, - fontSize: 14, - padding: 0, - }, -}); - -const Container: React.FC<{ - height?: number; - children?: React.ReactNode; -}> = ({height, children}) => { - const theme = useTheme(); - return ( - - {children} - - ); -}; - -const IconContainer: React.FC<{children?: React.ReactNode}> = ({children}) => ( - {children} -); - -const Input: React.FC> = ({ - style, - ...rest -}) => { - const theme = useTheme(); - return ( - - ); -}; - -interface Props { - value: string; - onChangeText: (text: string) => void; - placeholder?: string; - height?: number; -} - -const AssetsSearchPill: React.FC = ({ - value, - onChangeText, - placeholder = 'Search', - height, -}) => { - const {t} = useTranslation(); - return ( - - - - - - - ); -}; - -export default AssetsSearchPill; diff --git a/src/navigation/tabs/home/components/Crypto.tsx b/src/navigation/tabs/home/components/Crypto.tsx index 9f257db794..a37f7705d5 100644 --- a/src/navigation/tabs/home/components/Crypto.tsx +++ b/src/navigation/tabs/home/components/Crypto.tsx @@ -854,6 +854,7 @@ const Crypto = ({active = true}: CryptoProps) => { { haptic('soft'); @@ -864,6 +865,7 @@ const Crypto = ({active = true}: CryptoProps) => { { haptic('soft'); diff --git a/src/navigation/tabs/home/components/HeaderProfileButton.tsx b/src/navigation/tabs/home/components/HeaderProfileButton.tsx index 96d01f31ae..3ed7bb3608 100644 --- a/src/navigation/tabs/home/components/HeaderProfileButton.tsx +++ b/src/navigation/tabs/home/components/HeaderProfileButton.tsx @@ -19,6 +19,7 @@ const ProfileButton: React.FC = () => { { user diff --git a/src/navigation/tabs/home/components/HeaderScanButton.tsx b/src/navigation/tabs/home/components/HeaderScanButton.tsx index db65a4923f..2da9b0e0d0 100644 --- a/src/navigation/tabs/home/components/HeaderScanButton.tsx +++ b/src/navigation/tabs/home/components/HeaderScanButton.tsx @@ -35,6 +35,7 @@ const ScanButton: React.FC = () => { { dispatch( diff --git a/src/navigation/tabs/home/components/KycBannerGate.tsx b/src/navigation/tabs/home/components/KycBannerGate.tsx index 6c30f765eb..fb036f666b 100644 --- a/src/navigation/tabs/home/components/KycBannerGate.tsx +++ b/src/navigation/tabs/home/components/KycBannerGate.tsx @@ -213,6 +213,7 @@ const KycBannerGate: React.FC = () => { {config.message} {config.dismissible ? ( setDismissed(displayState)} accessibilityLabel={t('Dismiss KYC notification')}> diff --git a/src/navigation/tabs/shop/bill/components/BillStatus.tsx b/src/navigation/tabs/shop/bill/components/BillStatus.tsx index 9971515a9e..8114123ade 100644 --- a/src/navigation/tabs/shop/bill/components/BillStatus.tsx +++ b/src/navigation/tabs/shop/bill/components/BillStatus.tsx @@ -6,11 +6,18 @@ import {useTheme} from '../../../../../contexts'; import {Paragraph} from '../../../../../components/styled/Text'; import { Action, + Caution, + Caution25, Slate30, SlateDark, LightBlack, LinkBlue, LightBlue, + Success25, + SuccessDark, + Warning25, + WarningDark, + White, } from '../../../../../styles/colors'; import { BillPayAccount, @@ -33,17 +40,17 @@ interface BillStatusStyleProps { const statusFields = { dueNow: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Due in 1 day'), }, dueSoon: { - backgroundColor: '#FEECD4', - color: '#A05708', + backgroundColor: Warning25, + color: WarningDark, text: () => t('Due in 1 day'), }, dueLater: { - backgroundColor: '#ffffff', + backgroundColor: White, color: SlateDark, text: () => t('Due in 15 days'), darkTheme: { @@ -52,33 +59,33 @@ const statusFields = { }, }, failed: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Failed'), }, canceled: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Canceled'), }, reversed: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Failed'), }, reversalRequired: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Failed'), }, reversalProcessing: { - backgroundColor: '#ffd8de', - color: '#b51b16', + backgroundColor: Caution25, + color: Caution, text: () => t('Failed'), }, complete: { - backgroundColor: '#CBF3E8', - color: '#0B754A', + backgroundColor: Success25, + color: SuccessDark, text: () => t('Completed'), darkTheme: { backgroundColor: '#076A46', @@ -86,8 +93,8 @@ const statusFields = { }, }, sent: { - backgroundColor: '#CBF3E8', - color: '#0B754A', + backgroundColor: Success25, + color: SuccessDark, text: () => t('Sent'), darkTheme: { backgroundColor: '#076A46', diff --git a/src/navigation/tabs/shop/components/GiftCardTerms.tsx b/src/navigation/tabs/shop/components/GiftCardTerms.tsx index 30ac04ce81..421c3a19dd 100644 --- a/src/navigation/tabs/shop/components/GiftCardTerms.tsx +++ b/src/navigation/tabs/shop/components/GiftCardTerms.tsx @@ -1,11 +1,10 @@ import {WIDTH} from '../../../../components/styled/Containers'; -import React from 'react'; -import RenderHTML from 'react-native-render-html'; +import React, {useMemo} from 'react'; +import RenderHTML, {MixedStyleDeclaration} from 'react-native-render-html'; import {horizontalPadding} from './styled/ShopTabComponents'; -import {SlateDark} from '../../../../styles/colors'; +import {useTheme} from '../../../../contexts'; -const termsStyle = { - color: SlateDark, +const termsStyle: MixedStyleDeclaration = { fontSize: 12, fontWeight: '300', padding: 10, @@ -15,9 +14,14 @@ const termsStyle = { }; export default ({terms}: {terms: string}) => { + const theme = useTheme(); + const baseStyle = useMemo( + () => ({...termsStyle, color: theme.colors.description}), + [theme.colors.description], + ); return ( { const defaultAltCurrency = useAppSelector(({APP}) => APP.defaultAltCurrency); const [searchVal, setSearchVal] = useState(''); - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; const selectedChainFilterOption = useAppSelector(({APP}) => ignoreGlobalListContextList.includes('walletconnect') diff --git a/src/navigation/wallet-connect/screens/WalletConnectIntro.tsx b/src/navigation/wallet-connect/screens/WalletConnectIntro.tsx index 374f2d1607..ea5c802cc0 100644 --- a/src/navigation/wallet-connect/screens/WalletConnectIntro.tsx +++ b/src/navigation/wallet-connect/screens/WalletConnectIntro.tsx @@ -30,7 +30,7 @@ import { SearchInput, } from '../../../components/styled/Containers'; import ScanSvg from '../../../../assets/img/onboarding/scan.svg'; -import {NeutralSlate} from '../../../styles/colors'; +import {NeutralSlate, Placeholder} from '../../../styles/colors'; import {useOngoingProcess} from '../../../contexts'; export type WalletConnectIntroParamList = { @@ -50,7 +50,7 @@ const WalletConnectIntro = () => { const navigation = useNavigation(); const {showOngoingProcess, hideOngoingProcess} = useOngoingProcess(); const theme = useTheme(); - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; // version 2 // value unused; selector kept so the screen still re-renders when the proposal changes diff --git a/src/navigation/wallet/components/CurrencySelectionSearchInput.tsx b/src/navigation/wallet/components/CurrencySelectionSearchInput.tsx index 3c1e98225c..bf89d6590c 100644 --- a/src/navigation/wallet/components/CurrencySelectionSearchInput.tsx +++ b/src/navigation/wallet/components/CurrencySelectionSearchInput.tsx @@ -5,7 +5,7 @@ import {useTheme} from '../../../contexts'; import SearchIcon from '../../../../assets/img/search.svg'; import BoxInput, {IconContainer} from '../../../components/form/BoxInput'; import {ActiveOpacity} from '../../../components/styled/Containers'; -import {NeutralSlate} from '../../../styles/colors'; +import {NeutralSlate, Placeholder} from '../../../styles/colors'; import WalletIcons from './WalletIcons'; interface CurrencySelectionSearchInputProps { @@ -29,7 +29,7 @@ const CurrencySelectionSearchInput: React.FC< // eslint-disable-next-line react-hooks/refs -- see 'use no memo' above queryRef.current = query; - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; const debouncedOnSearch = useMemo(() => { const fn = (text: string) => { diff --git a/src/navigation/wallet/components/SendToAddress.tsx b/src/navigation/wallet/components/SendToAddress.tsx index 03b56a5e83..5db8c818c8 100644 --- a/src/navigation/wallet/components/SendToAddress.tsx +++ b/src/navigation/wallet/components/SendToAddress.tsx @@ -18,7 +18,7 @@ import { import Button from '../../../components/button/Button'; import {useTheme} from '../../../contexts'; import {BaseText, H5, SubText} from '../../../components/styled/Text'; -import {Caution, NeutralSlate} from '../../../styles/colors'; +import {Caution, NeutralSlate, Placeholder} from '../../../styles/colors'; import {useNavigation, useRoute} from '@react-navigation/native'; import {RouteProp} from '@react-navigation/core'; import {WalletGroupParamList} from '../WalletGroup'; @@ -105,7 +105,7 @@ const SendToAddress = () => { const theme = useTheme(); const logger = useLogger(); const {showOngoingProcess, hideOngoingProcess} = useOngoingProcess(); - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; const [searchInput, setSearchInput] = useState(''); const [walletSearchInput, setWalletSearchInput] = useState(''); const [errorMessage, setErrorMessage] = useState(''); diff --git a/src/navigation/wallet/components/SendToContact.tsx b/src/navigation/wallet/components/SendToContact.tsx index 44d77884ee..3d0d02b2fe 100644 --- a/src/navigation/wallet/components/SendToContact.tsx +++ b/src/navigation/wallet/components/SendToContact.tsx @@ -8,7 +8,7 @@ import { import Button from '../../../components/button/Button'; import {useTheme} from '../../../contexts'; import {H5, SubText} from '../../../components/styled/Text'; -import {NeutralSlate} from '../../../styles/colors'; +import {NeutralSlate, Placeholder} from '../../../styles/colors'; import {useRoute} from '@react-navigation/native'; import {RouteProp} from '@react-navigation/core'; import {WalletGroupParamList} from '../WalletGroup'; @@ -46,7 +46,7 @@ const SendToContact = () => { const {t} = useTranslation(); const theme = useTheme(); const allContacts = useAppSelector(({CONTACT}: RootState) => CONTACT.list); - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; const [searchInput, setSearchInput] = useState(''); const route = useRoute>(); const {wallet, context} = route.params; diff --git a/src/navigation/wallet/screens/AccountDetails.tsx b/src/navigation/wallet/screens/AccountDetails.tsx index 558363b3ec..37c596c34d 100644 --- a/src/navigation/wallet/screens/AccountDetails.tsx +++ b/src/navigation/wallet/screens/AccountDetails.tsx @@ -89,7 +89,7 @@ import { } from '../../../utils/helper-methods'; import LinkingButtons from '../../tabs/home/components/LinkingButtons'; import {Analytics} from '../../../store/analytics/analytics.effects'; -import {Air, LightBlack, SlateDark, White} from '../../../styles/colors'; +import {Air, LightBlack, SlateDark, White, Slate} from '../../../styles/colors'; import { createMultipleWallets, getActiveWalletStoreInitPromise, @@ -370,6 +370,9 @@ const styles = StyleSheet.create({ alignSelf: 'center', flexDirection: 'row', gap: 8, + // Room for the address badge's 19pt hitSlop (taken from the 22pt gap + // above via contentTopMargin), so touches there reach the badge. + paddingTop: 19, }, }); @@ -398,9 +401,14 @@ const WalletListHeader: React.FC = ({ const WalletListHeaderLabel: React.FC<{ isActive: boolean; children?: React.ReactNode; -}> = ({isActive, children}) => ( - {children} -); +}> = ({isActive, children}) => { + const theme = useTheme(); + return ( +
+ {children} +
+ ); +}; const CopyToClipboardContainer: React.FC<{children?: React.ReactNode}> = ({ children, @@ -456,9 +464,15 @@ const AssetsDataContainer: React.FC<{children?: React.ReactNode}> = ({ children, }) => {children}; +// The Wallets / Allocation / Activity row is a tab bar for screen readers +// ("tab 1 of 3"). const HeaderListContainer: React.FC<{children?: React.ReactNode}> = ({ children, -}) => {children}; +}) => ( + + {children} + +); const AddCustomTokenContainer: React.FC = ({ style, @@ -512,6 +526,7 @@ const AccountAddressBadge = ({address}: AccountAddressBadgeProps) => { return ( @@ -1984,6 +1999,7 @@ const AccountDetails: React.FC = ({route}) => { = ({route}) => { { setActiveTab('wallets'); }}> -
{t('Wallets')}
+ {t('Wallets')}
{showPortfolioValue ? ( { setActiveTab('allocation'); }}> -
{t('Allocation')}
+ {t('Allocation')}
) : null} { setActiveTab('activity'); await sleep(200); loadInitialHistory(); }}> -
{t('Activity')}
+ {t('Activity')}
diff --git a/src/navigation/wallet/screens/send/SendTo.tsx b/src/navigation/wallet/screens/send/SendTo.tsx index 3b9954d90d..ea02dcedbc 100644 --- a/src/navigation/wallet/screens/send/SendTo.tsx +++ b/src/navigation/wallet/screens/send/SendTo.tsx @@ -33,6 +33,7 @@ import { NeutralSlate, SlateDark, White, + Placeholder, } from '../../../../styles/colors'; import {RouteProp} from '@react-navigation/core'; import {WalletGroupParamList} from '../../WalletGroup'; @@ -248,7 +249,7 @@ const SendToContent = ({wallet}: {wallet: Wallet}) => { ); const hideAllBalances = useAppSelector(({APP}) => APP.hideAllBalances); const theme = useTheme(); - const placeHolderTextColor = theme.dark ? NeutralSlate : '#6F7782'; + const placeHolderTextColor = theme.dark ? NeutralSlate : Placeholder; const [searchInput, setSearchInput] = useState(''); const [walletSearchInput, setWalletSearchInput] = useState(''); const [showWalletOptions, setShowWalletOptions] = useState(false); diff --git a/src/styles/colors.ts b/src/styles/colors.ts index 03774f45f1..9fa0caa9cf 100644 --- a/src/styles/colors.ts +++ b/src/styles/colors.ts @@ -6,6 +6,10 @@ export const Action = '#2240C4'; /* Secondary */ export const SlateDark = '#434D5A'; export const LuckySevens = '#777777'; +/** + * Placeholder text on light backgrounds (4.53:1 on White). + */ +export const Placeholder = '#6F7782'; export const Slate = '#9BA3AE'; export const NeutralSlate = '#F5F7F8'; export const Air = '#EBEDF8'; @@ -31,14 +35,30 @@ export const Caution = '#B51B16'; export const Caution50 = '#FDAFBB'; export const Caution25 = '#FFD8DE'; export const Caution60 = '#ad1313'; +/** + * Readable danger text on Caution50 fills (4.73:1). + */ +export const Caution70 = '#9E1111'; +/** + * Readable danger text in dark mode (7.4:1 on Black, 5.4:1 on LightBlack). + */ +export const CautionBright = '#FF647C'; export const Success = '#2fcfa4'; export const Success50 = '#97E7D1'; export const Success25 = '#CBF3E8'; +/** + * Readable success text on light and Success25 fills (4.79:1 on Success25). + */ +export const SuccessDark = '#0B754A'; export const Warning = '#AC6304'; export const Warning75 = '#FDC67F'; export const Warning25 = '#FEECD4'; +/** + * Readable warning text on Warning25 fills (4.70:1). Same value Bill status already used. + */ +export const WarningDark = '#A05708'; export const Disabled = '#edeef0'; export const DisabledDark = '#3c3c3c'; diff --git a/src/themes/bitpay.ts b/src/themes/bitpay.ts index 47d7bbf301..269a75f929 100644 --- a/src/themes/bitpay.ts +++ b/src/themes/bitpay.ts @@ -1,10 +1,10 @@ import {DarkTheme, DefaultTheme, Theme} from '@react-navigation/native'; import { Action, - Air, BitPay, Black, LinkBlue, + Slate30, SlateDark, White, } from '../styles/colors'; @@ -44,7 +44,7 @@ export const BitPayDarkTheme: BitPayTheme = { card: DarkTheme.colors.card, text: White, link: LinkBlue, - description: Air, + description: Slate30, border: DarkTheme.colors.border, notification: DarkTheme.colors.notification, },