Skip to content
72 changes: 0 additions & 72 deletions src/components/alert-box/AlertBox.tsx

This file was deleted.

4 changes: 4 additions & 0 deletions src/components/back/HeaderBackButton.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -36,10 +37,13 @@ const HeaderBackButton: React.FC<HeaderBackButtonProps> = ({onPress}) => {
}
};

const {t} = useTranslation();
const arrowFill = theme.dark ? Slate : SlateDark;
return (
<TouchableOpacity
style={styles.backTouchable}
accessibilityRole="button"
accessibilityLabel={t('Back')}
onPress={handlePress}
activeOpacity={ActiveOpacity}>
<View
Expand Down
3 changes: 3 additions & 0 deletions src/components/blockie/Blockie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ const Blockie = ({

return (
<View
accessible={false}
accessibilityElementsHidden
importantForAccessibility="no-hide-descendants"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

importantForAccessibility is Android-only. Add accessibilityElementsHidden so VoiceOver skips it too. Low impact today since the subtree has no text, but it makes the "hidden from screen readers" claim true on both platforms.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added accessibilityElementsHidden in e09adfb so VoiceOver skips it too.

style={{
width: size,
height: size,
Expand Down
5 changes: 3 additions & 2 deletions src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
SlateDark,
Success,
White,
Caution70,
} from '../../styles/colors';
import Haptic from '../haptic-feedback/haptic';
import {ActiveOpacity} from '../styled/Containers';
Expand Down Expand Up @@ -273,7 +274,7 @@ const getButtonTextColor = ({
? Caution50
: Caution60
: theme.dark
? Caution60
? Caution70

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same change is needed in getPillTextColor (line 464), which is a copy of this function and still returns Caution60 for a non-outline danger pill in dark mode. <Button buttonType="pill" danger> in dark theme still renders Caution60 text on the Caution50 fill.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in e09adfb: the danger pill text now uses Caution70 in dark mode, same as the button.

: White;
}
return White;
Expand Down Expand Up @@ -460,7 +461,7 @@ const getPillTextColor = ({
? Caution50
: Caution60
: theme.dark
? Caution60
? Caution70
: White;
}
return theme?.dark ? White : Action;
Expand Down
13 changes: 11 additions & 2 deletions src/components/chain-search/ChainSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import {
SearchRoundInput,
} from '../../components/styled/Containers';
import {groupBy} from '../../utils/array';
import {Action, LightBlue, Slate, White} from '../../styles/colors';
import {
Action,
LightBlue,
Slate,
White,
Placeholder,
} from '../../styles/colors';
import {BaseText} from '../../components/styled/Text';
import SearchSvg from '../../../assets/img/search.svg';
import ChevronDownSvgLight from '../../../assets/img/chevron-down-lightmode.svg';
Expand Down Expand Up @@ -506,6 +512,8 @@ const SearchComponent = <T extends SearchableItem>({
const _SearchFilterContainer = () => {
return (
<SearchFilterContainer
accessibilityRole="button"
hitSlop={{top: 6, bottom: 6}}
onPress={() => {
dispatch(AppActions.showChainSelectorModal({context, chainsOptions}));
}}>
Expand Down Expand Up @@ -551,8 +559,9 @@ const SearchComponent = <T extends SearchableItem>({
</SearchIconContainer>
<View>
<SearchRoundInput
placeholderTextColor={Slate}
placeholderTextColor={theme.dark ? Slate : Placeholder}
placeholder={t('Search')}
accessibilityLabel={t('Search')}
onChangeText={updateSearchResults}
/>
</View>
Expand Down
6 changes: 3 additions & 3 deletions src/components/checkbox/Checkbox.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
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();
const {getByTestId, rerender} = render(
<Checkbox onPress={mockFn} checked={false} />,
);
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();

Expand Down
6 changes: 3 additions & 3 deletions src/components/checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -36,8 +36,8 @@ const Border: React.FC<BorderProps & React.ComponentProps<typeof View>> = ({
: checked
? Action
: theme?.dark
? SlateDark
: '#E5E5F2';
? Slate

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only the border changed; the uncheckedColor fill passed to RoundedCheckbox (line 91) keeps the old SlateDark / #E5E5F2 values. So dark theme is now a Slate border around a SlateDark fill. If that's intended, all good, but worth a visual check in both themes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. The fill moves to the theme roles in that same follow-up, with a visual check in both themes.

: SlateDark;
return (
<View
style={[
Expand Down
8 changes: 5 additions & 3 deletions src/components/form/BoxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
ProgressBlue,
Slate,
White,
Placeholder,
} from '../../styles/colors';
import {ActiveOpacity} from '../styled/Containers';
import {BaseText} from '../styled/Text';
Expand Down Expand Up @@ -102,12 +103,12 @@ const InputContainer: React.FC<
<View
style={[
styles.inputContainer,
{borderColor: theme.dark ? LuckySevens : Slate},
{borderColor: LuckySevens},
paddingRight ? {paddingRight} : null,
isFocused
? {
backgroundColor: theme.dark ? 'transparent' : '#fafbff',
borderColor: theme.dark ? LuckySevens : Slate,
borderColor: LuckySevens,
borderBottomColor: ProgressBlue,
}
: null,
Expand Down Expand Up @@ -256,6 +257,7 @@ const BoxInput = React.forwardRef<
},
ref,
) => {
const theme = useTheme();
const isPassword = type === 'password';
const isSearch = type === 'search';
const [isFocused, setIsFocused] = useState(false);
Expand Down Expand Up @@ -315,7 +317,7 @@ const BoxInput = React.forwardRef<

<Input
keyboardType={_keyboardType}
placeholderTextColor={Slate}
placeholderTextColor={theme.dark ? Slate : Placeholder}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder colour is now a per-call-site ternary in 9 places, with two different dark values: Slate here and in ChainSearch/ChainSelector, NeutralSlate in the six screens that pass their own (SendTo, SendToAddress, SendToContact, CurrencySelectionSearchInput, both WalletConnect screens). Could this be a placeholder colour on BitPayTheme, the way description is, so the per-screen constants can go? Fine as a follow-up.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. A follow-up PR adds color roles to the theme, including a placeholder role, so the per-screen values can go.

{...props}
editable={!disabled}
ref={ref}
Expand Down
1 change: 1 addition & 0 deletions src/components/home-card/HomeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ const HomeCard: React.FC<HomeCardProps> = ({
<TouchableOpacity
style={styles.cardContainer}
testID={testID}
accessibilityRole="button"
accessibilityLabel={accessibilityLabel}
activeOpacity={ActiveOpacity}
onPressIn={onCTAPressIn}
Expand Down
3 changes: 2 additions & 1 deletion src/components/modal/chain-selector/ChainSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
White,
Slate,
LightBlue,
Placeholder,
} from '../../../styles/colors';
import haptic from '../../haptic-feedback/haptic';

Expand Down Expand Up @@ -450,7 +451,7 @@ const ChainSelectorModalContent = ({
</SearchIconContainer>
<SearchRoundInput
placeholder={t('Search Networks')}
placeholderTextColor={theme.dark ? Slate : Slate}
placeholderTextColor={theme.dark ? Slate : Placeholder}
onChangeText={updateSearchResults}
/>
</SearchRoundContainer>
Expand Down
6 changes: 3 additions & 3 deletions src/components/modal/ongoing-process/OngoingProcess.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -61,13 +61,13 @@ const OnGoingProcessModalContent: React.FC = React.memo(() => {
{backgroundColor: theme.dark ? LightBlack : White},
]}>
<View style={styles.activityIndicatorContainer}>
<ActivityIndicator color={SlateDark} />
<ActivityIndicator color={theme.colors.description} />
</View>
<BaseText style={styles.message}>{message}</BaseText>
<BlurContainer />
</View>
),
[message, theme.dark],
[message, theme.dark, theme.colors.description],
);

return (
Expand Down
8 changes: 7 additions & 1 deletion src/components/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -24,13 +25,18 @@ const SettingsSvg: React.FC<SettingsSvgProps> = ({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 (
<HeaderRightContainer>
<TouchableOpacity activeOpacity={ActiveOpacity} onPress={onPress}>
<TouchableOpacity
activeOpacity={ActiveOpacity}
accessibilityRole="button"
accessibilityLabel={t('More')}
onPress={onPress}>
<SettingsSvg color={color} background={background} />
</TouchableOpacity>
</HeaderRightContainer>
Expand Down
13 changes: 4 additions & 9 deletions src/components/styled/Containers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ const styles = StyleSheet.create({
importTextInput: {
minHeight: 80,
borderWidth: 0.75,
borderColor: Slate,
borderColor: LuckySevens,
borderTopRightRadius: 4,
borderTopLeftRadius: 4,
textAlignVertical: 'top',
Expand Down Expand Up @@ -277,7 +277,7 @@ const styles = StyleSheet.create({
searchContainer: {
flexDirection: 'row',
borderWidth: 1,
borderColor: '#9ba3ae',
borderColor: LuckySevens,
alignItems: 'center',
borderTopRightRadius: 4,
borderTopLeftRadius: 4,
Expand Down Expand Up @@ -314,7 +314,7 @@ const styles = StyleSheet.create({
},
copyToClipboardContainer: {
borderWidth: 1,
borderColor: '#9ba3ae',
borderColor: LuckySevens,
borderRadius: 4,
paddingVertical: 8,
paddingHorizontal: 10,
Expand Down Expand Up @@ -1065,15 +1065,10 @@ export const SearchRoundContainer = React.forwardRef<
View,
React.ComponentProps<typeof View>
>(({style, ...rest}, ref) => {
const theme = useTheme();
return (
<View
ref={ref}
style={[
styles.searchRoundContainer,
{borderColor: theme.dark ? SlateDark : Slate30},
style,
]}
style={[styles.searchRoundContainer, {borderColor: LuckySevens}, style]}
{...rest}
/>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/toggle-switch/ToggleSwitch.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -21,7 +21,7 @@ const ToggleSwitch = ({onChange, isEnabled, isDisabled}: Props) => {
<Switch
onValueChange={onChange}
value={isEnabled}
trackColor={{true: Action, false: NeutralSlate}}
trackColor={{true: Action, false: LuckySevens}}
thumbColor={White}
thumbTintColor={White}
disabled={isDisabled}
Expand Down
Loading