diff --git a/native/account/fullscreen-siwe-panel.react.js b/native/account/fullscreen-siwe-panel.react.js --- a/native/account/fullscreen-siwe-panel.react.js +++ b/native/account/fullscreen-siwe-panel.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Alert, ActivityIndicator, View } from 'react-native'; +import { ActivityIndicator, View } from 'react-native'; import { useDispatch } from 'react-redux'; import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; @@ -9,6 +9,7 @@ import { useSIWEServerCall } from './siwe-hooks.js'; import SIWEPanel from './siwe-panel.react.js'; +import Alert from '../utils/alert.js'; type Props = { +goBackToPrompt: () => mixed, diff --git a/native/account/log-in-panel.react.js b/native/account/log-in-panel.react.js --- a/native/account/log-in-panel.react.js +++ b/native/account/log-in-panel.react.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { View, StyleSheet, Alert, Keyboard, Platform } from 'react-native'; +import { View, StyleSheet, Keyboard, Platform } from 'react-native'; import Animated from 'react-native-reanimated'; import { logInActionTypes, logIn } from 'lib/actions/user-actions.js'; @@ -37,6 +37,7 @@ import { useSelector } from '../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js'; import type { KeyPressEvent } from '../types/react-native.js'; +import Alert from '../utils/alert.js'; import { useInitialNotificationsEncryptedMessage } from '../utils/crypto-utils.js'; import type { StateContainer } from '../utils/state-container.js'; diff --git a/native/account/register-panel.react.js b/native/account/register-panel.react.js --- a/native/account/register-panel.react.js +++ b/native/account/register-panel.react.js @@ -8,7 +8,6 @@ StyleSheet, Platform, Keyboard, - Alert, Linking, } from 'react-native'; import Animated from 'react-native-reanimated'; @@ -40,6 +39,7 @@ import { useSelector } from '../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors.js'; import type { KeyPressEvent } from '../types/react-native.js'; +import Alert from '../utils/alert.js'; import { useInitialNotificationsEncryptedMessage } from '../utils/crypto-utils.js'; import { type StateContainer } from '../utils/state-container.js'; diff --git a/native/account/registration/existing-ethereum-account.react.js b/native/account/registration/existing-ethereum-account.react.js --- a/native/account/registration/existing-ethereum-account.react.js +++ b/native/account/registration/existing-ethereum-account.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Text, View, Alert } from 'react-native'; +import { Text, View } from 'react-native'; import { useDispatch } from 'react-redux'; import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; @@ -18,6 +18,7 @@ import type { NavigationRoute } from '../../navigation/route-names.js'; import { useSelector } from '../../redux/redux-utils.js'; import { useStyles } from '../../themes/colors.js'; +import Alert from '../../utils/alert.js'; import { useSIWEServerCall } from '../siwe-hooks.js'; const siweAuthLoadingStatusSelector = 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 @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Alert, Platform } from 'react-native'; +import { Platform } from 'react-native'; import { useDispatch } from 'react-redux'; import { setDataLoadedActionType } from 'lib/actions/client-db-store-actions.js'; @@ -25,6 +25,7 @@ import { NavContext } from '../../navigation/navigation-context.js'; import { useSelector } from '../../redux/redux-utils.js'; import { nativeLogInExtraInfoSelector } from '../../selectors/account-selectors.js'; +import Alert from '../../utils/alert.js'; import { setNativeCredentials } from '../native-credentials.js'; import { useSIWEServerCall } from '../siwe-hooks.js'; diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js --- a/native/account/siwe-panel.react.js +++ b/native/account/siwe-panel.react.js @@ -2,7 +2,6 @@ import BottomSheet from '@gorhom/bottom-sheet'; import * as React from 'react'; -import { Alert } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import WebView from 'react-native-webview'; @@ -21,6 +20,7 @@ import { commCoreModule } from '../native-modules.js'; import { useSelector } from '../redux/redux-utils.js'; +import Alert from '../utils/alert.js'; import { defaultLandingURLPrefix } from '../utils/url-utils.js'; const commSIWE = `${defaultLandingURLPrefix}/siwe`; diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js --- a/native/avatars/avatar-hooks.js +++ b/native/avatars/avatar-hooks.js @@ -5,7 +5,6 @@ import invariant from 'invariant'; import * as React from 'react'; import { Platform } from 'react-native'; -import Alert from 'react-native/Libraries/Alert/Alert.js'; import filesystem from 'react-native-fs'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; @@ -34,6 +33,7 @@ import { processMedia } from '../media/media-utils.js'; import { useSelector } from '../redux/redux-utils.js'; import { useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; import { useStaffCanSee } from '../utils/staff-utils.js'; function displayAvatarUpdateFailureAlert(): void { diff --git a/native/avatars/native-edit-thread-avatar-provider.react.js b/native/avatars/native-edit-thread-avatar-provider.react.js --- a/native/avatars/native-edit-thread-avatar-provider.react.js +++ b/native/avatars/native-edit-thread-avatar-provider.react.js @@ -1,13 +1,13 @@ // @flow import * as React from 'react'; -import { Alert } from 'react-native'; import { BaseEditThreadAvatarProvider } from 'lib/components/base-edit-thread-avatar-provider.react.js'; import { selectFromGallery, useUploadSelectedMedia } from './avatar-hooks.js'; import { activeThreadSelector } from '../navigation/nav-selectors.js'; import { NavContext } from '../navigation/navigation-context.js'; +import Alert from '../utils/alert.js'; const displayAvatarUpdateFailureAlert = () => Alert.alert( diff --git a/native/calendar/entry.react.js b/native/calendar/entry.react.js --- a/native/calendar/entry.react.js +++ b/native/calendar/entry.react.js @@ -11,7 +11,6 @@ TextInput as BaseTextInput, Platform, TouchableWithoutFeedback, - Alert, LayoutAnimation, Keyboard, } from 'react-native'; @@ -81,6 +80,7 @@ import { useSelector } from '../redux/redux-utils.js'; import { colors, useStyles } from '../themes/colors.js'; import type { LayoutEvent } from '../types/react-native.js'; +import Alert from '../utils/alert.js'; import { waitForInteractions } from '../utils/timers.js'; function hueDistance(firstColor: string, secondColor: string): number { diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -14,7 +14,6 @@ TouchableWithoutFeedback, NativeAppEventEmitter, } from 'react-native'; -import Alert from 'react-native/Libraries/Alert/Alert.js'; import { TextInputKeyboardMangerIOS } from 'react-native-keyboard-input'; import Animated, { EasingNode, @@ -126,6 +125,7 @@ import { type Colors, useStyles, useColors } from '../themes/colors.js'; import type { LayoutEvent } from '../types/react-native.js'; import { type AnimatedViewStyle, AnimatedView } from '../types/styles.js'; +import Alert from '../utils/alert.js'; import { runTiming } from '../utils/animation-utils.js'; import { exitEditAlert } from '../utils/edit-messages-utils.js'; import { nativeTypeaheadRegex } from '../utils/typeahead-utils.js'; diff --git a/native/chat/compose-subchannel.react.js b/native/chat/compose-subchannel.react.js --- a/native/chat/compose-subchannel.react.js +++ b/native/chat/compose-subchannel.react.js @@ -5,7 +5,7 @@ import _flow from 'lodash/fp/flow.js'; import _sortBy from 'lodash/fp/sortBy.js'; import * as React from 'react'; -import { View, Text, Alert } from 'react-native'; +import { View, Text } from 'react-native'; import { newThreadActionTypes, newThread } from 'lib/actions/thread-actions.js'; import { useENSNames } from 'lib/hooks/ens-cache.js'; @@ -35,6 +35,7 @@ import type { NavigationRoute } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import { useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; const TagInput = createTagInput(); diff --git a/native/chat/message-report-utils.js b/native/chat/message-report-utils.js --- a/native/chat/message-report-utils.js +++ b/native/chat/message-report-utils.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import { Alert } from 'react-native'; import { sendMessageReport, @@ -14,6 +13,7 @@ import { displayActionResultModal } from '../navigation/action-result-modal.js'; import type { TooltipRoute } from '../tooltip/tooltip.react.js'; +import Alert from '../utils/alert.js'; const confirmReport = () => displayActionResultModal('reported to admin'); diff --git a/native/chat/reaction-message-utils.js b/native/chat/reaction-message-utils.js --- a/native/chat/reaction-message-utils.js +++ b/native/chat/reaction-message-utils.js @@ -2,7 +2,6 @@ import invariant from 'invariant'; import * as React from 'react'; -import Alert from 'react-native/Libraries/Alert/Alert.js'; import { sendReactionMessage, @@ -22,6 +21,7 @@ LayoutCoordinates, VerticalBounds, } from '../types/layout-types.js'; +import Alert from '../utils/alert.js'; function useSendReaction( messageID: ?string, diff --git a/native/chat/relationship-prompt.react.js b/native/chat/relationship-prompt.react.js --- a/native/chat/relationship-prompt.react.js +++ b/native/chat/relationship-prompt.react.js @@ -2,7 +2,7 @@ import Icon from '@expo/vector-icons/FontAwesome5.js'; import * as React from 'react'; -import { Alert, Text, View } from 'react-native'; +import { Text, View } from 'react-native'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; @@ -11,6 +11,7 @@ import Button from '../components/button.react.js'; import { useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; type Props = { +pendingPersonalThreadUserInfo: ?UserInfo, diff --git a/native/chat/settings/add-users-modal.react.js b/native/chat/settings/add-users-modal.react.js --- a/native/chat/settings/add-users-modal.react.js +++ b/native/chat/settings/add-users-modal.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { View, Text, ActivityIndicator, Alert } from 'react-native'; +import { View, Text, ActivityIndicator } from 'react-native'; import { changeThreadSettingsActionTypes, @@ -31,6 +31,7 @@ import type { NavigationRoute } from '../../navigation/route-names.js'; import { useSelector } from '../../redux/redux-utils.js'; import { useStyles } from '../../themes/colors.js'; +import Alert from '../../utils/alert.js'; const TagInput = createTagInput(); diff --git a/native/chat/settings/color-selector-modal.react.js b/native/chat/settings/color-selector-modal.react.js --- a/native/chat/settings/color-selector-modal.react.js +++ b/native/chat/settings/color-selector-modal.react.js @@ -2,7 +2,7 @@ import Icon from '@expo/vector-icons/FontAwesome.js'; import * as React from 'react'; -import { TouchableHighlight, Alert } from 'react-native'; +import { TouchableHighlight } from 'react-native'; import { changeThreadSettingsActionTypes, @@ -25,6 +25,7 @@ import type { NavigationRoute } from '../../navigation/route-names.js'; import { useSelector } from '../../redux/redux-utils.js'; import { type Colors, useStyles, useColors } from '../../themes/colors.js'; +import Alert from '../../utils/alert.js'; export type ColorSelectorModalParams = { +presentedFrom: string, diff --git a/native/chat/settings/thread-settings-description.react.js b/native/chat/settings/thread-settings-description.react.js --- a/native/chat/settings/thread-settings-description.react.js +++ b/native/chat/settings/thread-settings-description.react.js @@ -4,7 +4,6 @@ import * as React from 'react'; import { Text, - Alert, ActivityIndicator, TextInput as BaseTextInput, View, @@ -44,6 +43,7 @@ LayoutEvent, ContentSizeChangeEvent, } from '../../types/react-native.js'; +import Alert from '../../utils/alert.js'; type BaseProps = { +threadInfo: ThreadInfo, diff --git a/native/chat/settings/thread-settings-edit-relationship.react.js b/native/chat/settings/thread-settings-edit-relationship.react.js --- a/native/chat/settings/thread-settings-edit-relationship.react.js +++ b/native/chat/settings/thread-settings-edit-relationship.react.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { Alert, Text, View } from 'react-native'; +import { Text, View } from 'react-native'; import { updateRelationships as serverUpdateRelationships, @@ -28,6 +28,7 @@ import { useSelector } from '../../redux/redux-utils.js'; import { useStyles, useColors } from '../../themes/colors.js'; import type { ViewStyle } from '../../types/styles.js'; +import Alert from '../../utils/alert.js'; type Props = { +threadInfo: ThreadInfo, diff --git a/native/chat/settings/thread-settings-leave-thread.react.js b/native/chat/settings/thread-settings-leave-thread.react.js --- a/native/chat/settings/thread-settings-leave-thread.react.js +++ b/native/chat/settings/thread-settings-leave-thread.react.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { Text, Alert, ActivityIndicator, View } from 'react-native'; +import { Text, ActivityIndicator, View } from 'react-native'; import { leaveThreadActionTypes, @@ -28,6 +28,7 @@ import { useSelector } from '../../redux/redux-utils.js'; import { type Colors, useColors, useStyles } from '../../themes/colors.js'; import type { ViewStyle } from '../../types/styles.js'; +import Alert from '../../utils/alert.js'; type BaseProps = { +threadInfo: ThreadInfo, diff --git a/native/chat/settings/thread-settings-member-tooltip-modal.react.js b/native/chat/settings/thread-settings-member-tooltip-modal.react.js --- a/native/chat/settings/thread-settings-member-tooltip-modal.react.js +++ b/native/chat/settings/thread-settings-member-tooltip-modal.react.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import { Alert } from 'react-native'; import { removeUsersFromThread } from 'lib/actions/thread-actions.js'; import { removeMemberFromThread } from 'lib/shared/thread-utils.js'; @@ -22,6 +21,7 @@ type BaseTooltipProps, type TooltipMenuProps, } from '../../tooltip/tooltip.react.js'; +import Alert from '../../utils/alert.js'; export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{ +memberInfo: RelativeMemberInfo, diff --git a/native/chat/settings/thread-settings-name.react.js b/native/chat/settings/thread-settings-name.react.js --- a/native/chat/settings/thread-settings-name.react.js +++ b/native/chat/settings/thread-settings-name.react.js @@ -4,7 +4,6 @@ import * as React from 'react'; import { Text, - Alert, ActivityIndicator, TextInput as BaseTextInput, View, @@ -35,6 +34,7 @@ import TextInput from '../../components/text-input.react.js'; import { useSelector } from '../../redux/redux-utils.js'; import { type Colors, useStyles, useColors } from '../../themes/colors.js'; +import Alert from '../../utils/alert.js'; type BaseProps = { +threadInfo: ResolvedThreadInfo, diff --git a/native/chat/settings/thread-settings-promote-sidebar.react.js b/native/chat/settings/thread-settings-promote-sidebar.react.js --- a/native/chat/settings/thread-settings-promote-sidebar.react.js +++ b/native/chat/settings/thread-settings-promote-sidebar.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Text, ActivityIndicator, View, Alert } from 'react-native'; +import { Text, ActivityIndicator, View } from 'react-native'; import { usePromoteSidebar } from 'lib/hooks/promote-sidebar.react.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; @@ -10,6 +10,7 @@ import Button from '../../components/button.react.js'; import { type Colors, useColors, useStyles } from '../../themes/colors.js'; import type { ViewStyle } from '../../types/styles.js'; +import Alert from '../../utils/alert.js'; type BaseProps = { +threadInfo: ThreadInfo, diff --git a/native/chat/settings/thread-settings-push-notifs.react.js b/native/chat/settings/thread-settings-push-notifs.react.js --- a/native/chat/settings/thread-settings-push-notifs.react.js +++ b/native/chat/settings/thread-settings-push-notifs.react.js @@ -2,7 +2,6 @@ import * as React from 'react'; import { View, Switch, TouchableOpacity, Platform } from 'react-native'; -import Alert from 'react-native/Libraries/Alert/Alert.js'; import Linking from 'react-native/Libraries/Linking/Linking.js'; import { @@ -25,6 +24,7 @@ import { CommAndroidNotifications } from '../../push/android.js'; import { useSelector } from '../../redux/redux-utils.js'; import { useStyles } from '../../themes/colors.js'; +import Alert from '../../utils/alert.js'; type BaseProps = { +threadInfo: ThreadInfo, diff --git a/native/chat/thread-screen-pruner.react.js b/native/chat/thread-screen-pruner.react.js --- a/native/chat/thread-screen-pruner.react.js +++ b/native/chat/thread-screen-pruner.react.js @@ -2,7 +2,6 @@ import invariant from 'invariant'; import * as React from 'react'; -import { Alert } from 'react-native'; import { threadIsPending } from 'lib/shared/thread-utils.js'; @@ -21,6 +20,7 @@ } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import type { AppState } from '../redux/state-types.js'; +import Alert from '../utils/alert.js'; const ThreadScreenPruner: React.ComponentType<{}> = React.memo<{}>( function ThreadScreenPruner() { diff --git a/native/components/user-list-user.react.js b/native/components/user-list-user.react.js --- a/native/components/user-list-user.react.js +++ b/native/components/user-list-user.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Text, Platform, Alert } from 'react-native'; +import { Text, Platform } from 'react-native'; import type { UserListItem, AccountUserInfo } from 'lib/types/user-types.js'; @@ -10,6 +10,7 @@ import UserAvatar from '../avatars/user-avatar.react.js'; import { type Colors, useColors, useStyles } from '../themes/colors.js'; import type { TextStyle } from '../types/styles.js'; +import Alert from '../utils/alert.js'; // eslint-disable-next-line no-unused-vars const getUserListItemHeight = (item: UserListItem): number => { diff --git a/native/data/sqlite-data-handler.js b/native/data/sqlite-data-handler.js --- a/native/data/sqlite-data-handler.js +++ b/native/data/sqlite-data-handler.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import { Alert } from 'react-native'; import { useDispatch } from 'react-redux'; import { setClientDBStoreActionType } from 'lib/actions/client-db-store-actions.js'; @@ -22,6 +21,7 @@ import { setStoreLoadedActionType } from '../redux/action-types.js'; import { useSelector } from '../redux/redux-utils.js'; import { StaffContext } from '../staff/staff-context.js'; +import Alert from '../utils/alert.js'; import { useInitialNotificationsEncryptedMessage } from '../utils/crypto-utils.js'; import { isTaskCancelledError } from '../utils/error-handling.js'; import { useStaffCanSee } from '../utils/staff-utils.js'; diff --git a/native/dev-menu.js b/native/dev-menu.js --- a/native/dev-menu.js +++ b/native/dev-menu.js @@ -1,11 +1,11 @@ // @flow import { registerDevMenuItems } from 'expo-dev-menu'; -import { Alert } from 'react-native'; import { getMessageForException } from 'lib/utils/errors.js'; import { filesystemMediaCache } from './media/media-cache.js'; +import Alert from './utils/alert.js'; import { wipeAndExit } from './utils/crash-utils.js'; // see https://docs.expo.dev/develop/development-builds/development-workflows/#extending-the-dev-menu diff --git a/native/invite-links/manage-public-link-screen.react.js b/native/invite-links/manage-public-link-screen.react.js --- a/native/invite-links/manage-public-link-screen.react.js +++ b/native/invite-links/manage-public-link-screen.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Text, View, Alert } from 'react-native'; +import { Text, View } from 'react-native'; import { inviteLinkUrl } from 'lib/facts/links.js'; import { useInviteLinksActions } from 'lib/hooks/invite-links.js'; @@ -18,6 +18,7 @@ import type { NavigationRoute } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import { useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; export type ManagePublicLinkScreenParams = { +community: ThreadInfo, diff --git a/native/markdown/markdown-link.react.js b/native/markdown/markdown-link.react.js --- a/native/markdown/markdown-link.react.js +++ b/native/markdown/markdown-link.react.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { Text, Linking, Alert } from 'react-native'; +import { Text, Linking } from 'react-native'; import { inviteLinkUrl } from 'lib/facts/links.js'; @@ -14,6 +14,7 @@ import { MessagePressResponderContext } from '../chat/message-press-responder-context.js'; import { TextMessageMarkdownContext } from '../chat/text-message-markdown-context.js'; import { InviteLinksContext } from '../invite-links/invite-links-context-provider.react.js'; +import Alert from '../utils/alert.js'; import { normalizeURL } from '../utils/url-utils.js'; function useHandleLinkClick( diff --git a/native/profile/default-notifications-preferences.react.js b/native/profile/default-notifications-preferences.react.js --- a/native/profile/default-notifications-preferences.react.js +++ b/native/profile/default-notifications-preferences.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { View, Text, Platform, Alert } from 'react-native'; +import { View, Text, Platform } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; import { @@ -28,6 +28,7 @@ import type { NavigationRoute } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import { useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; const CheckIcon = () => ( , diff --git a/native/profile/profile-screen.react.js b/native/profile/profile-screen.react.js --- a/native/profile/profile-screen.react.js +++ b/native/profile/profile-screen.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { View, Text, Alert, Platform, ScrollView } from 'react-native'; +import { View, Text, Platform, ScrollView } from 'react-native'; import { logOutActionTypes, logOut } from 'lib/actions/user-actions.js'; import { useStringForUser } from 'lib/hooks/ens-cache.js'; @@ -38,6 +38,7 @@ } from '../navigation/route-names.js'; import { useSelector } from '../redux/redux-utils.js'; import { type Colors, useColors, useStyles } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; import { useStaffCanSee } from '../utils/staff-utils.js'; type ProfileRowProps = { diff --git a/native/profile/relationship-list-item-tooltip-modal.react.js b/native/profile/relationship-list-item-tooltip-modal.react.js --- a/native/profile/relationship-list-item-tooltip-modal.react.js +++ b/native/profile/relationship-list-item-tooltip-modal.react.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import { Alert, TouchableOpacity } from 'react-native'; +import { TouchableOpacity } from 'react-native'; import { updateRelationshipsActionTypes, @@ -22,6 +22,7 @@ type BaseTooltipProps, type TooltipMenuProps, } from '../tooltip/tooltip.react.js'; +import Alert from '../utils/alert.js'; type Action = 'unfriend' | 'unblock'; diff --git a/native/profile/relationship-list-item.react.js b/native/profile/relationship-list-item.react.js --- a/native/profile/relationship-list-item.react.js +++ b/native/profile/relationship-list-item.react.js @@ -2,13 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { - Alert, - View, - Text, - TouchableOpacity, - ActivityIndicator, -} from 'react-native'; +import { View, Text, TouchableOpacity, ActivityIndicator } from 'react-native'; import { updateRelationshipsActionTypes, @@ -54,6 +48,7 @@ import { useSelector } from '../redux/redux-utils.js'; import { type Colors, useColors, useStyles } from '../themes/colors.js'; import type { VerticalBounds } from '../types/layout-types.js'; +import Alert from '../utils/alert.js'; type BaseProps = { +userInfo: AccountUserInfo, diff --git a/native/profile/relationship-list.react.js b/native/profile/relationship-list.react.js --- a/native/profile/relationship-list.react.js +++ b/native/profile/relationship-list.react.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; import * as React from 'react'; -import { View, Text, Alert, Platform } from 'react-native'; +import { View, Text, Platform } from 'react-native'; import { FlatList } from 'react-native-gesture-handler'; import { @@ -44,6 +44,7 @@ import { useSelector } from '../redux/redux-utils.js'; import { useStyles, useIndicatorStyle } from '../themes/colors.js'; import type { VerticalBounds } from '../types/layout-types.js'; +import Alert from '../utils/alert.js'; const TagInput = createTagInput(); diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js --- a/native/push/push-handler.react.js +++ b/native/push/push-handler.react.js @@ -2,7 +2,7 @@ import * as Haptics from 'expo-haptics'; import * as React from 'react'; -import { Platform, Alert, LogBox } from 'react-native'; +import { Platform, LogBox } from 'react-native'; import { Notification as InAppNotification } from 'react-native-in-app-message'; import { useDispatch } from 'react-redux'; @@ -73,6 +73,7 @@ import { RootContext, type RootContextType } from '../root-context.js'; import type { EventSubscription } from '../types/react-native.js'; import { type GlobalTheme } from '../types/themes.js'; +import Alert from '../utils/alert.js'; LogBox.ignoreLogs([ // react-native-in-app-message diff --git a/native/roles/change-roles-header-left-button.react.js b/native/roles/change-roles-header-left-button.react.js --- a/native/roles/change-roles-header-left-button.react.js +++ b/native/roles/change-roles-header-left-button.react.js @@ -3,11 +3,12 @@ import { HeaderBackButton as BaseHeaderBackButton } from '@react-navigation/elements'; import invariant from 'invariant'; import * as React from 'react'; -import { Alert, Text } from 'react-native'; +import { Text } from 'react-native'; import { TouchableOpacity } from 'react-native-gesture-handler'; import type { NavigationRoute } from '../navigation/route-names'; import { useColors } from '../themes/colors.js'; +import Alert from '../utils/alert.js'; type ChangeRolesHeaderLeftButtonProps = { +route: NavigationRoute<'ChangeRolesScreen'>, diff --git a/native/roles/role-utils.react.js b/native/roles/role-utils.react.js --- a/native/roles/role-utils.react.js +++ b/native/roles/role-utils.react.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import { Alert } from 'react-native'; import { deleteCommunityRole, @@ -14,6 +13,8 @@ } from 'lib/utils/action-utils.js'; import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js'; +import Alert from '../utils/alert.js'; + function useDisplayDeleteRoleAlert( threadInfo: ThreadInfo, existingRoleID: string, diff --git a/native/socket.react.js b/native/socket.react.js --- a/native/socket.react.js +++ b/native/socket.react.js @@ -1,7 +1,6 @@ // @flow import * as React from 'react'; -import Alert from 'react-native/Libraries/Alert/Alert.js'; import { useDispatch } from 'react-redux'; import { logOut, logOutActionTypes } from 'lib/actions/user-actions.js'; @@ -31,6 +30,7 @@ nativeGetClientResponsesSelector, nativeSessionStateFuncSelector, } from './selectors/socket-selectors.js'; +import Alert from './utils/alert.js'; import { useInitialNotificationsEncryptedMessage } from './utils/crypto-utils.js'; const NativeSocket: React.ComponentType = diff --git a/native/types/message-types-validator.js b/native/types/message-types-validator.js --- a/native/types/message-types-validator.js +++ b/native/types/message-types-validator.js @@ -1,10 +1,10 @@ // @flow -import { Alert } from 'react-native'; import { messageSpecs } from 'lib/shared/messages/message-specs.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; import { commConstants } from '../native-modules.js'; +import Alert from '../utils/alert.js'; if (__DEV__) { const messageTypesCpp = new Set(commConstants.NATIVE_MESSAGE_TYPES); diff --git a/native/utils/edit-messages-utils.js b/native/utils/edit-messages-utils.js --- a/native/utils/edit-messages-utils.js +++ b/native/utils/edit-messages-utils.js @@ -1,6 +1,6 @@ // @flow -import Alert from 'react-native/Libraries/Alert/Alert.js'; +import Alert from './alert.js'; type ExitAlertOptions = { onDiscard: () => void,