Skip to content

Commit

Permalink
merge main and solve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasini committed Oct 18, 2024
2 parents 5790121 + 6d6c420 commit fc2e6a1
Show file tree
Hide file tree
Showing 164 changed files with 11,978 additions and 3,172 deletions.
1 change: 1 addition & 0 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ignores:
- '@metamask/oss-attribution-generator'
- 'webpack-cli'
- '@react-native-community/datetimepicker'
- '@react-native-community/slider'
- 'patch-package'
- '@lavamoat/allow-scripts'
Expand Down
2 changes: 1 addition & 1 deletion .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
configurations: {
'ios.sim.apiSpecs': {
device: 'ios.simulator',
app: 'ios.qa',
app: process.env.CI ? 'ios.qa' :'ios.debug',
testRunner: {
args: {
"$0": "node e2e/api-specs/run-api-spec-tests.js",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
cache: yarn
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 #v1
with:
ruby-version: '3.1.5'
ruby-version: '3.1.6'
bundler-cache: true
env:
BUNDLE_GEMFILE: ios/Gemfile
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.5
3.1.6
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const styleSheet = StyleSheet.create({
justifyContent: 'flex-start',
},
accountNameLabelText: {
marginLeft: 4,
paddingHorizontal: 8,
borderWidth: 1,
borderRadius: 8,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ const AccountBase = ({

<View style={styles.accountNameLabel}>
<Text variant={TextVariant.BodyMDBold}>{accountName}</Text>
{accountTypeLabel && (
</View>
{accountTypeLabel && (
<View style={styles.accountNameLabel}>
<Text
variant={TextVariant.BodySM}
variant={TextVariant.BodyMDBold}
style={styles.accountNameLabelText}
>
{strings(accountTypeLabel)}
</Text>
)}
</View>
)}
</View>
</View>
<View>
Expand Down
12 changes: 6 additions & 6 deletions app/components/Base/Title/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ const Title: React.FC<TitleProps> = ({

return (
<Text
style={[
style.text,
centered && style.centered,
hero && style.hero,
externalStyle,
]}
style={{
...style.text,
...(centered ? style.centered : {}),
...(hero ? style.hero : {}),
...(typeof externalStyle === 'object' ? externalStyle : {}),
}}
{...props}
/>
);
Expand Down
11 changes: 10 additions & 1 deletion app/components/Nav/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ import OptionsSheet from '../../UI/SelectOptionSheet/OptionsSheet';
import FoxLoader from '../../../components/UI/FoxLoader';
import { AppStateEventProcessor } from '../../../core/AppStateEventListener';
import MultiRpcModal from '../../../components/Views/MultiRpcModal/MultiRpcModal';
import { trace, TraceName, TraceOperation } from '../../../util/trace';

const clearStackNavigatorOptions = {
headerShown: false,
Expand Down Expand Up @@ -354,7 +355,15 @@ const App = (props) => {
setOnboarded(!!existingUser);
try {
if (existingUser) {
await Authentication.appTriggeredAuth();
await trace(
{
name: TraceName.BiometricAuthentication,
op: TraceOperation.BiometricAuthentication,
},
async () => {
await Authentication.appTriggeredAuth();
},
);
// we need to reset the navigator here so that the user cannot go back to the login screen
navigator.reset({ routes: [{ name: Routes.ONBOARDING.HOME_NAV }] });
} else {
Expand Down
4 changes: 2 additions & 2 deletions app/components/UI/CollectibleContracts/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('CollectibleContracts', () => {
AccountsController: MOCK_ACCOUNTS_CONTROLLER_STATE,
NftController: {
allNfts: {
[MOCK_ADDRESS]: {
[MOCK_ADDRESS.toLowerCase()]: {
'0x1': [
{
address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42',
Expand Down Expand Up @@ -131,7 +131,7 @@ describe('CollectibleContracts', () => {
},
},
allNftContracts: {
[MOCK_ADDRESS]: {
[MOCK_ADDRESS.toLowerCase()]: {
'0x1': [
{
address: '0x72b1FDb6443338A158DeC2FbF411B71aeB157A42',
Expand Down
22 changes: 4 additions & 18 deletions app/components/UI/LedgerModals/LedgerConfirmationModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,24 +407,10 @@ describe('LedgerConfirmationModal', () => {
});

it('calls onRejection when user refuses confirmation', async () => {
const onRejection = jest.fn();
(useLedgerBluetooth as jest.Mock).mockReturnValue({
isSendingLedgerCommands: true,
isAppLaunchConfirmationNeeded: false,
ledgerLogicToRun: jest.fn(),
error: LedgerCommunicationErrors.UserRefusedConfirmation,
});

renderWithProvider(
<LedgerConfirmationModal
onConfirmation={jest.fn()}
onRejection={onRejection}
deviceId={'test'}
/>,
checkLedgerCommunicationErrorFlow(
LedgerCommunicationErrors.UserRefusedConfirmation,
strings('ledger.user_reject_transaction'),
strings('ledger.user_reject_transaction_message'),
);
// eslint-disable-next-line no-empty-function
await act(async () => {});

expect(onRejection).toHaveBeenCalled();
});
});
9 changes: 7 additions & 2 deletions app/components/UI/LedgerModals/LedgerConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ const LedgerConfirmationModal = ({
});
break;
case LedgerCommunicationErrors.UserRefusedConfirmation:
onReject();
setErrorDetails({
title: strings('ledger.user_reject_transaction'),
subtitle: strings('ledger.user_reject_transaction_message'),
});
break;
case LedgerCommunicationErrors.LedgerHasPendingConfirmation:
setErrorDetails({
Expand Down Expand Up @@ -275,7 +278,9 @@ const LedgerConfirmationModal = ({
isRetryHide={
ledgerError === LedgerCommunicationErrors.UnknownError ||
ledgerError === LedgerCommunicationErrors.NonceTooLow ||
ledgerError === LedgerCommunicationErrors.NotSupported
ledgerError === LedgerCommunicationErrors.NotSupported ||
ledgerError === LedgerCommunicationErrors.BlindSignError ||
ledgerError === LedgerCommunicationErrors.UserRefusedConfirmation
}
/>
</View>
Expand Down
63 changes: 45 additions & 18 deletions app/components/UI/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1824,34 +1824,61 @@ export const getSettingsNavigationOptions = (title, themeColors) => {
};
};

export function getStakingNavbar(title, navigation, themeColors) {
/**
*
* @param {String} title - Navbar Title.
* @param {NavigationProp<ParamListBase>} navigation Navigation object returned from useNavigation hook.
* @param {ThemeColors} themeColors theme.colors returned from useStyles hook.
* @param {{ backgroundColor?: string, hasCancelButton?: boolean, hasBackButton?: boolean }} [options] - Optional options for navbar.
* @returns Staking Navbar Component.
*/
export function getStakingNavbar(title, navigation, themeColors, options) {
const { hasBackButton = true, hasCancelButton = true } = options ?? {};

const innerStyles = StyleSheet.create({
headerStyle: {
backgroundColor:
options?.backgroundColor ?? themeColors.background.default,
shadowOffset: null,
},
headerLeft: {
marginHorizontal: 16,
},
headerButtonText: {
color: themeColors.primary.default,
fontSize: 14,
...fontStyles.normal,
},
headerStyle: {
backgroundColor: themeColors.background.default,
shadowColor: importedColors.transparent,
elevation: 0,
},
});

function navigationPop() {
navigation.goBack();
}

return {
headerTitle: () => (
<NavbarTitle title={title} disableNetwork translate={false} />
),
headerLeft: () => <View />,
headerRight: () => (
<TouchableOpacity
onPress={() => navigation.dangerouslyGetParent()?.pop()}
style={styles.closeButton}
>
<Text style={innerStyles.headerButtonText}>
{strings('navigation.cancel')}
</Text>
</TouchableOpacity>
<MorphText variant={TextVariant.HeadingMD}>{title}</MorphText>
),
headerStyle: innerStyles.headerStyle,
headerLeft: () =>
hasBackButton ? (
<ButtonIcon
size={ButtonIconSizes.Lg}
iconName={IconName.ArrowLeft}
onPress={navigationPop}
style={innerStyles.headerLeft}
/>
) : null,
headerRight: () =>
hasCancelButton ? (
<TouchableOpacity
onPress={() => navigation.dangerouslyGetParent()?.pop()}
style={styles.closeButton}
>
<Text style={innerStyles.headerButtonText}>
{strings('navigation.cancel')}
</Text>
</TouchableOpacity>
) : null,
};
}
Loading

0 comments on commit fc2e6a1

Please sign in to comment.