Skip to content

Commit

Permalink
[native] move <Auth* components to a /auth-components directory
Browse files Browse the repository at this point in the history
Summary:
This is a follow-up to what I suggested in D14114 - to avoid confusion renaming to something more generic as now those components are also used outside of registration flow.

This diff only moves files and updates all imports

Depends on D14170

Test Plan: Flow

Reviewers: bartek, tomek

Reviewed By: bartek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D14171
  • Loading branch information
xsanm committed Jan 9, 2025
1 parent 39d7f06 commit ef2bd4d
Show file tree
Hide file tree
Showing 24 changed files with 61 additions and 61 deletions.
6 changes: 3 additions & 3 deletions native/account/qr-auth/connect-secondary-device.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { Text } from 'react-native';

import { PrimaryDeviceQRAuthContext } from './primary-device-qr-auth-context.js';
import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import { type NavigationRoute } from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type ConnectSecondaryDeviceParams = {
+data: string,
Expand Down
6 changes: 3 additions & 3 deletions native/account/qr-auth/qr-auth-not-primary-device.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import * as React from 'react';
import { Text } from 'react-native';

import { type QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
type NavigationRoute,
type ScreenParamList,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Props = {
+navigation: QRAuthNavigationProp<'QRAuthNotPrimaryDevice'>,
Expand Down
6 changes: 3 additions & 3 deletions native/account/qr-auth/secondary-device-connected.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import * as React from 'react';
import { Text } from 'react-native';

import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
type NavigationRoute,
type ScreenParamList,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Props = {
+navigation: QRAuthNavigationProp<'SecondaryDeviceConnected'>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ import { getMessageForException } from 'lib/utils/errors.js';

import { PrimaryDeviceQRAuthContext } from './primary-device-qr-auth-context.js';
import type { QRAuthNavigationProp } from './qr-auth-navigator.react.js';
import AuthButtonContainer from '../../account/registration/registration-button-container.react.js';
import AuthContainer from '../../account/registration/registration-container.react.js';
import AuthContentContainer from '../../account/registration/registration-content-container.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import type { RootNavigationProp } from '../../navigation/root-navigator.react.js';
import {
type NavigationRoute,
type ScreenParamList,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Props = {
+navigation: QRAuthNavigationProp<'SecondaryDeviceNotResponding'>,
Expand Down
6 changes: 3 additions & 3 deletions native/account/qr-code-screen.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { platformToIdentityDeviceType } from 'lib/types/identity-service-types.j
import { getConfig } from 'lib/utils/config.js';
import { usingRestoreFlow } from 'lib/utils/services-utils.js';

import AuthButtonContainer from './registration/registration-button-container.react.js';
import AuthContainer from './registration/registration-container.react.js';
import AuthContentContainer from './registration/registration-content-container.react.js';
import AuthButtonContainer from './auth-components/auth-button-container.react.js';
import AuthContainer from './auth-components/auth-container.react.js';
import AuthContentContainer from './auth-components/auth-content-container.react.js';
import type { SignInNavigationProp } from './sign-in-navigator.react.js';
import LinkButton from '../components/link-button.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/account-does-not-exist.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import * as React from 'react';
import { Text, View, Image } from 'react-native';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
import commSwooshSource from '../../img/comm-swoosh.png';
Expand All @@ -14,6 +11,9 @@ import {
ConnectFarcasterRouteName,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Props = {
+navigation: RegistrationNavigationProp<'AccountDoesNotExist'>,
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/avatar-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import {
type UserAvatarSelection,
} from 'lib/components/edit-user-avatar-provider.react.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import {
Expand All @@ -33,6 +30,9 @@ import {
RegistrationUserAvatarCameraModalRouteName,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type AvatarSelectionParams = {
+userSelections: {
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/connect-ethereum.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import {
useGetEthereumAccountFromSIWEResult,
siweNonceExpired,
} from './ethereum-utils.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type { CoolOrNerdMode } from './registration-types.js';
Expand All @@ -36,6 +33,9 @@ import { useSelector } from '../../redux/redux-utils.js';
import { useStyles } from '../../themes/colors.js';
import { defaultURLPrefix } from '../../utils/url-utils.js';
import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';
import { useSIWEPanelState } from '../siwe-hooks.js';
import SIWEPanel from '../siwe-panel.react.js';

Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/connect-farcaster.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import { useIsAppForegrounded } from 'lib/shared/lifecycle-utils.js';
import type { BaseFCAvatarInfo } from 'lib/utils/farcaster-helpers.js';

import { siweNonceExpired } from './ethereum-utils.js';
import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type { CoolOrNerdMode } from './registration-types.js';
Expand All @@ -29,6 +26,9 @@ import {
type AlertDetails,
} from '../../utils/alert-messages.js';
import Alert from '../../utils/alert.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type ConnectFarcasterParams = ?{
+userSelections?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ import invariant from 'invariant';
import * as React from 'react';
import { Text } from 'react-native';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import {
Expand All @@ -20,6 +17,9 @@ import {
KeyserverSelectionRouteName,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Props = {
+navigation: RegistrationNavigationProp<'CoolOrNerdModeSelection'>,
Expand Down
4 changes: 2 additions & 2 deletions native/account/registration/emoji-avatar-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.
import { getDefaultAvatar } from 'lib/shared/avatar-utils.js';
import type { UpdateUserAvatarRequest } from 'lib/types/avatar-types';

import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import { useNativeSetUserAvatar } from '../../avatars/avatar-hooks.js';
import EmojiAvatarCreation from '../../avatars/emoji-avatar-creation.react.js';
import type { NavigationRoute } from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type EmojiAvatarSelectionParams = {
+usernameOrEthAddress: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ import { getMessageForException } from 'lib/utils/errors.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import PrimaryButton from '../../components/primary-button.react.js';
Expand All @@ -34,6 +31,9 @@ import {
appOutOfDateAlertDetails,
} from '../../utils/alert-messages.js';
import Alert from '../../utils/alert.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';
import { useLegacySIWEServerCall } from '../siwe-hooks.js';

export type ExistingEthereumAccountParams = SIWEResult;
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/keyserver-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { getVersionActionTypes } from 'lib/actions/device-actions.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import { useIsKeyserverURLValid } from 'lib/shared/keyserver-utils.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import RegistrationTextInput from './registration-text-input.react.js';
Expand All @@ -28,6 +25,9 @@ import {
import { useSelector } from '../../redux/redux-utils.js';
import { useStyles, useColors } from '../../themes/colors.js';
import { defaultURLPrefix } from '../../utils/url-utils.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

type Selection = 'ashoat' | 'custom';

Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/password-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { View, Text, Platform, TextInput } from 'react-native';

import sleep from 'lib/utils/sleep.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import RegistrationTextInput from './registration-text-input.react.js';
Expand All @@ -20,6 +17,9 @@ import {
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import type { KeyPressEvent } from '../../types/react-native.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type PasswordSelectionParams = {
+userSelections: {
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/registration-terms.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import { Text, View, Image, Linking } from 'react-native';

import type { SIWEBackupSecrets } from 'lib/types/siwe-types.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import type {
Expand All @@ -22,6 +19,9 @@ import { logInActionType } from '../../navigation/action-types.js';
import type { NavigationRoute } from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import Alert from '../../utils/alert.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type RegistrationTermsParams = {
+userSelections: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import { View, Text } from 'react-native';

import { type SIWEResult, SIWEMessageTypes } from 'lib/types/siwe-types.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import { type RegistrationNavigationProp } from './registration-navigator.react.js';
import type {
Expand All @@ -24,6 +21,9 @@ import {
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import Alert from '../../utils/alert.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';
import PromptButton from '../prompt-button.react.js';
import { useSIWEPanelState } from '../siwe-hooks.js';
import SIWEPanel from '../siwe-panel.react.js';
Expand Down
6 changes: 3 additions & 3 deletions native/account/registration/username-selection.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js';
import { isValidEthereumAddress } from 'lib/utils/siwe-utils.js';

import AuthButtonContainer from './registration-button-container.react.js';
import AuthContainer from './registration-container.react.js';
import AuthContentContainer from './registration-content-container.react.js';
import { RegistrationContext } from './registration-context.js';
import type { RegistrationNavigationProp } from './registration-navigator.react.js';
import RegistrationTextInput from './registration-text-input.react.js';
Expand All @@ -28,6 +25,9 @@ import {
PasswordSelectionRouteName,
} from '../../navigation/route-names.js';
import { useStyles } from '../../themes/colors.js';
import AuthButtonContainer from '../auth-components/auth-button-container.react.js';
import AuthContainer from '../auth-components/auth-container.react.js';
import AuthContentContainer from '../auth-components/auth-content-container.react.js';

export type UsernameSelectionParams = {
+userSelections: {
Expand Down
4 changes: 2 additions & 2 deletions native/account/restore-backup-screen.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import * as Progress from 'react-native-progress';

import { getMessageForException } from 'lib/utils/errors.js';

import AuthContainer from './auth-components/auth-container.react.js';
import AuthContentContainer from './auth-components/auth-content-container.react.js';
import { setNativeCredentials } from './native-credentials.js';
import AuthContainer from './registration/registration-container.react.js';
import AuthContentContainer from './registration/registration-content-container.react.js';
import { useRestore } from './restore.js';
import type { SignInNavigationProp } from './sign-in-navigator.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
Expand Down
6 changes: 3 additions & 3 deletions native/account/restore-password-account-screen.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { Text, TextInput, View } from 'react-native';
import { usePasswordLogIn } from 'lib/hooks/login-hooks.js';
import { getMessageForException } from 'lib/utils/errors.js';

import AuthButtonContainer from './auth-components/auth-button-container.react.js';
import AuthContainer from './auth-components/auth-container.react.js';
import AuthContentContainer from './auth-components/auth-content-container.react.js';
import {
fetchNativeCredentials,
setNativeCredentials,
} from './native-credentials.js';
import type { UserCredentials } from './native-credentials.js';
import PromptButton from './prompt-button.react.js';
import AuthButtonContainer from './registration/registration-button-container.react.js';
import AuthContainer from './registration/registration-container.react.js';
import AuthContentContainer from './registration/registration-content-container.react.js';
import RegistrationTextInput from './registration/registration-text-input.react.js';
import type { SignInNavigationProp } from './sign-in-navigator.react.js';
import { useClientBackup } from '../backup/use-client-backup.js';
Expand Down
Loading

0 comments on commit ef2bd4d

Please sign in to comment.