forked from Ivasoft/mattermost-mobile
Gekidou cleanup (#6263)
* Cleanup registered screens * Do not use ALL CAPS in translations, prefer style upercase * Improve isScreenRegistered check * Update app/screens/thread_options/thread_options.tsx Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com> Co-authored-by: Avinash Lingaloo <avinashlng1080@gmail.com>
This commit is contained in:
@@ -42,7 +42,7 @@ const HeaderTag = ({
|
||||
return (
|
||||
<Tag
|
||||
id={t('post_info.auto_responder')}
|
||||
defaultMessage={'AUTOMATIC REPLY'}
|
||||
defaultMessage={'Automatic Reply'}
|
||||
style={style.tag}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -35,6 +35,7 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
color: theme.centerChannelColor,
|
||||
fontFamily: 'OpenSans-SemiBold',
|
||||
fontSize: 10,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
title: {
|
||||
backgroundColor: changeOpacity(theme.sidebarHeaderTextColor, 0.15),
|
||||
@@ -45,7 +46,7 @@ const getStyleFromTheme = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
|
||||
export function BotTag(props: Omit<TagProps, 'id' | 'defaultMessage'>) {
|
||||
const id = t('post_info.bot');
|
||||
const defaultMessage = 'BOT';
|
||||
const defaultMessage = 'Bot';
|
||||
|
||||
return (
|
||||
<Tag
|
||||
@@ -58,7 +59,7 @@ export function BotTag(props: Omit<TagProps, 'id' | 'defaultMessage'>) {
|
||||
|
||||
export function GuestTag(props: Omit<TagProps, 'id' | 'defaultMessage'>) {
|
||||
const id = t('post_info.guest');
|
||||
const defaultMessage = 'GUEST';
|
||||
const defaultMessage = 'Guest';
|
||||
|
||||
return (
|
||||
<Tag
|
||||
|
||||
@@ -31,6 +31,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
},
|
||||
text: {
|
||||
color: theme.sidebarText,
|
||||
textTransform: 'capitalize',
|
||||
...typography('Heading', 400, 'SemiBold'),
|
||||
},
|
||||
image: {
|
||||
@@ -101,14 +102,12 @@ export default function TeamIcon({
|
||||
|
||||
let teamIconContent;
|
||||
if (nameOnly) {
|
||||
const first = displayName[0].toUpperCase();
|
||||
const second = displayName[1]?.toLowerCase() || '';
|
||||
teamIconContent = (
|
||||
<Text
|
||||
style={textColor ? [styles.text, {color: textColor}] : styles.text}
|
||||
testID={`${testID}.display_name_abbreviation`}
|
||||
>
|
||||
{`${first}${second}`}
|
||||
{displayName.substring(0, 2)}
|
||||
</Text>
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ import {useIsTablet} from '@hooks/device';
|
||||
import {bottomSheet} from '@screens/navigation';
|
||||
import {preventDoubleTap} from '@utils/tap';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from '@utils/theme';
|
||||
import {typography} from '@utils/typography';
|
||||
|
||||
import UserAvatar from './user_avatar';
|
||||
import UsersList from './users_list';
|
||||
@@ -86,8 +87,8 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
},
|
||||
listHeaderText: {
|
||||
color: changeOpacity(theme.centerChannelColor, 0.56),
|
||||
fontSize: 12,
|
||||
fontWeight: '600',
|
||||
...typography('Body', 75, 'SemiBold'),
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
};
|
||||
});
|
||||
@@ -104,7 +105,7 @@ const UserAvatarsStack = ({breakAt = 3, style: baseContainerStyle, users}: Props
|
||||
<View style={style.listHeader}>
|
||||
<FormattedText
|
||||
id='mobile.participants.header'
|
||||
defaultMessage={'THREAD PARTICIPANTS'}
|
||||
defaultMessage={'Thread Participants'}
|
||||
style={style.listHeaderText}
|
||||
/>
|
||||
</View>
|
||||
@@ -117,7 +118,7 @@ const UserAvatarsStack = ({breakAt = 3, style: baseContainerStyle, users}: Props
|
||||
closeButtonId: 'close-set-user-status',
|
||||
renderContent,
|
||||
snapPoints: [(Math.min(14, users.length) + 3) * 40, 10],
|
||||
title: intl.formatMessage({id: 'mobile.participants.header', defaultMessage: 'THREAD PARTICIPANTS'}),
|
||||
title: intl.formatMessage({id: 'mobile.participants.header', defaultMessage: 'Thread Participants'}),
|
||||
theme,
|
||||
});
|
||||
}), [isTablet, theme, users]);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
export const ABOUT = 'About';
|
||||
export const ACCOUNT = 'Account';
|
||||
export const EMOJI_PICKER = 'EmojiPicker';
|
||||
export const APP_FORM = 'AppForm';
|
||||
export const APPS_FORM = 'AppForm';
|
||||
export const BOTTOM_SHEET = 'BottomSheet';
|
||||
export const BROWSE_CHANNELS = 'BrowseChannels';
|
||||
export const CHANNEL = 'Channel';
|
||||
@@ -33,14 +33,12 @@ export const LOGIN = 'Login';
|
||||
export const MENTIONS = 'Mentions';
|
||||
export const MFA = 'MFA';
|
||||
export const SELECT_TEAM = 'SelectTeam';
|
||||
export const PARTICIPANTS_LIST = 'ParticipantsList';
|
||||
export const PERMALINK = 'Permalink';
|
||||
export const POST_OPTIONS = 'PostOptions';
|
||||
export const REACTIONS = 'Reactions';
|
||||
export const SAVED_POSTS = 'SavedPosts';
|
||||
export const SEARCH = 'Search';
|
||||
export const SERVER = 'Server';
|
||||
export const SETTINGS_SIDEBAR = 'SettingsSidebar';
|
||||
export const SSO = 'SSO';
|
||||
export const THREAD = 'Thread';
|
||||
export const THREAD_FOLLOW_BUTTON = 'ThreadFollowButton';
|
||||
@@ -52,7 +50,7 @@ export default {
|
||||
ABOUT,
|
||||
ACCOUNT,
|
||||
EMOJI_PICKER,
|
||||
APP_FORM,
|
||||
APPS_FORM,
|
||||
BOTTOM_SHEET,
|
||||
BROWSE_CHANNELS,
|
||||
CHANNEL,
|
||||
@@ -81,27 +79,42 @@ export default {
|
||||
MENTIONS,
|
||||
MFA,
|
||||
SELECT_TEAM,
|
||||
PARTICIPANTS_LIST,
|
||||
PERMALINK,
|
||||
POST_OPTIONS,
|
||||
REACTIONS,
|
||||
SAVED_POSTS,
|
||||
SEARCH,
|
||||
SERVER,
|
||||
SETTINGS_SIDEBAR,
|
||||
SSO,
|
||||
THREAD,
|
||||
THREAD_FOLLOW_BUTTON,
|
||||
THREAD_OPTIONS,
|
||||
|
||||
// USER_PROFILE,
|
||||
USER_PROFILE,
|
||||
SNACK_BAR,
|
||||
};
|
||||
|
||||
export const MODAL_SCREENS_WITHOUT_BACK = [
|
||||
BROWSE_CHANNELS,
|
||||
CHANNEL_DETAILS,
|
||||
CREATE_DIRECT_MESSAGE,
|
||||
CREATE_TEAM,
|
||||
CUSTOM_STATUS,
|
||||
EMOJI_PICKER,
|
||||
EDIT_POST,
|
||||
EDIT_PROFILE,
|
||||
EDIT_SERVER,
|
||||
GALLERY,
|
||||
FIND_CHANNELS,
|
||||
PERMALINK,
|
||||
REACTIONS,
|
||||
SAVED_POSTS,
|
||||
];
|
||||
|
||||
export const NOT_READY = [
|
||||
CHANNEL_ADD_PEOPLE,
|
||||
CHANNEL_DETAILS,
|
||||
CREATE_TEAM,
|
||||
INTEGRATION_SELECTOR,
|
||||
INTERACTIVE_DIALOG,
|
||||
USER_PROFILE,
|
||||
];
|
||||
|
||||
@@ -37,6 +37,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
marginBottom: 12,
|
||||
color: changeOpacity(theme.centerChannelColor, 0.5),
|
||||
marginLeft: 16,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
block: {
|
||||
borderBottomColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
@@ -95,7 +96,7 @@ const CustomStatusSuggestions = ({
|
||||
<View testID='custom_status.suggestions'>
|
||||
<FormattedText
|
||||
id={t('custom_status.suggestions.title')}
|
||||
defaultMessage='SUGGESTIONS'
|
||||
defaultMessage='Suggestions'
|
||||
style={style.title}
|
||||
/>
|
||||
<View style={style.block}>{customStatusSuggestions}</View>
|
||||
|
||||
@@ -17,6 +17,27 @@ type Props = {
|
||||
theme: Theme;
|
||||
}
|
||||
|
||||
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
return {
|
||||
separator: {
|
||||
marginTop: 32,
|
||||
},
|
||||
title: {
|
||||
fontSize: 17,
|
||||
marginBottom: 12,
|
||||
color: changeOpacity(theme.centerChannelColor, 0.5),
|
||||
marginLeft: 16,
|
||||
textTransform: 'uppercase',
|
||||
},
|
||||
block: {
|
||||
borderBottomColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
borderBottomWidth: 1,
|
||||
borderTopColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
borderTopWidth: 1,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
const RecentCustomStatuses = ({isExpirySupported, onHandleClear, onHandleSuggestionClick, recentCustomStatuses, theme}: Props) => {
|
||||
const style = getStyleSheet(theme);
|
||||
|
||||
@@ -30,7 +51,7 @@ const RecentCustomStatuses = ({isExpirySupported, onHandleClear, onHandleSuggest
|
||||
<View testID='custom_status.recents'>
|
||||
<FormattedText
|
||||
id={t('custom_status.suggestions.recent_title')}
|
||||
defaultMessage='RECENT'
|
||||
defaultMessage='Recent'
|
||||
style={style.title}
|
||||
/>
|
||||
<View style={style.block}>
|
||||
@@ -54,24 +75,4 @@ const RecentCustomStatuses = ({isExpirySupported, onHandleClear, onHandleSuggest
|
||||
);
|
||||
};
|
||||
|
||||
const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
return {
|
||||
separator: {
|
||||
marginTop: 32,
|
||||
},
|
||||
title: {
|
||||
fontSize: 17,
|
||||
marginBottom: 12,
|
||||
color: changeOpacity(theme.centerChannelColor, 0.5),
|
||||
marginLeft: 16,
|
||||
},
|
||||
block: {
|
||||
borderBottomColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
borderBottomWidth: 1,
|
||||
borderTopColor: changeOpacity(theme.centerChannelColor, 0.1),
|
||||
borderTopWidth: 1,
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export default RecentCustomStatuses;
|
||||
|
||||
@@ -19,6 +19,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
|
||||
},
|
||||
heading: {
|
||||
color: changeOpacity(theme.centerChannelColor, 0.64),
|
||||
textTransform: 'uppercase',
|
||||
...typography('Heading', 75, 'SemiBold'),
|
||||
},
|
||||
}));
|
||||
|
||||
@@ -26,11 +26,11 @@ type Props = {
|
||||
const sectionNames = {
|
||||
unreads: {
|
||||
id: t('mobile.channel_list.unreads'),
|
||||
defaultMessage: 'UNREADS',
|
||||
defaultMessage: 'Unreads',
|
||||
},
|
||||
recent: {
|
||||
id: t('mobile.channel_list.recent'),
|
||||
defaultMessage: 'RECENT',
|
||||
defaultMessage: 'Recent',
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ const Thread = ({author, channel, post, teammateNameDisplay, testID, thread}: Pr
|
||||
|
||||
const showThreadOptions = useCallback(() => {
|
||||
const passProps = {thread};
|
||||
const title = isTablet ? intl.formatMessage({id: 'thread.options.title', defaultMessage: 'THREAD ACTIONS'}) : '';
|
||||
const title = isTablet ? intl.formatMessage({id: 'thread.options.title', defaultMessage: 'Thread Actions'}) : '';
|
||||
|
||||
if (isTablet) {
|
||||
showModal(Screens.THREAD_OPTIONS, title, passProps, bottomSheetModalOptions(theme, 'close-thread-options'));
|
||||
|
||||
@@ -57,7 +57,7 @@ Navigation.setLazyComponentRegistrator((screenName) => {
|
||||
case Screens.ABOUT:
|
||||
screen = withServerDatabase(require('@screens/about').default);
|
||||
break;
|
||||
case Screens.APP_FORM:
|
||||
case Screens.APPS_FORM:
|
||||
screen = withServerDatabase(require('@screens/apps_form').default);
|
||||
break;
|
||||
case Screens.BOTTOM_SHEET:
|
||||
|
||||
@@ -11,6 +11,7 @@ import tinyColor from 'tinycolor2';
|
||||
import CompassIcon from '@components/compass_icon';
|
||||
import {Device, Events, Screens} from '@constants';
|
||||
import NavigationConstants from '@constants/navigation';
|
||||
import {NOT_READY} from '@constants/screens';
|
||||
import {getDefaultThemeByAppearance} from '@context/theme';
|
||||
import EphemeralStore from '@store/ephemeral_store';
|
||||
import {LaunchProps, LaunchType} from '@typings/launch';
|
||||
@@ -168,16 +169,16 @@ function getThemeFromState(): Theme {
|
||||
// crashes when trying to load a screen that does
|
||||
// NOT exists, this should be removed for GA
|
||||
function isScreenRegistered(screen: string) {
|
||||
const exists = Object.values(Screens).includes(screen);
|
||||
|
||||
if (!exists) {
|
||||
const notImplemented = NOT_READY.includes(screen) || !Object.values(Screens).includes(screen);
|
||||
if (notImplemented) {
|
||||
Alert.alert(
|
||||
'Temporary error ' + screen,
|
||||
'The functionality you are trying to use has not been implemented yet',
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
return exists;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function resetToHome(passProps: LaunchProps = {launchType: LaunchType.Normal}) {
|
||||
@@ -686,7 +687,7 @@ export async function dismissBottomSheet(alternativeScreen = Screens.BOTTOM_SHEE
|
||||
|
||||
export const showAppForm = async (form: AppForm, call: AppCallRequest) => {
|
||||
const passProps = {form, call};
|
||||
showModal(Screens.APP_FORM, form.title || '', passProps);
|
||||
showModal(Screens.APPS_FORM, form.title || '', passProps);
|
||||
};
|
||||
|
||||
export async function findChannels(title: string, theme: Theme) {
|
||||
|
||||
@@ -41,6 +41,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {
|
||||
},
|
||||
listHeaderText: {
|
||||
color: changeOpacity(theme.centerChannelColor, 0.56),
|
||||
textTransform: 'uppercase',
|
||||
...typography('Body', 75, 'SemiBold'),
|
||||
},
|
||||
};
|
||||
@@ -118,7 +119,7 @@ const ThreadOptions = ({
|
||||
<View style={style.listHeader}>
|
||||
<FormattedText
|
||||
id='global_threads.options.title'
|
||||
defaultMessage={'THREAD ACTIONS'}
|
||||
defaultMessage={'Thread actions'}
|
||||
style={style.listHeaderText}
|
||||
/>
|
||||
</View>
|
||||
|
||||
@@ -163,8 +163,8 @@
|
||||
"custom_status.suggestions.on_a_vacation": "On a vacation",
|
||||
"custom_status.suggestions.out_for_lunch": "Out for lunch",
|
||||
"custom_status.suggestions.out_sick": "Out sick",
|
||||
"custom_status.suggestions.recent_title": "RECENT",
|
||||
"custom_status.suggestions.title": "SUGGESTIONS",
|
||||
"custom_status.suggestions.recent_title": "Recent",
|
||||
"custom_status.suggestions.title": "Suggestions",
|
||||
"custom_status.suggestions.working_from_home": "Working from home",
|
||||
"date_separator.today": "Today",
|
||||
"date_separator.yesterday": "Yesterday",
|
||||
@@ -228,7 +228,7 @@
|
||||
"global_threads.markAllRead.title": "Are you sure you want to mark all threads as read?",
|
||||
"global_threads.options.mark_as_read": "Mark as Read",
|
||||
"global_threads.options.open_in_channel": "Open in Channel",
|
||||
"global_threads.options.title": "THREAD ACTIONS",
|
||||
"global_threads.options.title": "Thread Actions",
|
||||
"global_threads.unreads": "Unread Threads",
|
||||
"home.header.plus_menu": "Options",
|
||||
"interactive_dialog.submit": "Submit",
|
||||
@@ -292,8 +292,8 @@
|
||||
"mobile.camera_photo_permission_denied_title": "{applicationName} would like to access your camera",
|
||||
"mobile.channel_info.alertNo": "No",
|
||||
"mobile.channel_info.alertYes": "Yes",
|
||||
"mobile.channel_list.recent": "RECENT",
|
||||
"mobile.channel_list.unreads": "UNREADS",
|
||||
"mobile.channel_list.recent": "Recent",
|
||||
"mobile.channel_list.unreads": "Unreads",
|
||||
"mobile.commands.error_title": "Error Executing Command",
|
||||
"mobile.components.select_server_view.connect": "Connect",
|
||||
"mobile.components.select_server_view.connecting": "Connecting",
|
||||
@@ -387,7 +387,7 @@
|
||||
"mobile.oauth.switch_to_browser.title": "Redirecting...",
|
||||
"mobile.oauth.try_again": "Try again",
|
||||
"mobile.open_gm.error": "We couldn't open a group message with those users. Please check your connection and try again.",
|
||||
"mobile.participants.header": "THREAD PARTICIPANTS",
|
||||
"mobile.participants.header": "Thread Participants",
|
||||
"mobile.permission_denied_dismiss": "Don't Allow",
|
||||
"mobile.permission_denied_retry": "Settings",
|
||||
"mobile.post_info.add_reaction": "Add Reaction",
|
||||
@@ -512,11 +512,11 @@
|
||||
"post_body.check_for_out_of_channel_mentions.message.one": "was mentioned but is not in the channel. Would you like to ",
|
||||
"post_body.commentedOn": "Commented on {name}{apostrophe} message: ",
|
||||
"post_body.deleted": "(message deleted)",
|
||||
"post_info.auto_responder": "AUTOMATIC REPLY",
|
||||
"post_info.bot": "BOT",
|
||||
"post_info.auto_responder": "Automatic Reply",
|
||||
"post_info.bot": "Bot",
|
||||
"post_info.del": "Delete",
|
||||
"post_info.edit": "Edit",
|
||||
"post_info.guest": "GUEST",
|
||||
"post_info.guest": "Guest",
|
||||
"post_info.system": "System",
|
||||
"post_message_view.edited": "(edited)",
|
||||
"post.options.title": "Options",
|
||||
@@ -577,7 +577,7 @@
|
||||
"thread.header.thread": "Thread",
|
||||
"thread.header.thread_in": "in {channelName}",
|
||||
"thread.noReplies": "No replies yet",
|
||||
"thread.options.title": "THREAD ACTIONS",
|
||||
"thread.options.title": "Thread Actions",
|
||||
"thread.repliesCount": "{repliesCount, number} {repliesCount, plural, one {reply} other {replies}}",
|
||||
"threads": "Threads",
|
||||
"threads.deleted": "Original Message Deleted",
|
||||
|
||||
Reference in New Issue
Block a user