Skip to content

Commit

Permalink
Merge pull request #31827 from rezkiy37/feature/31694-theme-switching…
Browse files Browse the repository at this point in the history
…-migration-settings

[Theme Switching Migration] Settings
  • Loading branch information
grgia authored Nov 29, 2023
2 parents a8672be + 85fc340 commit 0483854
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/components/AddressForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import _ from 'underscore';
import useLocalize from '@hooks/useLocalize';
import Navigation from '@libs/Navigation/Navigation';
import * as ValidationUtils from '@libs/ValidationUtils';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import AddressSearch from './AddressSearch';
import CountrySelector from './CountrySelector';
Expand Down Expand Up @@ -63,6 +63,7 @@ const defaultProps = {
};

function AddressForm({city, country, formID, onAddressChanged, onSubmit, shouldSaveDraft, state, street1, street2, submitButtonText, zip}) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const zipSampleFormat = lodashGet(CONST.COUNTRY_ZIP_REGEX_DATA, [country, 'samples'], '');
const zipFormat = translate('common.zipCodeExampleFormat', {zipSampleFormat});
Expand Down
8 changes: 5 additions & 3 deletions src/components/AvatarWithImagePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import * as Browser from '@libs/Browser';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import getImageResolution from '@libs/fileDownload/getImageResolution';
import stylePropTypes from '@styles/stylePropTypes';
import styles from '@styles/styles';
import themeColors from '@styles/themes/default';
import useTheme from '@styles/themes/useTheme';
import useThemeStyles from '@styles/useThemeStyles';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import AttachmentModal from './AttachmentModal';
Expand Down Expand Up @@ -142,6 +142,8 @@ function AvatarWithImagePicker({
onImageSelected,
editorMaskImage,
}) {
const theme = useTheme();
const styles = useThemeStyles();
const [isMenuVisible, setIsMenuVisible] = useState(false);
const [errorData, setErrorData] = useState({
validationError: null,
Expand Down Expand Up @@ -319,7 +321,7 @@ function AvatarWithImagePicker({
src={Expensicons.Camera}
width={variables.iconSizeSmall}
height={variables.iconSizeSmall}
fill={themeColors.textLight}
fill={theme.textLight}
/>
</View>
</PressableWithoutFeedback>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/ReferralDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Text from '@components/Text';
import TextLink from '@components/TextLink';
import useLocalize from '@hooks/useLocalize';
import Navigation from '@libs/Navigation/Navigation';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand All @@ -40,6 +40,7 @@ const defaultProps = {
};

function ReferralDetailsPage({route, account}) {
const styles = useThemeStyles();
const {translate} = useLocalize();
let {contentType} = route.params;

Expand Down
7 changes: 4 additions & 3 deletions src/pages/settings/Wallet/Card/BaseGetPhysicalCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import FormUtils from '@libs/FormUtils';
import * as GetPhysicalCardUtils from '@libs/GetPhysicalCardUtils';
import Navigation from '@libs/Navigation/Navigation';
import assignedCardPropTypes from '@pages/settings/Wallet/assignedCardPropTypes';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -113,7 +113,7 @@ const defaultProps = {
session: {},
loginList: {},
isConfirmation: false,
renderContent: (onSubmit, submitButtonText, children = () => {}, onValidate = () => ({})) => (
renderContent: (onSubmit, submitButtonText, styles, children = () => {}, onValidate = () => ({})) => (
<Form
formID={ONYXKEYS.FORMS.GET_PHYSICAL_CARD_FORM}
submitButtonText={submitButtonText}
Expand Down Expand Up @@ -144,6 +144,7 @@ function BaseGetPhysicalCard({
title,
onValidate,
}) {
const styles = useThemeStyles();
const isRouteSet = useRef(false);

useEffect(() => {
Expand Down Expand Up @@ -208,7 +209,7 @@ function BaseGetPhysicalCard({
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_WALLET_DOMAINCARD.getRoute(domain))}
/>
<Text style={[styles.textHeadline, styles.mh5, styles.mb5]}>{headline}</Text>
{renderContent(onSubmit, submitButtonText, children, onValidate)}
{renderContent(onSubmit, submitButtonText, styles, children, onValidate)}
</ScreenWrapper>
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Wallet/Card/GetPhysicalCardConfirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import useLocalize from '@hooks/useLocalize';
import FormUtils from '@libs/FormUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -71,6 +71,7 @@ function GetPhysicalCardConfirm({
params: {domain},
},
}) {
const styles = useThemeStyles();
const {translate} = useLocalize();

return (
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Wallet/Card/GetPhysicalCardName.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TextInput from '@components/TextInput';
import useLocalize from '@hooks/useLocalize';
import FormUtils from '@libs/FormUtils';
import * as ValidationUtils from '@libs/ValidationUtils';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -43,6 +43,7 @@ function GetPhysicalCardName({
params: {domain},
},
}) {
const styles = useThemeStyles();
const {translate} = useLocalize();
const onValidate = (values) => {
const errors = {};
Expand Down
3 changes: 2 additions & 1 deletion src/pages/settings/Wallet/Card/GetPhysicalCardPhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import _ from 'underscore';
import TextInput from '@components/TextInput';
import useLocalize from '@hooks/useLocalize';
import FormUtils from '@libs/FormUtils';
import styles from '@styles/styles';
import useThemeStyles from '@styles/useThemeStyles';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -42,6 +42,7 @@ function GetPhysicalCardPhone({
params: {domain},
},
}) {
const styles = useThemeStyles();
const {translate} = useLocalize();

const onValidate = (values) => {
Expand Down

0 comments on commit 0483854

Please sign in to comment.