diff --git a/native/avatars/edit-user-avatar-provider.react.js b/lib/components/edit-user-avatar-provider.react.js rename from native/avatars/edit-user-avatar-provider.react.js rename to lib/components/edit-user-avatar-provider.react.js --- a/native/avatars/edit-user-avatar-provider.react.js +++ b/lib/components/edit-user-avatar-provider.react.js @@ -5,23 +5,22 @@ import { updateUserAvatar, updateUserAvatarActionTypes, -} from 'lib/actions/user-actions.js'; -import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; +} from '../actions/user-actions.js'; +import { createLoadingStatusSelector } from '../selectors/loading-selectors.js'; import type { ImageAvatarDBContent, UpdateUserAvatarRequest, -} from 'lib/types/avatar-types.js'; -import type { LoadingStatus } from 'lib/types/loading-types.js'; +} from '../types/avatar-types.js'; +import type { LoadingStatus } from '../types/loading-types.js'; import type { MediaLibrarySelection, NativeMediaSelection, -} from 'lib/types/media-types.js'; +} from '../types/media-types.js'; import { useDispatchActionPromise, useServerCall, -} from 'lib/utils/action-utils.js'; - -import { useSelector } from '../redux/redux-utils.js'; +} from '../utils/action-utils.js'; +import { useSelector } from '../utils/redux-utils.js'; export type UserAvatarSelection = | { +needsUpload: true, +mediaSelection: NativeMediaSelection } diff --git a/native/account/registration/avatar-selection.react.js b/native/account/registration/avatar-selection.react.js --- a/native/account/registration/avatar-selection.react.js +++ b/native/account/registration/avatar-selection.react.js @@ -4,6 +4,11 @@ import * as React from 'react'; import { Text, View } from 'react-native'; +import { + EditUserAvatarContext, + type UserAvatarSelection, +} from 'lib/components/edit-user-avatar-provider.react.js'; + import RegistrationButtonContainer from './registration-button-container.react.js'; import RegistrationButton from './registration-button.react.js'; import RegistrationContainer from './registration-container.react.js'; @@ -16,10 +21,6 @@ type AvatarData, ensAvatarSelection, } from './registration-types.js'; -import { - EditUserAvatarContext, - type UserAvatarSelection, -} from '../../avatars/edit-user-avatar-provider.react.js'; import EditUserAvatar from '../../avatars/edit-user-avatar.react.js'; import { useCurrentLeafRouteName } from '../../navigation/nav-selectors.js'; import { diff --git a/native/account/registration/emoji-avatar-selection.react.js b/native/account/registration/emoji-avatar-selection.react.js --- a/native/account/registration/emoji-avatar-selection.react.js +++ b/native/account/registration/emoji-avatar-selection.react.js @@ -4,12 +4,12 @@ import * as React from 'react'; import { Text } from 'react-native'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; import { getDefaultAvatar } from 'lib/shared/avatar-utils.js'; import RegistrationContainer from './registration-container.react.js'; import RegistrationContentContainer from './registration-content-container.react.js'; import type { RegistrationNavigationProp } from './registration-navigator.react.js'; -import { EditUserAvatarContext } from '../../avatars/edit-user-avatar-provider.react.js'; import EmojiAvatarCreation from '../../avatars/emoji-avatar-creation.react.js'; import type { NavigationRoute } from '../../navigation/route-names.js'; import { useStyles } from '../../themes/colors.js'; diff --git a/native/account/registration/registration-server-call.js b/native/account/registration/registration-server-call.js --- a/native/account/registration/registration-server-call.js +++ b/native/account/registration/registration-server-call.js @@ -7,6 +7,7 @@ import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; import { registerActionTypes, register } from 'lib/actions/user-actions.js'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; import type { LogInStartingPayload } from 'lib/types/account-types.js'; import { useServerCall, @@ -20,7 +21,6 @@ AvatarData, } from './registration-types.js'; import { useUploadSelectedMedia } from '../../avatars/avatar-hooks.js'; -import { EditUserAvatarContext } from '../../avatars/edit-user-avatar-provider.react.js'; import { NavContext } from '../../navigation/navigation-context.js'; import { useSelector } from '../../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../../selectors/account-selectors.js'; diff --git a/native/avatars/edit-user-avatar.react.js b/native/avatars/edit-user-avatar.react.js --- a/native/avatars/edit-user-avatar.react.js +++ b/native/avatars/edit-user-avatar.react.js @@ -5,13 +5,13 @@ import * as React from 'react'; import { ActivityIndicator, TouchableOpacity, View } from 'react-native'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; import { useENSAvatar } from 'lib/hooks/ens-cache.js'; import { getETHAddressForUserInfo } from 'lib/shared/account-utils.js'; import type { GenericUserInfoWithAvatar } from 'lib/types/avatar-types.js'; import { useShowAvatarActionSheet } from './avatar-hooks.js'; import EditAvatarBadge from './edit-avatar-badge.react.js'; -import { EditUserAvatarContext } from './edit-user-avatar-provider.react.js'; import UserAvatar from './user-avatar.react.js'; import { EmojiUserAvatarCreationRouteName, diff --git a/native/media/registration-user-avatar-camera-modal.react.js b/native/media/registration-user-avatar-camera-modal.react.js --- a/native/media/registration-user-avatar-camera-modal.react.js +++ b/native/media/registration-user-avatar-camera-modal.react.js @@ -3,8 +3,9 @@ import invariant from 'invariant'; import * as React from 'react'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; + import type { RegistrationNavigationProp } from '../account/registration/registration-navigator.react.js'; -import { EditUserAvatarContext } from '../avatars/edit-user-avatar-provider.react.js'; import CameraModal from '../media/camera-modal.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; diff --git a/native/media/user-avatar-camera-modal.react.js b/native/media/user-avatar-camera-modal.react.js --- a/native/media/user-avatar-camera-modal.react.js +++ b/native/media/user-avatar-camera-modal.react.js @@ -3,7 +3,8 @@ import invariant from 'invariant'; import * as React from 'react'; -import { EditUserAvatarContext } from '../avatars/edit-user-avatar-provider.react.js'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; + import CameraModal from '../media/camera-modal.react.js'; import type { AppNavigationProp } from '../navigation/app-navigator.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; diff --git a/native/profile/emoji-user-avatar-creation.react.js b/native/profile/emoji-user-avatar-creation.react.js --- a/native/profile/emoji-user-avatar-creation.react.js +++ b/native/profile/emoji-user-avatar-creation.react.js @@ -3,9 +3,9 @@ import invariant from 'invariant'; import * as React from 'react'; +import { EditUserAvatarContext } from 'lib/components/edit-user-avatar-provider.react.js'; import { savedEmojiAvatarSelectorForCurrentUser } from 'lib/selectors/user-selectors.js'; -import { EditUserAvatarContext } from '../avatars/edit-user-avatar-provider.react.js'; import EmojiAvatarCreation from '../avatars/emoji-avatar-creation.react.js'; import { displayActionResultModal } from '../navigation/action-result-modal.js'; import { useSelector } from '../redux/redux-utils.js'; diff --git a/native/root.react.js b/native/root.react.js --- a/native/root.react.js +++ b/native/root.react.js @@ -18,6 +18,7 @@ import { Provider } from 'react-redux'; import { PersistGate as ReduxPersistGate } from 'redux-persist/es/integration/react.js'; +import { EditUserAvatarProvider } from 'lib/components/edit-user-avatar-provider.react.js'; import { ENSCacheProvider } from 'lib/components/ens-cache-provider.react.js'; import { MediaCacheProvider } from 'lib/components/media-cache-provider.react.js'; import { actionLogger } from 'lib/utils/action-logger.js'; @@ -28,7 +29,6 @@ useUploadSelectedMedia, } from './avatars/avatar-hooks.js'; import { EditThreadAvatarProvider } from './avatars/edit-thread-avatar-provider.react.js'; -import { EditUserAvatarProvider } from './avatars/edit-user-avatar-provider.react.js'; import ChatContextProvider from './chat/chat-context-provider.react.js'; import { FeatureFlagsProvider } from './components/feature-flags-provider.react.js'; import PersistedStateGate from './components/persisted-state-gate.js';