Skip to content

Commit

Permalink
use theme illustrations for workspace profile
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Feb 28, 2024
1 parent 59f8f3d commit 32e9f84
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pages/workspace/WorkspaceProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import type {ImageStyle, StyleProp} from 'react-native';
import {Image, ScrollView, StyleSheet, View} from 'react-native';
import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import WorkspaceProfileLight from '@assets/images/workspace-profile-light.png';
import WorkspaceProfile from '@assets/images/workspace-profile.png';
import Avatar from '@components/Avatar';
import AvatarWithImagePicker from '@components/AvatarWithImagePicker';
import Button from '@components/Button';
Expand All @@ -15,7 +13,6 @@ import OfflineWithFeedback from '@components/OfflineWithFeedback';
import Section from '@components/Section';
import Text from '@components/Text';
import useLocalize from '@hooks/useLocalize';
import useThemePreference from '@hooks/useThemePreference';
import useThemeStyles from '@hooks/useThemeStyles';
import useWindowDimensions from '@hooks/useWindowDimensions';
import Navigation from '@libs/Navigation/Navigation';
Expand All @@ -29,6 +26,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
import type * as OnyxTypes from '@src/types/onyx';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import useThemeIllustrations from '@hooks/useThemeIllustrations';
import withPolicy from './withPolicy';
import type {WithPolicyProps} from './withPolicy';
import WorkspacePageWithSections from './WorkspacePageWithSections';
Expand All @@ -44,8 +42,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isSmallScreenWidth} = useWindowDimensions();
const themePreference = useThemePreference();
const isDarkTheme = themePreference === CONST.THEME.DARK;
const illustrations = useThemeIllustrations();

const outputCurrency = policy?.outputCurrency ?? '';
const currencySymbol = currencyList?.[outputCurrency]?.symbol ?? '';
Expand Down Expand Up @@ -96,7 +93,7 @@ function WorkspaceProfilePage({policy, currencyList = {}, route}: WorkSpaceProfi
>
<Image
style={StyleSheet.flatten([styles.wAuto, styles.h68, imageStyle])}
source={isDarkTheme ? WorkspaceProfile : WorkspaceProfileLight}
source={illustrations.WorkspaceProfile}
resizeMode="cover"
/>
<AvatarWithImagePicker
Expand Down
2 changes: 2 additions & 0 deletions src/styles/theme/illustrations/themes/dark.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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 WorkspaceProfile from '@assets/images/workspace-profile.png';
import type IllustrationsType from '@styles/theme/illustrations/types';

const illustrations = {
EmptyStateBackgroundImage,
ExampleCheckEN,
ExampleCheckES,
WorkspaceProfile,
} satisfies IllustrationsType;

export default illustrations;
2 changes: 2 additions & 0 deletions src/styles/theme/illustrations/themes/light.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
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 WorkspaceProfile from '@assets/images/workspace-profile-light.png';
import type IllustrationsType from '@styles/theme/illustrations/types';

const illustrations = {
EmptyStateBackgroundImage,
ExampleCheckEN,
ExampleCheckES,
WorkspaceProfile,
} satisfies IllustrationsType;

export default illustrations;
1 change: 1 addition & 0 deletions src/styles/theme/illustrations/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ type IllustrationsType = {
EmptyStateBackgroundImage: ImageSourcePropType;
ExampleCheckES: ImageSourcePropType;
ExampleCheckEN: ImageSourcePropType;
WorkspaceProfile: ImageSourcePropType;
};

export default IllustrationsType;

0 comments on commit 32e9f84

Please sign in to comment.