From 474ea98a3b9341d5c51c885b449b5ed23ae31400 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Thu, 7 Apr 2022 10:22:19 -0300 Subject: [PATCH] Chore: Create app/lib/navigation folder (#4027) * change Navigation to appNavigation and move to navigation folder * change ShareNavigation to shareNavigation and move to navigation folder * fix navigation import Co-authored-by: Diego Mello --- app/AppContainer.tsx | 2 +- app/containers/InAppNotification/NotifierComponent.tsx | 2 +- app/containers/InAppNotification/index.tsx | 2 +- app/containers/MessageActions/index.tsx | 2 +- app/containers/MessageBox/index.tsx | 2 +- app/containers/UIKit/Image.tsx | 2 +- app/containers/markdown/Table.tsx | 2 +- app/lib/methods/actions.ts | 2 +- app/lib/{Navigation.ts => navigation/appNavigation.ts} | 0 app/lib/{ShareNavigation.ts => navigation/shareNavigation.ts} | 0 app/lib/rocketchat/methods/callJitsi.ts | 2 +- app/lib/rocketchat/methods/triggerActions.ts | 2 +- app/sagas/createChannel.js | 2 +- app/sagas/deepLinking.js | 2 +- app/sagas/encryption.js | 2 +- app/sagas/inviteLinks.js | 2 +- app/sagas/messages.js | 2 +- app/sagas/room.js | 2 +- app/sagas/selectServer.js | 2 +- app/share.tsx | 2 +- app/utils/goRoom.ts | 2 +- app/views/CannedResponseDetail.tsx | 2 +- app/views/CannedResponsesListView/index.tsx | 2 +- app/views/CreateDiscussionView/index.tsx | 2 +- app/views/ModalBlockView.tsx | 2 +- app/views/NewMessageView.tsx | 2 +- app/views/RoomInfoView/index.tsx | 2 +- app/views/RoomView/index.tsx | 2 +- app/views/SidebarView/index.tsx | 2 +- 29 files changed, 27 insertions(+), 27 deletions(-) rename app/lib/{Navigation.ts => navigation/appNavigation.ts} (100%) rename app/lib/{ShareNavigation.ts => navigation/shareNavigation.ts} (100%) diff --git a/app/AppContainer.tsx b/app/AppContainer.tsx index 0ae892b7f..af3d34fe0 100644 --- a/app/AppContainer.tsx +++ b/app/AppContainer.tsx @@ -4,7 +4,7 @@ import { createStackNavigator } from '@react-navigation/stack'; import { connect } from 'react-redux'; import { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes'; -import Navigation from './lib/Navigation'; +import Navigation from './lib/navigation/appNavigation'; import { defaultHeader, getActiveRouteName, navigationTheme } from './utils/navigation'; import { RootEnum } from './definitions'; // Stacks diff --git a/app/containers/InAppNotification/NotifierComponent.tsx b/app/containers/InAppNotification/NotifierComponent.tsx index c0c16a9c3..5987c0c7a 100644 --- a/app/containers/InAppNotification/NotifierComponent.tsx +++ b/app/containers/InAppNotification/NotifierComponent.tsx @@ -12,7 +12,7 @@ import { themes } from '../../constants/colors'; import { useTheme } from '../../theme'; import { ROW_HEIGHT } from '../../presentation/RoomItem'; import { goRoom } from '../../utils/goRoom'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { useOrientation } from '../../dimensions'; import { IApplicationState, ISubscription, SubscriptionType } from '../../definitions'; diff --git a/app/containers/InAppNotification/index.tsx b/app/containers/InAppNotification/index.tsx index 7e5d15889..49e227389 100644 --- a/app/containers/InAppNotification/index.tsx +++ b/app/containers/InAppNotification/index.tsx @@ -5,7 +5,7 @@ import { dequal } from 'dequal'; import NotifierComponent, { INotifierComponent } from './NotifierComponent'; import EventEmitter from '../../utils/events'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { getActiveRoute } from '../../utils/navigation'; import { IApplicationState } from '../../definitions'; import { IRoom } from '../../reducers/room'; diff --git a/app/containers/MessageActions/index.tsx b/app/containers/MessageActions/index.tsx index 0527a45fb..904be75f2 100644 --- a/app/containers/MessageActions/index.tsx +++ b/app/containers/MessageActions/index.tsx @@ -8,7 +8,7 @@ import RocketChat from '../../lib/rocketchat'; import database from '../../lib/database'; import I18n from '../../i18n'; import log, { logEvent } from '../../utils/log'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { getMessageTranslation } from '../message/utils'; import { LISTENER } from '../Toast'; import EventEmitter from '../../utils/events'; diff --git a/app/containers/MessageBox/index.tsx b/app/containers/MessageBox/index.tsx index 857dfb575..a087949c9 100644 --- a/app/containers/MessageBox/index.tsx +++ b/app/containers/MessageBox/index.tsx @@ -44,7 +44,7 @@ import { } from './constants'; import CommandsPreview from './CommandsPreview'; import { getUserSelector } from '../../selectors/login'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { withActionSheet } from '../ActionSheet'; import { sanitizeLikeString } from '../../lib/database/utils'; import { CustomIcon } from '../../lib/Icons'; diff --git a/app/containers/UIKit/Image.tsx b/app/containers/UIKit/Image.tsx index ad229fcb3..d35874f2e 100644 --- a/app/containers/UIKit/Image.tsx +++ b/app/containers/UIKit/Image.tsx @@ -4,7 +4,7 @@ import FastImage from '@rocket.chat/react-native-fast-image'; import { BLOCK_CONTEXT } from '@rocket.chat/ui-kit'; import ImageContainer from '../message/Image'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { IThumb, IImage, IElement } from './interfaces'; import { IAttachment } from '../../definitions'; diff --git a/app/containers/markdown/Table.tsx b/app/containers/markdown/Table.tsx index 5f38aa017..39ca2f3a9 100644 --- a/app/containers/markdown/Table.tsx +++ b/app/containers/markdown/Table.tsx @@ -3,7 +3,7 @@ import { ScrollView, Text, TouchableOpacity, View, ViewStyle } from 'react-nativ import { CELL_WIDTH } from './TableCell'; import styles from './styles'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import I18n from '../../i18n'; import { themes } from '../../constants/colors'; diff --git a/app/lib/methods/actions.ts b/app/lib/methods/actions.ts index 2e4323598..da4c55db7 100644 --- a/app/lib/methods/actions.ts +++ b/app/lib/methods/actions.ts @@ -3,7 +3,7 @@ import { TRocketChat } from '../../definitions/IRocketChat'; import EventEmitter from '../../utils/events'; import fetch from '../../utils/fetch'; import random from '../../utils/random'; -import Navigation from '../Navigation'; +import Navigation from '../navigation/appNavigation'; import sdk from '../rocketchat/services/sdk'; const triggersId = new Map(); diff --git a/app/lib/Navigation.ts b/app/lib/navigation/appNavigation.ts similarity index 100% rename from app/lib/Navigation.ts rename to app/lib/navigation/appNavigation.ts diff --git a/app/lib/ShareNavigation.ts b/app/lib/navigation/shareNavigation.ts similarity index 100% rename from app/lib/ShareNavigation.ts rename to app/lib/navigation/shareNavigation.ts diff --git a/app/lib/rocketchat/methods/callJitsi.ts b/app/lib/rocketchat/methods/callJitsi.ts index 0bd2567cc..7b19bb389 100644 --- a/app/lib/rocketchat/methods/callJitsi.ts +++ b/app/lib/rocketchat/methods/callJitsi.ts @@ -1,7 +1,7 @@ import { ISubscription } from '../../../definitions'; import { events, logEvent } from '../../../utils/log'; import { store } from '../../auxStore'; -import Navigation from '../../Navigation'; +import Navigation from '../../navigation/appNavigation'; import sdk from '../services/sdk'; async function jitsiURL({ room }: { room: ISubscription }) { diff --git a/app/lib/rocketchat/methods/triggerActions.ts b/app/lib/rocketchat/methods/triggerActions.ts index 9816f386d..65a14528e 100644 --- a/app/lib/rocketchat/methods/triggerActions.ts +++ b/app/lib/rocketchat/methods/triggerActions.ts @@ -7,7 +7,7 @@ import { } from '../../../containers/UIKit/interfaces'; import { TRocketChat } from '../../../definitions'; import { triggerAction } from '../../methods/actions'; -import Navigation from '../../Navigation'; +import Navigation from '../../navigation/appNavigation'; export function triggerBlockAction(this: TRocketChat, options: ITriggerBlockAction) { return triggerAction.call(this, { type: ActionTypes.ACTION, ...options }); diff --git a/app/sagas/createChannel.js b/app/sagas/createChannel.js index 8185f673e..f540e3226 100644 --- a/app/sagas/createChannel.js +++ b/app/sagas/createChannel.js @@ -5,7 +5,7 @@ import { CREATE_CHANNEL, LOGIN } from '../actions/actionsTypes'; import { createChannelFailure, createChannelSuccess } from '../actions/createChannel'; import { showErrorAlert } from '../utils/info'; import RocketChat from '../lib/rocketchat'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import database from '../lib/database'; import I18n from '../i18n'; import { events, logEvent } from '../utils/log'; diff --git a/app/sagas/deepLinking.js b/app/sagas/deepLinking.js index 1a30b4733..71036b4aa 100644 --- a/app/sagas/deepLinking.js +++ b/app/sagas/deepLinking.js @@ -1,7 +1,7 @@ import { all, delay, put, select, take, takeLatest } from 'redux-saga/effects'; import UserPreferences from '../lib/methods/userPreferences'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import * as types from '../actions/actionsTypes'; import { selectServerRequest, serverInitAdd } from '../actions/server'; import { inviteLinksRequest, inviteLinksSetToken } from '../actions/inviteLinks'; diff --git a/app/sagas/encryption.js b/app/sagas/encryption.js index f7a861686..4ab7e83d7 100644 --- a/app/sagas/encryption.js +++ b/app/sagas/encryption.js @@ -4,7 +4,7 @@ import { put, select, takeLatest } from 'redux-saga/effects'; import { ENCRYPTION } from '../actions/actionsTypes'; import { encryptionSet } from '../actions/encryption'; import { Encryption } from '../lib/encryption'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import { E2E_BANNER_TYPE, E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../lib/constants'; import database from '../lib/database'; import RocketChat from '../lib/rocketchat'; diff --git a/app/sagas/inviteLinks.js b/app/sagas/inviteLinks.js index 2fd536614..de67c52a8 100644 --- a/app/sagas/inviteLinks.js +++ b/app/sagas/inviteLinks.js @@ -5,7 +5,7 @@ import { INVITE_LINKS } from '../actions/actionsTypes'; import { inviteLinksFailure, inviteLinksSetInvite, inviteLinksSuccess } from '../actions/inviteLinks'; import RocketChat from '../lib/rocketchat'; import log from '../utils/log'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import I18n from '../i18n'; const handleRequest = function* handleRequest({ token }) { diff --git a/app/sagas/messages.js b/app/sagas/messages.js index d4d110faa..2f38c2975 100644 --- a/app/sagas/messages.js +++ b/app/sagas/messages.js @@ -1,7 +1,7 @@ import { select, takeLatest } from 'redux-saga/effects'; import { Q } from '@nozbe/watermelondb'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import { MESSAGES } from '../actions/actionsTypes'; import RocketChat from '../lib/rocketchat'; import database from '../lib/database'; diff --git a/app/sagas/room.js b/app/sagas/room.js index f45bf123a..10d615a0b 100644 --- a/app/sagas/room.js +++ b/app/sagas/room.js @@ -3,7 +3,7 @@ import prompt from 'react-native-prompt-android'; import { delay, put, race, select, take, takeLatest } from 'redux-saga/effects'; import EventEmitter from '../utils/events'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import * as types from '../actions/actionsTypes'; import { removedRoom } from '../actions/room'; import RocketChat from '../lib/rocketchat'; diff --git a/app/sagas/selectServer.js b/app/sagas/selectServer.js index 617b4baef..b58a61642 100644 --- a/app/sagas/selectServer.js +++ b/app/sagas/selectServer.js @@ -5,7 +5,7 @@ import { Q } from '@nozbe/watermelondb'; import valid from 'semver/functions/valid'; import coerce from 'semver/functions/coerce'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import { SERVER } from '../actions/actionsTypes'; import { selectServerFailure, selectServerRequest, selectServerSuccess, serverFailure } from '../actions/server'; import { clearSettings } from '../actions/settings'; diff --git a/app/share.tsx b/app/share.tsx index aa2f4174a..8a4ca1f1d 100644 --- a/app/share.tsx +++ b/app/share.tsx @@ -7,7 +7,7 @@ import { Provider } from 'react-redux'; import { getTheme, initialTheme, newThemeState, subscribeTheme, unsubscribeTheme } from './utils/theme'; import UserPreferences from './lib/methods/userPreferences'; -import Navigation from './lib/ShareNavigation'; +import Navigation from './lib/navigation/shareNavigation'; import store from './lib/createStore'; import { initStore } from './lib/auxStore'; import { closeShareExtension, shareExtensionInit } from './lib/rocketchat/services/shareExtension'; diff --git a/app/utils/goRoom.ts b/app/utils/goRoom.ts index 64881abc1..46de9fb11 100644 --- a/app/utils/goRoom.ts +++ b/app/utils/goRoom.ts @@ -1,5 +1,5 @@ import { ChatsStackParamList } from '../stacks/types'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import RocketChat from '../lib/rocketchat'; import { IOmnichannelRoom, SubscriptionType, IVisitor, TSubscriptionModel, ISubscription } from '../definitions'; diff --git a/app/views/CannedResponseDetail.tsx b/app/views/CannedResponseDetail.tsx index 1bb0ae646..91ea72c14 100644 --- a/app/views/CannedResponseDetail.tsx +++ b/app/views/CannedResponseDetail.tsx @@ -10,7 +10,7 @@ import StatusBar from '../containers/StatusBar'; import Button from '../containers/Button'; import { useTheme } from '../theme'; import RocketChat from '../lib/rocketchat'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import { goRoom } from '../utils/goRoom'; import { themes } from '../constants/colors'; import Markdown from '../containers/markdown'; diff --git a/app/views/CannedResponsesListView/index.tsx b/app/views/CannedResponsesListView/index.tsx index e9dec1475..c273efd4a 100644 --- a/app/views/CannedResponsesListView/index.tsx +++ b/app/views/CannedResponsesListView/index.tsx @@ -16,7 +16,7 @@ import { getHeaderTitlePosition } from '../../containers/Header'; import { useTheme } from '../../theme'; import RocketChat from '../../lib/rocketchat'; import debounce from '../../utils/debounce'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { goRoom } from '../../utils/goRoom'; import * as HeaderButton from '../../containers/HeaderButton'; import * as List from '../../containers/List'; diff --git a/app/views/CreateDiscussionView/index.tsx b/app/views/CreateDiscussionView/index.tsx index 97d263680..936ce3f3e 100644 --- a/app/views/CreateDiscussionView/index.tsx +++ b/app/views/CreateDiscussionView/index.tsx @@ -14,7 +14,7 @@ import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import TextInput from '../../containers/TextInput'; import RocketChat from '../../lib/rocketchat'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import { createDiscussionRequest } from '../../actions/createDiscussion'; import { showErrorAlert } from '../../utils/info'; import SafeAreaView from '../../containers/SafeAreaView'; diff --git a/app/views/ModalBlockView.tsx b/app/views/ModalBlockView.tsx index c87a3fd9c..119f45d7f 100644 --- a/app/views/ModalBlockView.tsx +++ b/app/views/ModalBlockView.tsx @@ -13,7 +13,7 @@ import { modalBlockWithContext } from '../containers/UIKit/MessageBlock'; import RocketChat from '../lib/rocketchat'; import ActivityIndicator from '../containers/ActivityIndicator'; import { textParser } from '../containers/UIKit/utils'; -import Navigation from '../lib/Navigation'; +import Navigation from '../lib/navigation/appNavigation'; import { MasterDetailInsideStackParamList } from '../stacks/MasterDetailStack/types'; import { ContainerTypes, ModalActions } from '../containers/UIKit/interfaces'; diff --git a/app/views/NewMessageView.tsx b/app/views/NewMessageView.tsx index 0e191b6ed..cfc7f0c7c 100644 --- a/app/views/NewMessageView.tsx +++ b/app/views/NewMessageView.tsx @@ -16,8 +16,8 @@ import { IApplicationState, IBaseScreen, ISearch, TSubscriptionModel } from '../ import I18n from '../i18n'; import database from '../lib/database'; import { CustomIcon } from '../lib/Icons'; +import Navigation from '../lib/navigation/appNavigation'; import { compareServerVersion } from '../lib/methods/helpers/compareServerVersion'; -import Navigation from '../lib/Navigation'; import RocketChat from '../lib/rocketchat'; import UserItem from '../presentation/UserItem'; import { withTheme } from '../theme'; diff --git a/app/views/RoomInfoView/index.tsx b/app/views/RoomInfoView/index.tsx index 1266e5741..dfcbd95ed 100644 --- a/app/views/RoomInfoView/index.tsx +++ b/app/views/RoomInfoView/index.tsx @@ -25,7 +25,7 @@ import { LISTENER } from '../../containers/Toast'; import EventEmitter from '../../utils/events'; import SafeAreaView from '../../containers/SafeAreaView'; import { goRoom } from '../../utils/goRoom'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import Livechat from './Livechat'; import Channel from './Channel'; import Direct from './Direct'; diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 491e7f780..7ff56c8b4 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -44,7 +44,7 @@ import { import { Review } from '../../utils/review'; import RoomClass from '../../lib/methods/subscriptions/room'; import { getUserSelector } from '../../selectors/login'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import SafeAreaView from '../../containers/SafeAreaView'; import { withDimensions } from '../../dimensions'; import { getHeaderTitlePosition } from '../../containers/Header'; diff --git a/app/views/SidebarView/index.tsx b/app/views/SidebarView/index.tsx index d240e6cb3..67f1af9bc 100644 --- a/app/views/SidebarView/index.tsx +++ b/app/views/SidebarView/index.tsx @@ -15,7 +15,7 @@ import { themes } from '../../constants/colors'; import { withTheme } from '../../theme'; import { getUserSelector } from '../../selectors/login'; import SafeAreaView from '../../containers/SafeAreaView'; -import Navigation from '../../lib/Navigation'; +import Navigation from '../../lib/navigation/appNavigation'; import SidebarItem from './SidebarItem'; import styles from './styles'; import { DrawerParamList } from '../../stacks/types';