Skip to content

Commit

Permalink
add themed Example Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
grgia committed Dec 6, 2023
1 parent 04bd265 commit 5af8847
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .imgbotconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"ignoredFiles": [
"assets/images/empty-state_background-fade-dark.png", // Caused an issue with colour gradients, https://github.com/Expensify/App/issues/30499
"assets/images/empty-state_background-fade-light.png"
"assets/images/themeDependent/empty-state_background-fade-dark.png", // Caused an issue with colour gradients, https://github.com/Expensify/App/issues/30499
"assets/images/themeDependent/empty-state_background-fade-light.png"
],
"aggressiveCompression": "false"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions src/pages/ReimbursementAccount/BankAccountManualStep.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import lodashGet from 'lodash/get';
import React, {useCallback} from 'react';
import {Image} from 'react-native';
import _ from 'underscore';
import CheckboxWithLabel from '@components/CheckboxWithLabel';
import FormProvider from '@components/Form/FormProvider';
Expand All @@ -18,16 +17,16 @@ import useThemeStyles from '@styles/useThemeStyles';
import * as BankAccounts from '@userActions/BankAccounts';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import exampleCheckImage from './exampleCheckImage';
import StepPropTypes from './StepPropTypes';
import ExampleCheck from './ExampleCheck';

const propTypes = {
..._.omit(StepPropTypes, _.keys(withLocalizePropTypes)),
};

function BankAccountManualStep(props) {
const styles = useThemeStyles();
const {translate, preferredLocale} = useLocalize();
const {translate} = useLocalize();
const {reimbursementAccount, reimbursementAccountDraft} = props;

const shouldDisableInputs = Boolean(lodashGet(reimbursementAccount, 'achData.bankAccountID'));
Expand Down Expand Up @@ -95,11 +94,7 @@ function BankAccountManualStep(props) {
style={[styles.mh5, styles.mt3, styles.flexGrow1]}
>
<Text style={[styles.mb5]}>{translate('bankAccount.checkHelpLine')}</Text>
<Image
resizeMode="contain"
style={[styles.exampleCheckImage, styles.mb5]}
source={exampleCheckImage(preferredLocale)}
/>
<ExampleCheck />
<InputWrapper
InputComponent={TextInput}
autoFocus
Expand Down
25 changes: 25 additions & 0 deletions src/pages/ReimbursementAccount/ExampleCheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import {Image} from 'react-native';
import useThemeIllustrations from '@styles/illustrations/useThemeIllustrations';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import useLocalize from '@hooks/useLocalize';

function ExampleCheckImage() {
const styles = useThemeStyles();
const illustrations = useThemeIllustrations();
const {preferredLocale} = useLocalize();
const isSpanish = (preferredLocale || CONST.LOCALES.DEFAULT) === CONST.LOCALES.ES;

return (
<Image
resizeMode="contain"
style={[styles.exampleCheckImage, styles.mb5]}
source={isSpanish ? illustrations.ExampleCheckES : illustrations.ExampleCheckEN}
/>
);
}

ExampleCheckImage.displayName = 'ExampleCheckImage';
export default ExampleCheckImage;

14 changes: 0 additions & 14 deletions src/pages/ReimbursementAccount/exampleCheckImage.js

This file was deleted.

6 changes: 5 additions & 1 deletion src/styles/illustrations/dark.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import EmptyStateBackgroundImage from '@assets/images/empty-state_background-fade-dark.png';
import EmptyStateBackgroundImage from '@assets/images/themeDependent/empty-state_background-fade-dark.png';
import ExampleCheckEN from '@assets/images/themeDependent/example-check-image-dark-en.png';
import ExampleCheckES from '@assets/images/themeDependent/example-check-image-dark-es.png';
import {Illustrations} from './types';

const illustrations = {
EmptyStateBackgroundImage,
ExampleCheckEN,
ExampleCheckES,
} satisfies Illustrations;

export default illustrations;
7 changes: 6 additions & 1 deletion src/styles/illustrations/light.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import EmptyStateBackgroundImage from '@assets/images/empty-state_background-fade-light.png';
import EmptyStateBackgroundImage from '@assets/images/themeDependent/empty-state_background-fade-light.png';
import ExampleCheckEN from '@assets/images/themeDependent/example-check-image-light-en.png';
import ExampleCheckES from '@assets/images/themeDependent/example-check-image-light-es.png';

import {Illustrations} from './types';

const illustrations = {
EmptyStateBackgroundImage,
ExampleCheckEN,
ExampleCheckES,
} satisfies Illustrations;

export default illustrations;
2 changes: 2 additions & 0 deletions src/styles/illustrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import {ImageSourcePropType} from 'react-native';

type Illustrations = {
EmptyStateBackgroundImage: ImageSourcePropType;
ExampleCheckES: ImageSourcePropType;
ExampleCheckEN: ImageSourcePropType;
};

// eslint-disable-next-line import/prefer-default-export
Expand Down

0 comments on commit 5af8847

Please sign in to comment.