Skip to content

Commit

Permalink
Merge branch 'feat/12541_metametrics_id_in_state' of github.com:MetaM…
Browse files Browse the repository at this point in the history
…ask/metamask-mobile into feat/12541_metametrics_id_in_state
  • Loading branch information
NicolasMassart committed Dec 11, 2024
2 parents 3b90efc + 01f6e20 commit efeb05e
Show file tree
Hide file tree
Showing 48 changed files with 1,369 additions and 728 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ app/util/walletconnect.js @MetaMask/sdk-devs

# Accounts Team
app/core/Encryptor/ @MetaMask/accounts-engineers
app/core/Engine/controllers/accounts @MetaMask/accounts-engineers
app/core/Engine/controllers/AccountsController @MetaMask/accounts-engineers

# Swaps Team
app/components/UI/Swaps @MetaMask/swaps-engineers
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,15 @@ yarn watch

#### Download and install the development build

Go to the app's [GitHub Releases page](https://github.com/MetaMask/metamask-mobile/releases), download the latest release development build (android-expo-dev-build.apk or ios-expo-dev-build.ipa) and install it on an Android/iOS simulator or Android/iOS physical device.
#### For internal developers
- Access Runway via Okta and go to the Expo bucket either on the iOS or Android section. From there you will see the available development builds (android-expo-dev-build.apk or ios-expo-dev-build.ipa).
- For Android:
- Install the .apk on your Android device or simulator.
- For iOS:
- Device: you need to have your iPhone registered with our Apple dev account. If you have it, you can install the .ipa on your device.
- Simulator: please follow the [native development section](https://github.com/MetaMask/metamask-mobile?tab=readme-ov-file#native-development) and run `yarn setup` and `yarn start:ios` as the .ipa will not work for now, we are working on having an .app that works on simulators.

##### [SOON] For external developers (we are testing the new dev builds and will make them publicly available soon after)

#### Load the app

Expand Down
30 changes: 20 additions & 10 deletions app/actions/navigation/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
/* eslint-disable import/prefer-default-export */
import {
SET_CURRENT_ROUTE,
SET_CURRENT_BOTTOM_NAV_ROUTE,
} from '../../reducers/navigation';
type OnNavigationReadyAction,
type SetCurrentRouteAction,
type SetCurrentBottomNavRouteAction,
NavigationActionType,
} from './types';

/**
* Action Creators
*/
export const setCurrentRoute = (route: string) => ({
type: SET_CURRENT_ROUTE,
export * from './types';

export const setCurrentRoute = (route: string): SetCurrentRouteAction => ({
type: NavigationActionType.SET_CURRENT_ROUTE,
payload: { route },
});

export const setCurrentBottomNavRoute = (route: string) => ({
type: SET_CURRENT_BOTTOM_NAV_ROUTE,
export const setCurrentBottomNavRoute = (
route: string,
): SetCurrentBottomNavRouteAction => ({
type: NavigationActionType.SET_CURRENT_BOTTOM_NAV_ROUTE,
payload: { route },
});

/**
* Action that is called when navigation is ready
*/
export const onNavigationReady = (): OnNavigationReadyAction => ({
type: NavigationActionType.ON_NAVIGATION_READY,
});
31 changes: 31 additions & 0 deletions app/actions/navigation/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { type Action } from 'redux';

/**
* Navigation action type enum
*/
export enum NavigationActionType {
ON_NAVIGATION_READY = 'ON_NAVIGATION_READY',
SET_CURRENT_ROUTE = 'SET_CURRENT_ROUTE',
SET_CURRENT_BOTTOM_NAV_ROUTE = 'SET_CURRENT_BOTTOM_NAV_ROUTE',
}

export type OnNavigationReadyAction =
Action<NavigationActionType.ON_NAVIGATION_READY>;

export type SetCurrentRouteAction =
Action<NavigationActionType.SET_CURRENT_ROUTE> & {
payload: { route: string };
};

export type SetCurrentBottomNavRouteAction =
Action<NavigationActionType.SET_CURRENT_BOTTOM_NAV_ROUTE> & {
payload: { route: string };
};

/**
* Navigation action
*/
export type NavigationAction =
| OnNavigationReadyAction
| SetCurrentRouteAction
| SetCurrentBottomNavRouteAction;
134 changes: 0 additions & 134 deletions app/actions/user/index.js

This file was deleted.

161 changes: 161 additions & 0 deletions app/actions/user/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import { type AppThemeKey } from '../../util/theme/models';
import {
type InterruptBiometricsAction,
type LockAppAction,
type AuthSuccessAction,
type AuthErrorAction,
type PasswordSetAction,
type PasswordUnsetAction,
type SeedphraseBackedUpAction,
type SeedphraseNotBackedUpAction,
type BackUpSeedphraseVisibleAction,
type BackUpSeedphraseNotVisibleAction,
type ProtectModalVisibleAction,
type ProtectModalNotVisibleAction,
type LoadingSetAction,
type LoadingUnsetAction,
type SetGasEducationCarouselSeenAction,
type LoginAction,
type LogoutAction,
type SetAppThemeAction,
type CheckedAuthAction,
type PersistedDataLoadedAction,
UserActionType,
} from './types';

export * from './types';

export function interruptBiometrics(): InterruptBiometricsAction {
return {
type: UserActionType.INTERRUPT_BIOMETRICS,
};
}

export function lockApp(): LockAppAction {
return {
type: UserActionType.LOCKED_APP,
};
}

export function authSuccess(bioStateMachineId?: string): AuthSuccessAction {
return {
type: UserActionType.AUTH_SUCCESS,
payload: { bioStateMachineId },
};
}

export function authError(bioStateMachineId?: string): AuthErrorAction {
return {
type: UserActionType.AUTH_ERROR,
payload: { bioStateMachineId },
};
}

export function passwordSet(): PasswordSetAction {
return {
type: UserActionType.PASSWORD_SET,
};
}

export function passwordUnset(): PasswordUnsetAction {
return {
type: UserActionType.PASSWORD_UNSET,
};
}

export function seedphraseBackedUp(): SeedphraseBackedUpAction {
return {
type: UserActionType.SEEDPHRASE_BACKED_UP,
};
}

export function seedphraseNotBackedUp(): SeedphraseNotBackedUpAction {
return {
type: UserActionType.SEEDPHRASE_NOT_BACKED_UP,
};
}

export function backUpSeedphraseAlertVisible(): BackUpSeedphraseVisibleAction {
return {
type: UserActionType.BACK_UP_SEEDPHRASE_VISIBLE,
};
}

export function backUpSeedphraseAlertNotVisible(): BackUpSeedphraseNotVisibleAction {
return {
type: UserActionType.BACK_UP_SEEDPHRASE_NOT_VISIBLE,
};
}

export function protectWalletModalVisible(): ProtectModalVisibleAction {
return {
type: UserActionType.PROTECT_MODAL_VISIBLE,
};
}

export function protectWalletModalNotVisible(): ProtectModalNotVisibleAction {
return {
type: UserActionType.PROTECT_MODAL_NOT_VISIBLE,
};
}

export function loadingSet(loadingMsg: string): LoadingSetAction {
return {
type: UserActionType.LOADING_SET,
loadingMsg,
};
}

export function loadingUnset(): LoadingUnsetAction {
return {
type: UserActionType.LOADING_UNSET,
};
}

export function setGasEducationCarouselSeen(): SetGasEducationCarouselSeenAction {
return {
type: UserActionType.SET_GAS_EDUCATION_CAROUSEL_SEEN,
};
}

export function logIn(): LoginAction {
return {
type: UserActionType.LOGIN,
};
}

export function logOut(): LogoutAction {
return {
type: UserActionType.LOGOUT,
};
}

export function setAppTheme(theme: AppThemeKey): SetAppThemeAction {
return {
type: UserActionType.SET_APP_THEME,
payload: { theme },
};
}

/**
* Temporary action to control auth flow
*
* @param initialScreen - "login" or "onboarding"
*/
export function checkedAuth(initialScreen: string): CheckedAuthAction {
return {
type: UserActionType.CHECKED_AUTH,
payload: {
initialScreen,
},
};
}

/**
* Action to signal that persisted data has been loaded
*/
export function onPersistedDataLoaded(): PersistedDataLoadedAction {
return {
type: UserActionType.ON_PERSISTED_DATA_LOADED,
};
}
Loading

0 comments on commit efeb05e

Please sign in to comment.