-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat-multichain-list
- Loading branch information
Showing
47 changed files
with
1,360 additions
and
727 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; | ||
} |
Oops, something went wrong.