From 9efa4ae0628842965f7e74cdf33cd11571ea554c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Thu, 10 Feb 2022 13:15:02 -0300 Subject: [PATCH] Rename NAVIGATION_CLOSE_MODAL as CLOSE_BOTTOM_SHEET constant (#5952) --- app/components/markdown/at_mention/index.tsx | 15 +++++++++------ .../markdown/markdown_code_block/index.tsx | 15 +++++++++------ .../markdown/markdown_image/index.tsx | 17 +++++++++++------ app/components/markdown/markdown_link/index.tsx | 17 +++++++++++------ .../camera_quick_action/camera_type.tsx | 6 +++--- .../post_list/post/body/failed/index.tsx | 13 ++++++++----- .../team_sidebar/add_team/add_team_slide_up.tsx | 4 ++-- .../add_team/team_list_item/team_list_item.tsx | 4 ++-- app/constants/events.ts | 1 + app/constants/navigation.ts | 1 - app/screens/bottom_sheet/index.tsx | 4 ++-- .../browse_channels/dropdown_slideup.tsx | 8 ++++---- .../components/edit_profile_picture.tsx | 4 ++-- .../components/options/user_presence/index.tsx | 4 ++-- .../servers/servers_list/server_item/index.tsx | 4 ++-- app/utils/file/file_picker/index.ts | 4 ++-- assets/base/i18n/en.json | 13 +++++++++++++ 17 files changed, 83 insertions(+), 51 deletions(-) diff --git a/app/components/markdown/at_mention/index.tsx b/app/components/markdown/at_mention/index.tsx index 8aaa4c2f03..e0a705d604 100644 --- a/app/components/markdown/at_mention/index.tsx +++ b/app/components/markdown/at_mention/index.tsx @@ -14,12 +14,12 @@ import {map, switchMap} from 'rxjs/operators'; import CompassIcon from '@components/compass_icon'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; -import {Navigation, Preferences} from '@constants'; +import {Events, Preferences} from '@constants'; import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database'; import {useTheme} from '@context/theme'; import UserModel from '@database/models/server/user'; import {getTeammateNameDisplaySetting} from '@helpers/api/preference'; -import {showModal, showModalOverCurrentContext} from '@screens/navigation'; +import {bottomSheet, showModal} from '@screens/navigation'; import {displayUsername, getUserMentionKeys, getUsersByUsername} from '@utils/user'; import type {WithDatabaseArgs} from '@typings/database/database'; @@ -140,7 +140,7 @@ const AtMention = ({ { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); let username = mentionName; if (user.username) { username = user.username; @@ -155,7 +155,7 @@ const AtMention = ({ destructive={true} icon='cancel' onPress={() => { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }} testID='at_mention.bottom_sheet.cancel' text={intl.formatMessage({id: 'mobile.post.cancel', defaultMessage: 'Cancel'})} @@ -164,12 +164,15 @@ const AtMention = ({ ); }; - showModalOverCurrentContext('BottomSheet', { + bottomSheet({ + closeButtonId: 'close-at-mention', renderContent, snapPoints: [3 * ITEM_HEIGHT, 10], + title: intl.formatMessage({id: 'post.options.title', defaultMessage: 'Options'}), + theme, }); } - }, [managedConfig]); + }, [managedConfig, intl, theme]); const mentionTextStyle = []; diff --git a/app/components/markdown/markdown_code_block/index.tsx b/app/components/markdown/markdown_code_block/index.tsx index 780ab2b8f1..f9e8b7a5a4 100644 --- a/app/components/markdown/markdown_code_block/index.tsx +++ b/app/components/markdown/markdown_code_block/index.tsx @@ -10,9 +10,9 @@ import {DeviceEventEmitter, Keyboard, StyleSheet, Text, TextStyle, View} from 'r import FormattedText from '@components/formatted_text'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {useTheme} from '@context/theme'; -import {goToScreen, showModalOverCurrentContext} from '@screens/navigation'; +import {bottomSheet, goToScreen} from '@screens/navigation'; import {getDisplayNameForLanguage} from '@utils/markdown'; import {preventDoubleTap} from '@utils/tap'; import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme'; @@ -136,7 +136,7 @@ const MarkdownCodeBlock = ({language = '', content, textStyle}: MarkdownCodeBloc { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); Clipboard.setString(content); }} testID='at_mention.bottom_sheet.copy_code' @@ -146,7 +146,7 @@ const MarkdownCodeBlock = ({language = '', content, textStyle}: MarkdownCodeBloc destructive={true} icon='cancel' onPress={() => { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }} testID='at_mention.bottom_sheet.cancel' text={intl.formatMessage({id: 'mobile.post.cancel', defaultMessage: 'Cancel'})} @@ -155,12 +155,15 @@ const MarkdownCodeBlock = ({language = '', content, textStyle}: MarkdownCodeBloc ); }; - showModalOverCurrentContext('BottomSheet', { + bottomSheet({ + closeButtonId: 'close-code-block', renderContent, snapPoints: [3 * ITEM_HEIGHT, 10], + title: intl.formatMessage({id: 'post.options.title', defaultMessage: 'Options'}), + theme, }); } - }, [managedConfig]); + }, [managedConfig, intl, theme]); const trimContent = (text: string) => { const lines = text.split('\n'); diff --git a/app/components/markdown/markdown_image/index.tsx b/app/components/markdown/markdown_image/index.tsx index 63e51c7121..c0764c26a7 100644 --- a/app/components/markdown/markdown_image/index.tsx +++ b/app/components/markdown/markdown_image/index.tsx @@ -13,10 +13,11 @@ import FormattedText from '@components/formatted_text'; import ProgressiveImage from '@components/progressive_image'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {useServerUrl} from '@context/server'; +import {useTheme} from '@context/theme'; import {useIsTablet} from '@hooks/device'; -import {showModalOverCurrentContext} from '@screens/navigation'; +import {bottomSheet} from '@screens/navigation'; import {openGallerWithMockFile} from '@utils/gallery'; import {generateId} from '@utils/general'; import {calculateDimensions, getViewPortWidth, isGifTooLarge} from '@utils/images'; @@ -54,6 +55,7 @@ const MarkdownImage = ({ }: MarkdownImageProps) => { const intl = useIntl(); const isTablet = useIsTablet(); + const theme = useTheme(); const managedConfig = useManagedConfig(); const genericFileId = useRef(generateId()).current; const metadata = imagesMetadata?.[source] || Object.values(imagesMetadata || {})[0]; @@ -120,7 +122,7 @@ const MarkdownImage = ({ { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); Clipboard.setString(linkDestination || source); }} testID='at_mention.bottom_sheet.copy_url' @@ -130,7 +132,7 @@ const MarkdownImage = ({ destructive={true} icon='cancel' onPress={() => { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }} testID='at_mention.bottom_sheet.cancel' text={intl.formatMessage({id: 'mobile.post.cancel', defaultMessage: 'Cancel'})} @@ -139,12 +141,15 @@ const MarkdownImage = ({ ); }; - showModalOverCurrentContext('BottomSheet', { + bottomSheet({ + closeButtonId: 'close-mardown-image', renderContent, snapPoints: [3 * ITEM_HEIGHT, 10], + title: intl.formatMessage({id: 'post.options.title', defaultMessage: 'Options'}), + theme, }); } - }, [managedConfig]); + }, [managedConfig, intl, theme]); const handlePreviewImage = useCallback(() => { openGallerWithMockFile(fileInfo.uri, postId, fileInfo.height, fileInfo.width, fileInfo.id); diff --git a/app/components/markdown/markdown_link/index.tsx b/app/components/markdown/markdown_link/index.tsx index 98195996f7..1801f7db5c 100644 --- a/app/components/markdown/markdown_link/index.tsx +++ b/app/components/markdown/markdown_link/index.tsx @@ -15,11 +15,12 @@ import urlParse from 'url-parse'; import {showPermalink} from '@actions/local/permalink'; import {switchToChannelByName} from '@actions/remote/channel'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {MM_TABLES, SYSTEM_IDENTIFIERS} from '@constants/database'; import DeepLinkTypes from '@constants/deep_linking'; import {useServerUrl} from '@context/server'; -import {dismissAllModals, popToRoot, showModalOverCurrentContext} from '@screens/navigation'; +import {useTheme} from '@context/theme'; +import {bottomSheet, dismissAllModals, popToRoot} from '@screens/navigation'; import {errorBadChannel} from '@utils/draft'; import {preventDoubleTap} from '@utils/tap'; import {matchDeepLink, normalizeProtocol, tryOpenURL} from '@utils/url'; @@ -45,6 +46,7 @@ const MarkdownLink = ({children, experimentalNormalizeMarkdownLinks, href, siteU const intl = useIntl(); const managedConfig = useManagedConfig(); const serverUrl = useServerUrl(); + const theme = useTheme(); const {formatMessage} = intl; @@ -131,7 +133,7 @@ const MarkdownLink = ({children, experimentalNormalizeMarkdownLinks, href, siteU { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); Clipboard.setString(href); }} testID='at_mention.bottom_sheet.copy_url' @@ -141,7 +143,7 @@ const MarkdownLink = ({children, experimentalNormalizeMarkdownLinks, href, siteU destructive={true} icon='cancel' onPress={() => { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }} testID='at_mention.bottom_sheet.cancel' text={intl.formatMessage({id: 'mobile.post.cancel', defaultMessage: 'Cancel'})} @@ -150,12 +152,15 @@ const MarkdownLink = ({children, experimentalNormalizeMarkdownLinks, href, siteU ); }; - showModalOverCurrentContext('BottomSheet', { + bottomSheet({ + closeButtonId: 'close-mardown-link', renderContent, snapPoints: [3 * ITEM_HEIGHT, 10], + title: intl.formatMessage({id: 'post.options.title', defaultMessage: 'Options'}), + theme, }); } - }, [managedConfig]); + }, [managedConfig, intl, theme]); const renderChildren = experimentalNormalizeMarkdownLinks ? parseChildren() : children; diff --git a/app/components/post_draft/quick_actions/camera_quick_action/camera_type.tsx b/app/components/post_draft/quick_actions/camera_quick_action/camera_type.tsx index c701002db6..dc7e6a5a29 100644 --- a/app/components/post_draft/quick_actions/camera_quick_action/camera_type.tsx +++ b/app/components/post_draft/quick_actions/camera_quick_action/camera_type.tsx @@ -8,7 +8,7 @@ import {CameraOptions} from 'react-native-image-picker'; import CompassIcon from '@components/compass_icon'; import FormattedText from '@components/formatted_text'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {useTheme} from '@context/theme'; import {useIsTablet} from '@hooks/device'; import {makeStyleSheetFromTheme} from '@utils/theme'; @@ -65,7 +65,7 @@ const CameraType = ({onPress}: Props) => { }; onPress(options); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }; const onVideo = () => { @@ -76,7 +76,7 @@ const CameraType = ({onPress}: Props) => { }; onPress(options); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }; return ( diff --git a/app/components/post_list/post/body/failed/index.tsx b/app/components/post_list/post/body/failed/index.tsx index 55a6d70433..8bcd8f6260 100644 --- a/app/components/post_list/post/body/failed/index.tsx +++ b/app/components/post_list/post/body/failed/index.tsx @@ -9,9 +9,9 @@ import {removePost} from '@actions/local/post'; import CompassIcon from '@components/compass_icon'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import Navigation from '@constants/navigation'; +import {Events} from '@constants'; import {useServerUrl} from '@context/server'; -import {showModalOverCurrentContext} from '@screens/navigation'; +import {bottomSheet} from '@screens/navigation'; import type PostModel from '@typings/database/models/servers/post'; @@ -46,7 +46,7 @@ const Failed = ({post, theme}: FailedProps) => { { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); retryPost(serverUrl, post); }} testID='post.failed.retry' @@ -56,7 +56,7 @@ const Failed = ({post, theme}: FailedProps) => { destructive={true} icon='close-circle-outline' onPress={() => { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); removePost(serverUrl, post); }} testID='post.failed.delete' @@ -66,9 +66,12 @@ const Failed = ({post, theme}: FailedProps) => { ); }; - showModalOverCurrentContext('BottomSheet', { + bottomSheet({ + closeButtonId: 'close-post-failed', renderContent, snapPoints: [3 * ITEM_HEIGHT, 10], + title: intl.formatMessage({id: 'post.options.title', defaultMessage: 'Options'}), + theme, }); }, []); diff --git a/app/components/team_sidebar/add_team/add_team_slide_up.tsx b/app/components/team_sidebar/add_team/add_team_slide_up.tsx index 5f320d561a..94ad8ee899 100644 --- a/app/components/team_sidebar/add_team/add_team_slide_up.tsx +++ b/app/components/team_sidebar/add_team/add_team_slide_up.tsx @@ -5,7 +5,7 @@ import React, {useCallback} from 'react'; import {useIntl} from 'react-intl'; import {DeviceEventEmitter} from 'react-native'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import BottomSheetContent from '@screens/bottom_sheet/content'; import TeamList from './team_list'; @@ -23,7 +23,7 @@ export default function AddTeamSlideUp({otherTeams, canCreateTeams, showTitle = const onPressCreate = useCallback(() => { //TODO Create team screen - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }, []); return ( diff --git a/app/components/team_sidebar/add_team/team_list_item/team_list_item.tsx b/app/components/team_sidebar/add_team/team_list_item/team_list_item.tsx index ab0c101fc7..ec9c530c4e 100644 --- a/app/components/team_sidebar/add_team/team_list_item/team_list_item.tsx +++ b/app/components/team_sidebar/add_team/team_list_item/team_list_item.tsx @@ -7,7 +7,7 @@ import {DeviceEventEmitter, Text, View} from 'react-native'; import {addUserToTeam} from '@actions/remote/team'; import TeamIcon from '@components/team_sidebar/team_list/team_item/team_icon'; import TouchableWithFeedback from '@components/touchable_with_feedback'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {useServerUrl} from '@context/server'; import {useTheme} from '@context/theme'; import {makeStyleSheetFromTheme} from '@utils/theme'; @@ -25,7 +25,7 @@ export default function TeamListItem({team, currentUserId}: Props) { const serverUrl = useServerUrl(); const onPress = useCallback(async () => { await addUserToTeam(serverUrl, team.id, currentUserId); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }, []); return ( diff --git a/app/constants/events.ts b/app/constants/events.ts index 9e55a5b20e..f9eccd0f8e 100644 --- a/app/constants/events.ts +++ b/app/constants/events.ts @@ -6,6 +6,7 @@ import keyMirror from '@utils/key_mirror'; export default keyMirror({ ACCOUNT_SELECT_TABLET_VIEW: null, CHANNEL_DELETED: null, + CLOSE_BOTTOM_SHEET: null, CONFIG_CHANGED: null, LEAVE_CHANNEL: null, LEAVE_TEAM: null, diff --git a/app/constants/navigation.ts b/app/constants/navigation.ts index 9a23ce085b..b7c1e94e4d 100644 --- a/app/constants/navigation.ts +++ b/app/constants/navigation.ts @@ -5,7 +5,6 @@ import keyMirror from '@utils/key_mirror'; const Navigation = keyMirror({ NAVIGATE_TO_TAB: null, - NAVIGATION_CLOSE_MODAL: null, NAVIGATION_HOME: null, NAVIGATION_SHOW_OVERLAY: null, NAVIGATION_DISMISS_AND_POP_TO_ROOT: null, diff --git a/app/screens/bottom_sheet/index.tsx b/app/screens/bottom_sheet/index.tsx index fdb5b7bb93..68cb28f9ff 100644 --- a/app/screens/bottom_sheet/index.tsx +++ b/app/screens/bottom_sheet/index.tsx @@ -8,7 +8,7 @@ import {Navigation as RNN} from 'react-native-navigation'; import Animated from 'react-native-reanimated'; import RNBottomSheet from 'reanimated-bottom-sheet'; -import {Navigation, Screens} from '@constants'; +import {Events, Screens} from '@constants'; import {useTheme} from '@context/theme'; import {useIsTablet} from '@hooks/device'; import {dismissModal} from '@screens/navigation'; @@ -32,7 +32,7 @@ const BottomSheet = ({closeButtonId, initialSnapIndex = 0, renderContent, snapPo const lastSnap = snapPoints.length - 1; useEffect(() => { - const listener = DeviceEventEmitter.addListener(Navigation.NAVIGATION_CLOSE_MODAL, () => { + const listener = DeviceEventEmitter.addListener(Events.CLOSE_BOTTOM_SHEET, () => { if (sheetRef.current) { sheetRef.current.snapTo(lastSnap); } else { diff --git a/app/screens/browse_channels/dropdown_slideup.tsx b/app/screens/browse_channels/dropdown_slideup.tsx index e51bac744c..34bbf6b231 100644 --- a/app/screens/browse_channels/dropdown_slideup.tsx +++ b/app/screens/browse_channels/dropdown_slideup.tsx @@ -6,7 +6,7 @@ import {useIntl} from 'react-intl'; import {DeviceEventEmitter} from 'react-native'; import SlideUpPanelItem from '@components/slide_up_panel_item'; -import NavigationConstants from '@constants/navigation'; +import {Events} from '@constants'; import {useTheme} from '@context/theme'; import {useIsTablet} from '@hooks/device'; import BottomSheetContent from '@screens/bottom_sheet/content'; @@ -49,17 +49,17 @@ export default function DropdownSlideup({ }; const handlePublicPress = useCallback(() => { - DeviceEventEmitter.emit(NavigationConstants.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); onPress(PUBLIC); }, [onPress]); const handleArchivedPress = useCallback(() => { - DeviceEventEmitter.emit(NavigationConstants.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); onPress(ARCHIVED); }, [onPress]); const handleSharedPress = useCallback(() => { - DeviceEventEmitter.emit(NavigationConstants.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); onPress(SHARED); }, [onPress]); diff --git a/app/screens/edit_profile/components/edit_profile_picture.tsx b/app/screens/edit_profile/components/edit_profile_picture.tsx index fc15c62f00..1b2707957f 100644 --- a/app/screens/edit_profile/components/edit_profile_picture.tsx +++ b/app/screens/edit_profile/components/edit_profile_picture.tsx @@ -6,7 +6,7 @@ import {DeviceEventEmitter, Platform, View} from 'react-native'; import {Client} from '@client/rest'; import ProfileImage from '@components/profile_picture'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {ACCOUNT_OUTLINE_IMAGE} from '@constants/profile'; import {useServerUrl} from '@context/server'; import {useTheme} from '@context/theme'; @@ -81,7 +81,7 @@ const EditProfilePicture = ({user, onUpdateProfilePicture}: ChangeProfilePicture setPictureUrl(pUrl); onUpdateProfilePicture({isRemoved, localPath}); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); }, [onUpdateProfilePicture]); const pictureSource = useMemo(() => { diff --git a/app/screens/home/account/components/options/user_presence/index.tsx b/app/screens/home/account/components/options/user_presence/index.tsx index f475c83e13..b70cbacccd 100644 --- a/app/screens/home/account/components/options/user_presence/index.tsx +++ b/app/screens/home/account/components/options/user_presence/index.tsx @@ -10,7 +10,7 @@ import DrawerItem from '@components/drawer_item'; import SlideUpPanelItem, {ITEM_HEIGHT} from '@components/slide_up_panel_item'; import StatusLabel from '@components/status_label'; import UserStatusIndicator from '@components/user_status'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import General from '@constants/general'; import {useServerUrl} from '@context/server'; import {bottomSheet, dismissModal} from '@screens/navigation'; @@ -111,7 +111,7 @@ const UserStatus = ({currentUser, style, theme}: Props) => { } updateStatus(status); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); return null; }, []); diff --git a/app/screens/home/channel_list/servers/servers_list/server_item/index.tsx b/app/screens/home/channel_list/servers/servers_list/server_item/index.tsx index a8e7c34363..2b2257b146 100644 --- a/app/screens/home/channel_list/servers/servers_list/server_item/index.tsx +++ b/app/screens/home/channel_list/servers/servers_list/server_item/index.tsx @@ -9,7 +9,7 @@ import Swipeable from 'react-native-gesture-handler/Swipeable'; import CompassIcon from '@components/compass_icon'; import ServerIcon from '@components/server_icon'; -import {Events, Navigation} from '@constants'; +import {Events} from '@constants'; import {useTheme} from '@context/theme'; import {subscribeServerUnreadAndMentions} from '@database/subscription/unreads'; import WebsocketManager from '@init/websocket_manager'; @@ -141,7 +141,7 @@ const ServerItem = ({isActive, server}: Props) => { if (isActive) { // eslint-disable-next-line no-console console.log('ACTIVE SERVER', server.displayName); - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); return; } diff --git a/app/utils/file/file_picker/index.ts b/app/utils/file/file_picker/index.ts index 39dbf444bc..b427a586fe 100644 --- a/app/utils/file/file_picker/index.ts +++ b/app/utils/file/file_picker/index.ts @@ -9,7 +9,7 @@ import DocumentPicker, {DocumentPickerResponse} from 'react-native-document-pick import {Asset, CameraOptions, ImageLibraryOptions, ImagePickerResponse, launchCamera, launchImageLibrary} from 'react-native-image-picker'; import Permissions, {AndroidPermission, IOSPermission} from 'react-native-permissions'; -import {Navigation} from '@constants'; +import {Events} from '@constants'; import {extractFileInfo, lookupMimeType} from '@utils/file'; const ShareExtension = NativeModules.MattermostShare; @@ -101,7 +101,7 @@ export default class FilePickerUtil { const out = await extractFileInfo(files); if (out.length > 0) { - DeviceEventEmitter.emit(Navigation.NAVIGATION_CLOSE_MODAL); + DeviceEventEmitter.emit(Events.CLOSE_BOTTOM_SHEET); this.uploadFiles(out); } }; diff --git a/assets/base/i18n/en.json b/assets/base/i18n/en.json index ee86473973..85d3152fd2 100644 --- a/assets/base/i18n/en.json +++ b/assets/base/i18n/en.json @@ -25,6 +25,15 @@ "apps.error.responses.unknown_type": "App response type not supported. Response type: {type}.", "apps.error.unknown": "Unknown error occurred.", "archivedChannelMessage": "You are viewing an **archived channel**. New messages cannot be posted.", + "browse_channels.archivedChannels": "Archived Channels", + "browse_channels.dropdownTitle": "Show", + "browse_channels.noMore": "No more channels to join", + "browse_channels.publicChannels": "Public Channels", + "browse_channels.sharedChannels": "Shared Channels", + "browse_channels.showArchivedChannels": "Show: Archived Channels", + "browse_channels.showPublicChannels": "Show: Public Channels", + "browse_channels.showSharedChannels": "Show: Shared Channels", + "browse_channels.title": "More Channels", "camera_type.photo.option": "Capture Photo", "camera_type.title": "Choose an action", "camera_type.video.option": "Record Video", @@ -179,7 +188,10 @@ "mobile.components.select_server_view.msg_description": "A Server is your team's communication hub which is accessed through a unique URL", "mobile.components.select_server_view.msg_welcome": "Welcome", "mobile.components.select_server_view.proceed": "Proceed", + "mobile.create_channel": "Create", + "mobile.create_channel.public": "New Public Channel", "mobile.create_post.read_only": "This channel is read-only.", + "mobile.custom_list.no_results": "No Results", "mobile.custom_status.choose_emoji": "Choose an emoji", "mobile.custom_status.clear_after": "Clear After", "mobile.custom_status.clear_after.title": "Clear Custom Status After", @@ -359,6 +371,7 @@ "post_info.guest": "GUEST", "post_info.system": "System", "post_message_view.edited": "(edited)", + "post.options.title": "Options", "posts_view.newMsg": "New Messages", "screen.mentions.subtitle": "Messages you've been mentioned in", "screen.mentions.title": "Recent Mentions",