diff --git a/native/navigation/app-navigator.react.js b/native/navigation/app-navigator.react.js index 2fe49521f..c705fb7c1 100644 --- a/native/navigation/app-navigator.react.js +++ b/native/navigation/app-navigator.react.js @@ -1,213 +1,213 @@ // @flow import type { BottomTabNavigationProp } from '@react-navigation/bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import * as SplashScreen from 'expo-splash-screen'; import * as React from 'react'; import Icon from 'react-native-vector-icons/FontAwesome'; import { PersistGate } from 'redux-persist/integration/react'; import { unreadCount } from 'lib/selectors/thread-selectors'; import Calendar from '../calendar/calendar.react'; import Chat from '../chat/chat.react'; import { MultimediaTooltipModal } from '../chat/multimedia-tooltip-modal.react'; import { RobotextMessageTooltipModal } from '../chat/robotext-message-tooltip-modal.react'; import ThreadSettingsMemberTooltipModal from '../chat/settings/thread-settings-member-tooltip-modal.react'; import { TextMessageTooltipModal } from '../chat/text-message-tooltip-modal.react'; import KeyboardStateContainer from '../keyboard/keyboard-state-container.react'; import CameraModal from '../media/camera-modal.react'; import ImageModal from '../media/image-modal.react'; import VideoPlaybackModal from '../media/video-playback-modal.react'; -import More from '../more/more.react'; -import RelationshipListItemTooltipModal from '../more/relationship-list-item-tooltip-modal.react'; +import More from '../profile/more.react'; +import RelationshipListItemTooltipModal from '../profile/relationship-list-item-tooltip-modal.react'; import PushHandler from '../push/push-handler.react'; import { getPersistor } from '../redux/persist'; import { useSelector } from '../redux/redux-utils'; import { RootContext } from '../root-context'; import { waitForInteractions } from '../utils/timers'; import ActionResultModal from './action-result-modal.react'; import { createOverlayNavigator } from './overlay-navigator.react'; import type { OverlayRouterNavigationProp } from './overlay-router'; import type { RootNavigationProp } from './root-navigator.react'; import { CalendarRouteName, ChatRouteName, MoreRouteName, TabNavigatorRouteName, ImageModalRouteName, MultimediaTooltipModalRouteName, ActionResultModalRouteName, TextMessageTooltipModalRouteName, ThreadSettingsMemberTooltipModalRouteName, RelationshipListItemTooltipModalRouteName, RobotextMessageTooltipModalRouteName, CameraModalRouteName, VideoPlaybackModalRouteName, type ScreenParamList, type TabParamList, type OverlayParamList, } from './route-names'; import { tabBar } from './tab-bar.react'; let splashScreenHasHidden = false; const calendarTabOptions = { tabBarLabel: 'Calendar', // eslint-disable-next-line react/display-name tabBarIcon: ({ color }) => ( ), }; const getChatTabOptions = (badge: number) => ({ tabBarLabel: 'Chat', // eslint-disable-next-line react/display-name tabBarIcon: ({ color }) => ( ), tabBarBadge: badge ? badge : undefined, }); const moreTabOptions = { tabBarLabel: 'More', // eslint-disable-next-line react/display-name tabBarIcon: ({ color }) => ( ), }; export type TabNavigationProp< RouteName: $Keys = $Keys, > = BottomTabNavigationProp; const Tab = createBottomTabNavigator< ScreenParamList, TabParamList, TabNavigationProp<>, >(); const tabBarOptions = { keyboardHidesTabBar: false }; function TabNavigator() { const chatBadge = useSelector(unreadCount); return ( ); } export type AppNavigationProp< RouteName: $Keys = $Keys, > = OverlayRouterNavigationProp; const App = createOverlayNavigator< ScreenParamList, OverlayParamList, AppNavigationProp<>, >(); type AppNavigatorProps = { navigation: RootNavigationProp<'App'>, }; function AppNavigator(props: AppNavigatorProps) { const { navigation } = props; const rootContext = React.useContext(RootContext); const setNavStateInitialized = rootContext && rootContext.setNavStateInitialized; React.useEffect(() => { setNavStateInitialized && setNavStateInitialized(); }, [setNavStateInitialized]); const [ localSplashScreenHasHidden, setLocalSplashScreenHasHidden, ] = React.useState(splashScreenHasHidden); React.useEffect(() => { if (localSplashScreenHasHidden) { return; } splashScreenHasHidden = true; (async () => { await waitForInteractions(); try { await SplashScreen.hideAsync(); setLocalSplashScreenHasHidden(true); } catch {} })(); }, [localSplashScreenHasHidden]); let pushHandler; if (localSplashScreenHasHidden) { pushHandler = ( ); } return ( {pushHandler} ); } const styles = { icon: { fontSize: 28, }, }; export default AppNavigator; diff --git a/native/navigation/root-navigator.react.js b/native/navigation/root-navigator.react.js index 0a9d10df2..f5b112115 100644 --- a/native/navigation/root-navigator.react.js +++ b/native/navigation/root-navigator.react.js @@ -1,201 +1,201 @@ // @flow import { createNavigatorFactory, useNavigationBuilder, type StackNavigationState, type StackOptions, type StackNavigationEventMap, type StackNavigatorProps, type ExtraStackNavigatorProps, } from '@react-navigation/native'; import { StackView, TransitionPresets } from '@react-navigation/stack'; import * as React from 'react'; import { Platform } from 'react-native'; import { enableScreens } from 'react-native-screens'; import LoggedOutModal from '../account/logged-out-modal.react'; import VerificationModal from '../account/verification-modal.react'; import ThreadPickerModal from '../calendar/thread-picker-modal.react'; import ImagePasteModal from '../chat/image-paste-modal.react'; import AddUsersModal from '../chat/settings/add-users-modal.react'; import ColorPickerModal from '../chat/settings/color-picker-modal.react'; import ComposeSubthreadModal from '../chat/settings/compose-subthread-modal.react'; import SidebarListModal from '../chat/sidebar-list-modal.react'; -import CustomServerModal from '../more/custom-server-modal.react'; +import CustomServerModal from '../profile/custom-server-modal.react'; import AppNavigator from './app-navigator.react'; import { RootNavigatorContext } from './root-navigator-context'; import RootRouter, { type RootRouterNavigationProp } from './root-router'; import { LoggedOutModalRouteName, VerificationModalRouteName, AppRouteName, ThreadPickerModalRouteName, ImagePasteModalRouteName, AddUsersModalRouteName, CustomServerModalRouteName, ColorPickerModalRouteName, ComposeSubthreadModalRouteName, SidebarListModalRouteName, type ScreenParamList, type RootParamList, } from './route-names'; if (Platform.OS !== 'android' || Platform.Version >= 21) { // Older Android devices get stack overflows when trying to draw deeply nested // view structures. We've tried to get our draw depth down as much as possible // without going into React Navigation internals or creating a separate render // path for these old Android devices. Because react-native-screens increases // the draw depth enough to cause crashes in some scenarios, we disable it // here for those devices enableScreens(); } type RootNavigatorProps = StackNavigatorProps>; function RootNavigator({ initialRouteName, children, screenOptions, ...rest }: RootNavigatorProps) { const { state, descriptors, navigation } = useNavigationBuilder(RootRouter, { initialRouteName, children, screenOptions, }); const [keyboardHandlingEnabled, setKeyboardHandlingEnabled] = React.useState( true, ); const rootNavigationContext = React.useMemo( () => ({ setKeyboardHandlingEnabled }), [setKeyboardHandlingEnabled], ); return ( ); } const createRootNavigator = createNavigatorFactory< StackNavigationState, StackOptions, StackNavigationEventMap, RootRouterNavigationProp<>, ExtraStackNavigatorProps, >(RootNavigator); const baseTransitionPreset = Platform.select({ ios: TransitionPresets.ModalSlideFromBottomIOS, default: TransitionPresets.FadeFromBottomAndroid, }); const transitionPreset = { ...baseTransitionPreset, cardStyleInterpolator: (interpolatorProps) => { const baseCardStyleInterpolator = baseTransitionPreset.cardStyleInterpolator( interpolatorProps, ); const overlayOpacity = interpolatorProps.current.progress.interpolate({ inputRange: [0, 1], outputRange: ([0, 0.7]: number[]), // Flow... extrapolate: 'clamp', }); return { ...baseCardStyleInterpolator, overlayStyle: [ baseCardStyleInterpolator.overlayStyle, { opacity: overlayOpacity }, ], }; }, }; const defaultScreenOptions = { gestureEnabled: Platform.OS === 'ios', animationEnabled: Platform.OS !== 'web' && Platform.OS !== 'windows' && Platform.OS !== 'macos', cardStyle: { backgroundColor: 'transparent' }, ...transitionPreset, }; const disableGesturesScreenOptions = { gestureEnabled: false, }; const modalOverlayScreenOptions = { cardOverlayEnabled: true, }; export type RootNavigationProp< RouteName: $Keys = $Keys, > = RootRouterNavigationProp; const Root = createRootNavigator< ScreenParamList, RootParamList, RootNavigationProp<>, >(); const RootComponent = () => { return ( ); }; export default RootComponent; diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js index 9c2d5c1fb..f10ca342b 100644 --- a/native/navigation/route-names.js +++ b/native/navigation/route-names.js @@ -1,171 +1,171 @@ // @flow import type { LeafRoute } from '@react-navigation/native'; import type { VerificationModalParams } from '../account/verification-modal.react'; import type { ThreadPickerModalParams } from '../calendar/thread-picker-modal.react'; import type { ComposeThreadParams } from '../chat/compose-thread.react'; import type { ImagePasteModalParams } from '../chat/image-paste-modal.react'; import type { MessageListParams } from '../chat/message-list-types'; import type { MultimediaTooltipModalParams } from '../chat/multimedia-tooltip-modal.react'; import type { RobotextMessageTooltipModalParams } from '../chat/robotext-message-tooltip-modal.react'; import type { AddUsersModalParams } from '../chat/settings/add-users-modal.react'; import type { ColorPickerModalParams } from '../chat/settings/color-picker-modal.react'; import type { ComposeSubthreadModalParams } from '../chat/settings/compose-subthread-modal.react'; import type { DeleteThreadParams } from '../chat/settings/delete-thread.react'; import type { ThreadSettingsMemberTooltipModalParams } from '../chat/settings/thread-settings-member-tooltip-modal.react'; import type { ThreadSettingsParams } from '../chat/settings/thread-settings.react'; import type { SidebarListModalParams } from '../chat/sidebar-list-modal.react'; import type { TextMessageTooltipModalParams } from '../chat/text-message-tooltip-modal.react'; import type { CameraModalParams } from '../media/camera-modal.react'; import type { ImageModalParams } from '../media/image-modal.react'; import type { VideoPlaybackModalParams } from '../media/video-playback-modal.react'; -import type { CustomServerModalParams } from '../more/custom-server-modal.react'; -import type { RelationshipListItemTooltipModalParams } from '../more/relationship-list-item-tooltip-modal.react'; +import type { CustomServerModalParams } from '../profile/custom-server-modal.react'; +import type { RelationshipListItemTooltipModalParams } from '../profile/relationship-list-item-tooltip-modal.react'; import type { ActionResultModalParams } from './action-result-modal.react'; export const AppRouteName = 'App'; export const TabNavigatorRouteName = 'TabNavigator'; export const ComposeThreadRouteName = 'ComposeThread'; export const DeleteThreadRouteName = 'DeleteThread'; export const ThreadSettingsRouteName = 'ThreadSettings'; export const MessageListRouteName = 'MessageList'; export const VerificationModalRouteName = 'VerificationModal'; export const LoggedOutModalRouteName = 'LoggedOutModal'; export const MoreRouteName = 'More'; export const MoreScreenRouteName = 'MoreScreen'; export const RelationshipListItemTooltipModalRouteName = 'RelationshipListItemTooltipModal'; export const ChatRouteName = 'Chat'; export const ChatThreadListRouteName = 'ChatThreadList'; export const HomeChatThreadListRouteName = 'HomeChatThreadList'; export const BackgroundChatThreadListRouteName = 'BackgroundChatThreadList'; export const CalendarRouteName = 'Calendar'; export const BuildInfoRouteName = 'BuildInfo'; export const DeleteAccountRouteName = 'DeleteAccount'; export const DevToolsRouteName = 'DevTools'; export const EditEmailRouteName = 'EditEmail'; export const EditPasswordRouteName = 'EditPassword'; export const AppearancePreferencesRouteName = 'AppearancePreferences'; export const ThreadPickerModalRouteName = 'ThreadPickerModal'; export const AddUsersModalRouteName = 'AddUsersModal'; export const CustomServerModalRouteName = 'CustomServerModal'; export const ColorPickerModalRouteName = 'ColorPickerModal'; export const ComposeSubthreadModalRouteName = 'ComposeSubthreadModal'; export const ImageModalRouteName = 'ImageModal'; export const MultimediaTooltipModalRouteName = 'MultimediaTooltipModal'; export const ActionResultModalRouteName = 'ActionResultModal'; export const TextMessageTooltipModalRouteName = 'TextMessageTooltipModal'; export const ThreadSettingsMemberTooltipModalRouteName = 'ThreadSettingsMemberTooltipModal'; export const CameraModalRouteName = 'CameraModal'; export const VideoPlaybackModalRouteName = 'VideoPlaybackModal'; export const FriendListRouteName = 'FriendList'; export const BlockListRouteName = 'BlockList'; export const SidebarListModalRouteName = 'SidebarListModal'; export const ImagePasteModalRouteName = 'ImagePasteModal'; export const RobotextMessageTooltipModalRouteName = 'RobotextMessageTooltipModal'; export type RootParamList = {| +LoggedOutModal: void, +VerificationModal: VerificationModalParams, +App: void, +ThreadPickerModal: ThreadPickerModalParams, +AddUsersModal: AddUsersModalParams, +CustomServerModal: CustomServerModalParams, +ColorPickerModal: ColorPickerModalParams, +ComposeSubthreadModal: ComposeSubthreadModalParams, +SidebarListModal: SidebarListModalParams, +ImagePasteModal: ImagePasteModalParams, |}; export type TooltipModalParamList = {| +MultimediaTooltipModal: MultimediaTooltipModalParams, +TextMessageTooltipModal: TextMessageTooltipModalParams, +ThreadSettingsMemberTooltipModal: ThreadSettingsMemberTooltipModalParams, +RelationshipListItemTooltipModal: RelationshipListItemTooltipModalParams, +RobotextMessageTooltipModal: RobotextMessageTooltipModalParams, |}; export type OverlayParamList = {| +TabNavigator: void, +ImageModal: ImageModalParams, +ActionResultModal: ActionResultModalParams, +CameraModal: CameraModalParams, +VideoPlaybackModal: VideoPlaybackModalParams, ...TooltipModalParamList, |}; export type TabParamList = {| +Calendar: void, +Chat: void, +More: void, |}; export type ChatParamList = {| +ChatThreadList: void, +MessageList: MessageListParams, +ComposeThread: ComposeThreadParams, +ThreadSettings: ThreadSettingsParams, +DeleteThread: DeleteThreadParams, |}; export type ChatTopTabsParamList = {| +HomeChatThreadList: void, +BackgroundChatThreadList: void, |}; export type MoreParamList = {| +MoreScreen: void, +EditEmail: void, +EditPassword: void, +DeleteAccount: void, +BuildInfo: void, +DevTools: void, +AppearancePreferences: void, +FriendList: void, +BlockList: void, |}; export type ScreenParamList = {| ...RootParamList, ...OverlayParamList, ...TabParamList, ...ChatParamList, ...ChatTopTabsParamList, ...MoreParamList, |}; export type NavigationRoute> = {| ...LeafRoute, +params: $ElementType, |}; export const accountModals = [ LoggedOutModalRouteName, VerificationModalRouteName, ]; export const scrollBlockingModals = [ ImageModalRouteName, MultimediaTooltipModalRouteName, TextMessageTooltipModalRouteName, ThreadSettingsMemberTooltipModalRouteName, RelationshipListItemTooltipModalRouteName, RobotextMessageTooltipModalRouteName, VideoPlaybackModalRouteName, ]; export const chatRootModals = [ AddUsersModalRouteName, ColorPickerModalRouteName, ComposeSubthreadModalRouteName, ]; export const threadRoutes = [ MessageListRouteName, ThreadSettingsRouteName, DeleteThreadRouteName, ComposeThreadRouteName, ]; diff --git a/native/more/appearance-preferences.react.js b/native/profile/appearance-preferences.react.js similarity index 100% rename from native/more/appearance-preferences.react.js rename to native/profile/appearance-preferences.react.js diff --git a/native/more/build-info.react.js b/native/profile/build-info.react.js similarity index 100% rename from native/more/build-info.react.js rename to native/profile/build-info.react.js diff --git a/native/more/custom-server-modal.react.js b/native/profile/custom-server-modal.react.js similarity index 100% rename from native/more/custom-server-modal.react.js rename to native/profile/custom-server-modal.react.js diff --git a/native/more/delete-account.react.js b/native/profile/delete-account.react.js similarity index 100% rename from native/more/delete-account.react.js rename to native/profile/delete-account.react.js diff --git a/native/more/dev-tools.react.js b/native/profile/dev-tools.react.js similarity index 100% rename from native/more/dev-tools.react.js rename to native/profile/dev-tools.react.js diff --git a/native/more/edit-email.react.js b/native/profile/edit-email.react.js similarity index 100% rename from native/more/edit-email.react.js rename to native/profile/edit-email.react.js diff --git a/native/more/edit-password.react.js b/native/profile/edit-password.react.js similarity index 100% rename from native/more/edit-password.react.js rename to native/profile/edit-password.react.js diff --git a/native/more/more-header.react.js b/native/profile/more-header.react.js similarity index 100% rename from native/more/more-header.react.js rename to native/profile/more-header.react.js diff --git a/native/more/more-screen.react.js b/native/profile/more-screen.react.js similarity index 100% rename from native/more/more-screen.react.js rename to native/profile/more-screen.react.js diff --git a/native/more/more.react.js b/native/profile/more.react.js similarity index 100% rename from native/more/more.react.js rename to native/profile/more.react.js diff --git a/native/more/relationship-list-item-tooltip-modal.react.js b/native/profile/relationship-list-item-tooltip-modal.react.js similarity index 100% rename from native/more/relationship-list-item-tooltip-modal.react.js rename to native/profile/relationship-list-item-tooltip-modal.react.js diff --git a/native/more/relationship-list-item.react.js b/native/profile/relationship-list-item.react.js similarity index 100% rename from native/more/relationship-list-item.react.js rename to native/profile/relationship-list-item.react.js diff --git a/native/more/relationship-list.react.js b/native/profile/relationship-list.react.js similarity index 100% rename from native/more/relationship-list.react.js rename to native/profile/relationship-list.react.js