Skip to content

Commit a206987

Browse files
authored
chore: revert 15669 from 7.49.0 (#16305)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Revert [15669](#15669) from 7.49.0 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Related issues** Fixes: #16214 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 1c7ae2d commit a206987

26 files changed

Lines changed: 2191 additions & 3452 deletions

File tree

app/component-library/components/Form/TextField/TextField.styles.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,20 @@ const styleSheet = (params: {
3030
}
3131

3232
return StyleSheet.create({
33-
base: Object.assign({
34-
flexDirection: 'row',
35-
alignItems: 'center',
36-
borderRadius: 8,
37-
height: Number(size),
38-
borderWidth: 1,
39-
borderColor,
40-
opacity: isDisabled ? 0.5 : 1,
41-
paddingHorizontal: 16,
42-
backgroundColor: theme.colors.background.default,
43-
...StyleSheet.flatten(style),
44-
} as ViewStyle) as ViewStyle,
33+
base: Object.assign(
34+
{
35+
flexDirection: 'row',
36+
alignItems: 'center',
37+
borderRadius: 8,
38+
height: Number(size),
39+
borderWidth: 1,
40+
borderColor,
41+
opacity: isDisabled ? 0.5 : 1,
42+
paddingHorizontal: 16,
43+
backgroundColor: theme.colors.background.default,
44+
} as ViewStyle,
45+
style,
46+
) as ViewStyle,
4547
startAccessory: {
4648
marginRight: 8,
4749
},

app/components/Nav/App/App.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,7 @@ const OnboardingNav = () => (
229229
name={Routes.ONBOARDING.IMPORT_FROM_SECRET_RECOVERY_PHRASE}
230230
component={ImportFromSecretRecoveryPhrase}
231231
/>
232-
<Stack.Screen
233-
name="OptinMetrics"
234-
component={OptinMetrics}
235-
options={{ headerShown: false }}
236-
/>
232+
<Stack.Screen name="OptinMetrics" component={OptinMetrics} />
237233
</Stack.Navigator>
238234
);
239235

app/components/UI/LoginOptionsSwitch/LoginOptionsSwitch.tsx

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React, { useCallback, useState } from 'react';
2+
import { Switch, Text, View } from 'react-native';
23
import { strings } from '../../../../locales/i18n';
34
import { AUTHENTICATION_TYPE, BIOMETRY_TYPE } from 'react-native-keychain';
5+
import { createStyles } from './styles';
46
import { LoginViewSelectors } from '../../../../e2e/selectors/wallet/LoginView.selectors';
57
import { useSelector } from 'react-redux';
6-
import SecurityOptionToggle from '../SecurityOptionToggle/SecurityOptionToggle';
8+
import { useTheme } from '../../../util/theme';
79

810
interface Props {
911
shouldRenderBiometricOption:
@@ -28,6 +30,9 @@ const LoginOptionsSwitch = ({
2830
onUpdateBiometryChoice,
2931
onUpdateRememberMe,
3032
}: Props) => {
33+
const theme = useTheme();
34+
const { colors } = theme;
35+
const styles = createStyles(colors);
3136
const allowLoginWithRememberMe = useSelector(
3237
// TODO: Replace "any" with type
3338
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -51,22 +56,44 @@ const LoginOptionsSwitch = ({
5156
// if both are disabled then this component returns null
5257
if (shouldRenderBiometricOption !== null) {
5358
return (
54-
<SecurityOptionToggle
55-
title={strings(
56-
`biometrics.enable_${shouldRenderBiometricOption.toLowerCase()}`,
57-
)}
58-
value={biometryChoiceState}
59-
onOptionUpdated={onBiometryValueChanged}
60-
/>
59+
<View style={styles.container}>
60+
<Text style={styles.label}>
61+
{strings(
62+
`biometrics.enable_${shouldRenderBiometricOption.toLowerCase()}`,
63+
)}
64+
</Text>
65+
<Switch
66+
onValueChange={onBiometryValueChanged}
67+
value={biometryChoiceState}
68+
style={styles.switch}
69+
trackColor={{
70+
true: colors.primary.default,
71+
false: colors.border.muted,
72+
}}
73+
thumbColor={theme.brandColors.white}
74+
ios_backgroundColor={colors.border.muted}
75+
/>
76+
</View>
6177
);
6278
} else if (shouldRenderBiometricOption === null && allowLoginWithRememberMe) {
6379
return (
64-
<SecurityOptionToggle
65-
title={strings('choose_password.remember_me')}
66-
value={rememberMeEnabled}
67-
onOptionUpdated={onRememberMeValueChanged}
68-
testId={LoginViewSelectors.REMEMBER_ME_SWITCH}
69-
/>
80+
<View style={styles.container}>
81+
<Text style={styles.label}>
82+
{strings(`choose_password.remember_me`)}
83+
</Text>
84+
<Switch
85+
onValueChange={onRememberMeValueChanged}
86+
value={rememberMeEnabled}
87+
style={styles.switch}
88+
trackColor={{
89+
true: colors.primary.default,
90+
false: colors.border.muted,
91+
}}
92+
thumbColor={theme.brandColors.white}
93+
ios_backgroundColor={colors.border.muted}
94+
testID={LoginViewSelectors.REMEMBER_ME_SWITCH}
95+
/>
96+
</View>
7097
);
7198
}
7299
return null;

app/components/UI/Navbar/index.js

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -645,14 +645,10 @@ export function getModalNavbarOptions(title) {
645645
*/
646646
export function getOnboardingNavbarOptions(
647647
route,
648-
{ headerLeft, headerRight },
648+
{ headerLeft } = {},
649649
themeColors,
650-
showLogo = true,
651650
) {
652-
const headerLeftHide =
653-
headerLeft || route.params?.headerLeft || (() => <View />);
654-
const headerRightHide =
655-
headerRight || route.params?.headerRight || (() => <View />);
651+
const headerLeftHide = headerLeft || route.params?.headerLeft;
656652
const innerStyles = StyleSheet.create({
657653
headerStyle: {
658654
backgroundColor: themeColors.background.default,
@@ -668,18 +664,17 @@ export function getOnboardingNavbarOptions(
668664

669665
return {
670666
headerStyle: innerStyles.headerStyle,
671-
headerTitle: showLogo
672-
? () => (
673-
<View style={styles.metamaskNameTransparentWrapper}>
674-
<Image
675-
source={metamask_name}
676-
style={innerStyles.metamaskName}
677-
resizeMethod={'auto'}
678-
/>
679-
</View>
680-
)
681-
: null,
682-
headerRight: headerRightHide,
667+
headerTitle: () => (
668+
<View style={styles.metamaskNameTransparentWrapper}>
669+
<Image
670+
source={metamask_name}
671+
style={innerStyles.metamaskName}
672+
resizeMethod={'auto'}
673+
/>
674+
</View>
675+
),
676+
headerBackTitle: strings('navigation.back'),
677+
headerRight: () => <View />,
683678
headerLeft: headerLeftHide,
684679
headerTintColor: themeColors.primary.default,
685680
};
@@ -805,7 +800,7 @@ export function getTransparentBackOnboardingNavbarOptions(themeColors) {
805800
*
806801
* @returns {Object} - Corresponding navbar options containing headerLeft
807802
*/
808-
export function getOptinMetricsNavbarOptions(themeColors, showLogo = true) {
803+
export function getOptinMetricsNavbarOptions(themeColors) {
809804
const innerStyles = StyleSheet.create({
810805
headerStyle: {
811806
backgroundColor: themeColors.background.default,
@@ -819,19 +814,17 @@ export function getOptinMetricsNavbarOptions(themeColors, showLogo = true) {
819814
},
820815
});
821816
return {
822-
headerTitle: () =>
823-
showLogo ? (
824-
<View style={styles.metamaskNameTransparentWrapper}>
825-
<Image
826-
source={metamask_name}
827-
style={innerStyles.metamaskName}
828-
resizeMethod={'auto'}
829-
/>
830-
</View>
831-
) : null,
817+
headerTitle: () => (
818+
<View style={styles.metamaskNameTransparentWrapper}>
819+
<Image
820+
source={metamask_name}
821+
style={innerStyles.metamaskName}
822+
resizeMethod={'auto'}
823+
/>
824+
</View>
825+
),
832826
headerBackTitle: strings('navigation.back'),
833827
headerRight: () => <View />,
834-
headerLeft: () => <View />,
835828
headerStyle: innerStyles.headerStyle,
836829
headerTintColor: themeColors.primary.default,
837830
};

0 commit comments

Comments
 (0)