Chore: Evaluate helpers and utils - Typescript (#4146)
This commit is contained in:
parent
e212a3c946
commit
614d9afe65
|
@ -5,7 +5,7 @@ import { connect } from 'react-redux';
|
||||||
|
|
||||||
import { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes';
|
import { SetUsernameStackParamList, StackParamList } from './definitions/navigationTypes';
|
||||||
import Navigation from './lib/navigation/appNavigation';
|
import Navigation from './lib/navigation/appNavigation';
|
||||||
import { defaultHeader, getActiveRouteName, navigationTheme } from './utils/navigation';
|
import { defaultHeader, getActiveRouteName, navigationTheme } from './lib/methods/helpers/navigation';
|
||||||
import { RootEnum } from './definitions';
|
import { RootEnum } from './definitions';
|
||||||
// Stacks
|
// Stacks
|
||||||
import AuthLoadingView from './views/AuthLoadingView';
|
import AuthLoadingView from './views/AuthLoadingView';
|
||||||
|
@ -15,7 +15,7 @@ import OutsideStack from './stacks/OutsideStack';
|
||||||
import InsideStack from './stacks/InsideStack';
|
import InsideStack from './stacks/InsideStack';
|
||||||
import MasterDetailStack from './stacks/MasterDetailStack';
|
import MasterDetailStack from './stacks/MasterDetailStack';
|
||||||
import { ThemeContext } from './theme';
|
import { ThemeContext } from './theme';
|
||||||
import { setCurrentScreen } from './utils/log';
|
import { setCurrentScreen } from './lib/methods/helpers/log';
|
||||||
|
|
||||||
// SetUsernameStack
|
// SetUsernameStack
|
||||||
const SetUsername = createStackNavigator<SetUsernameStackParamList>();
|
const SetUsername = createStackNavigator<SetUsernameStackParamList>();
|
||||||
|
|
|
@ -8,7 +8,7 @@ import BottomSheet, { BottomSheetBackdrop } from '@gorhom/bottom-sheet';
|
||||||
|
|
||||||
import { useDimensions, useOrientation } from '../../dimensions';
|
import { useDimensions, useOrientation } from '../../dimensions';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { isIOS, isTablet } from '../../utils/deviceInfo';
|
import { isIOS, isTablet } from '../../lib/methods/helpers';
|
||||||
import { Handle } from './Handle';
|
import { Handle } from './Handle';
|
||||||
import { TActionSheetOptions } from './Provider';
|
import { TActionSheetOptions } from './Provider';
|
||||||
import BottomSheetContent from './BottomSheetContent';
|
import BottomSheetContent from './BottomSheetContent';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { TouchableOpacity } from 'react-native';
|
import { TouchableOpacity } from 'react-native';
|
||||||
|
|
||||||
import { isAndroid } from '../../utils/deviceInfo';
|
import { isAndroid } from '../../lib/methods/helpers';
|
||||||
import Touch from '../../utils/touch';
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
|
|
||||||
// Taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet#touchables
|
// Taken from https://github.com/rgommezz/react-native-scroll-bottom-sheet#touchables
|
||||||
export const Button: typeof React.Component = isAndroid ? Touch : TouchableOpacity;
|
export const Button: typeof React.Component = isAndroid ? Touch : TouchableOpacity;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
|
||||||
|
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import sharedStyles from '../views/Styles';
|
import sharedStyles from '../views/Styles';
|
||||||
import { getReadableVersion } from '../utils/deviceInfo';
|
import { getReadableVersion } from '../lib/methods/helpers';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import { TSupportedThemes } from '../theme';
|
import { TSupportedThemes } from '../theme';
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@ import FastImage from 'react-native-fast-image';
|
||||||
import Touchable from 'react-native-platform-touchable';
|
import Touchable from 'react-native-platform-touchable';
|
||||||
import { settings as RocketChatSettings } from '@rocket.chat/sdk';
|
import { settings as RocketChatSettings } from '@rocket.chat/sdk';
|
||||||
|
|
||||||
import { avatarURL } from '../../utils/avatar';
|
import { getAvatarURL } from '../../lib/methods/helpers/getAvatarUrl';
|
||||||
import { SubscriptionType } from '../../definitions/ISubscription';
|
import { SubscriptionType } from '../../definitions';
|
||||||
import Emoji from '../markdown/Emoji';
|
import Emoji from '../markdown/Emoji';
|
||||||
import { IAvatar } from './interfaces';
|
import { IAvatar } from './interfaces';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
@ -58,7 +58,7 @@ const Avatar = React.memo(
|
||||||
} else {
|
} else {
|
||||||
let uri = avatar;
|
let uri = avatar;
|
||||||
if (!isStatic) {
|
if (!isStatic) {
|
||||||
uri = avatarURL({
|
uri = getAvatarURL({
|
||||||
type,
|
type,
|
||||||
text,
|
text,
|
||||||
size,
|
size,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, View, ViewStyle } from 'react-native';
|
import { Text, View, ViewStyle } from 'react-native';
|
||||||
|
|
||||||
import Touch from '../../utils/touch';
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
import Avatar from '../Avatar';
|
import Avatar from '../Avatar';
|
||||||
import RoomTypeIcon from '../RoomTypeIcon';
|
import RoomTypeIcon from '../RoomTypeIcon';
|
||||||
import styles, { ROW_HEIGHT } from './styles';
|
import styles, { ROW_HEIGHT } from './styles';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FlatList, Text, TouchableOpacity } from 'react-native';
|
import { FlatList, Text, TouchableOpacity } from 'react-native';
|
||||||
|
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import CustomEmoji from './CustomEmoji';
|
import CustomEmoji from './CustomEmoji';
|
||||||
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
||||||
import { IEmoji, IEmojiCategory } from '../../definitions/IEmoji';
|
import { IEmoji, IEmojiCategory } from '../../definitions/IEmoji';
|
||||||
|
|
||||||
const EMOJI_SIZE = 50;
|
const EMOJI_SIZE = 50;
|
||||||
|
|
|
@ -14,8 +14,8 @@ import categories from './categories';
|
||||||
import database from '../../lib/database';
|
import database from '../../lib/database';
|
||||||
import { emojisByCategory } from './emojis';
|
import { emojisByCategory } from './emojis';
|
||||||
import protectedFunction from '../../lib/methods/helpers/protectedFunction';
|
import protectedFunction from '../../lib/methods/helpers/protectedFunction';
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import log from '../../utils/log';
|
import log from '../../lib/methods/helpers/log';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { TSupportedThemes, withTheme } from '../../theme';
|
import { TSupportedThemes, withTheme } from '../../theme';
|
||||||
import { IEmoji, TGetCustomEmoji, IApplicationState, ICustomEmojis, TFrequentlyUsedEmojiModel } from '../../definitions';
|
import { IEmoji, TGetCustomEmoji, IApplicationState, ICustomEmojis, TFrequentlyUsedEmojiModel } from '../../definitions';
|
||||||
|
|
|
@ -3,12 +3,12 @@ import { ScrollView, ScrollViewProps, StyleSheet, View } from 'react-native';
|
||||||
|
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import sharedStyles from '../views/Styles';
|
import sharedStyles from '../views/Styles';
|
||||||
import scrollPersistTaps from '../utils/scrollPersistTaps';
|
import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps';
|
||||||
import KeyboardView from './KeyboardView';
|
import KeyboardView from './KeyboardView';
|
||||||
import { useTheme } from '../theme';
|
import { useTheme } from '../theme';
|
||||||
import StatusBar from './StatusBar';
|
import StatusBar from './StatusBar';
|
||||||
import AppVersion from './AppVersion';
|
import AppVersion from './AppVersion';
|
||||||
import { isTablet } from '../utils/deviceInfo';
|
import { isTablet } from '../lib/methods/helpers';
|
||||||
import SafeAreaView from './SafeAreaView';
|
import SafeAreaView from './SafeAreaView';
|
||||||
|
|
||||||
interface IFormContainer extends ScrollViewProps {
|
interface IFormContainer extends ScrollViewProps {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { SafeAreaView } from 'react-native-safe-area-context';
|
||||||
import { StyleSheet, View } from 'react-native';
|
import { StyleSheet, View } from 'react-native';
|
||||||
|
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { themedHeader } from '../../utils/navigation';
|
import { themedHeader } from '../../lib/methods/helpers/navigation';
|
||||||
import { isIOS, isTablet } from '../../utils/deviceInfo';
|
import { isIOS, isTablet } from '../../lib/methods/helpers';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
|
||||||
export const headerHeight = isIOS ? 50 : 56;
|
export const headerHeight = isIOS ? 50 : 56;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../../lib/methods/helpers';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import Container from './HeaderButtonContainer';
|
import Container from './HeaderButtonContainer';
|
||||||
import Item from './HeaderButtonItem';
|
import Item from './HeaderButtonItem';
|
||||||
|
|
|
@ -11,7 +11,7 @@ import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { ROW_HEIGHT } from '../RoomItem';
|
import { ROW_HEIGHT } from '../RoomItem';
|
||||||
import { goRoom } from '../../utils/goRoom';
|
import { goRoom } from '../../lib/methods/helpers/goRoom';
|
||||||
import Navigation from '../../lib/navigation/appNavigation';
|
import Navigation from '../../lib/navigation/appNavigation';
|
||||||
import { useOrientation } from '../../dimensions';
|
import { useOrientation } from '../../dimensions';
|
||||||
import { IApplicationState, ISubscription, SubscriptionType } from '../../definitions';
|
import { IApplicationState, ISubscription, SubscriptionType } from '../../definitions';
|
||||||
|
|
|
@ -4,9 +4,9 @@ import { connect } from 'react-redux';
|
||||||
import { dequal } from 'dequal';
|
import { dequal } from 'dequal';
|
||||||
|
|
||||||
import NotifierComponent, { INotifierComponent } from './NotifierComponent';
|
import NotifierComponent, { INotifierComponent } from './NotifierComponent';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import Navigation from '../../lib/navigation/appNavigation';
|
import Navigation from '../../lib/navigation/appNavigation';
|
||||||
import { getActiveRoute } from '../../utils/navigation';
|
import { getActiveRoute } from '../../lib/methods/helpers/navigation';
|
||||||
import { IApplicationState } from '../../definitions';
|
import { IApplicationState } from '../../definitions';
|
||||||
import { IRoom } from '../../reducers/room';
|
import { IRoom } from '../../reducers/room';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
import { KeyboardAwareScrollView, KeyboardAwareScrollViewProps } from '@codler/react-native-keyboard-aware-scroll-view';
|
||||||
|
|
||||||
import scrollPersistTaps from '../utils/scrollPersistTaps';
|
import scrollPersistTaps from '../lib/methods/helpers/scrollPersistTaps';
|
||||||
|
|
||||||
interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
|
interface IKeyboardViewProps extends KeyboardAwareScrollViewProps {
|
||||||
keyboardVerticalOffset?: number;
|
keyboardVerticalOffset?: number;
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { ScrollView, StyleSheet } from 'react-native';
|
import { ScrollView, StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { withTheme } from '../../theme';
|
import { withTheme } from '../../theme';
|
||||||
import scrollPersistTaps from '../../utils/scrollPersistTaps';
|
import scrollPersistTaps from '../../lib/methods/helpers/scrollPersistTaps';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { I18nManager, StyleProp, StyleSheet, Text, TextStyle, View } from 'react-native';
|
import { I18nManager, StyleProp, StyleSheet, Text, TextStyle, View } from 'react-native';
|
||||||
|
|
||||||
import Touch from '../../utils/touch';
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { TSupportedThemes, useTheme } from '../../theme';
|
import { TSupportedThemes, useTheme } from '../../theme';
|
||||||
|
|
|
@ -10,10 +10,10 @@ import sharedStyles from '../views/Styles';
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import Button from './Button';
|
import Button from './Button';
|
||||||
import OrSeparator from './OrSeparator';
|
import OrSeparator from './OrSeparator';
|
||||||
import Touch from '../utils/touch';
|
import Touch from '../lib/methods/helpers/touch';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import random from '../utils/random';
|
import { random } from '../lib/methods/helpers';
|
||||||
import { events, logEvent } from '../utils/log';
|
import { events, logEvent } from '../lib/methods/helpers/log';
|
||||||
import { CustomIcon, TIconsName } from './CustomIcon';
|
import { CustomIcon, TIconsName } from './CustomIcon';
|
||||||
import { IServices } from '../selectors/login';
|
import { IServices } from '../selectors/login';
|
||||||
import { OutsideParamList } from '../stacks/types';
|
import { OutsideParamList } from '../stacks/types';
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { FlatList, StyleSheet, Text, View } from 'react-native';
|
||||||
import { TSupportedThemes, useTheme } from '../../theme';
|
import { TSupportedThemes, useTheme } from '../../theme';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
||||||
import database from '../../lib/database';
|
import database from '../../lib/database';
|
||||||
import { Button } from '../ActionSheet';
|
import { Button } from '../ActionSheet';
|
||||||
|
|
|
@ -6,17 +6,18 @@ import moment from 'moment';
|
||||||
|
|
||||||
import database from '../../lib/database';
|
import database from '../../lib/database';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import log, { logEvent } from '../../utils/log';
|
import log, { logEvent } from '../../lib/methods/helpers/log';
|
||||||
import Navigation from '../../lib/navigation/appNavigation';
|
import Navigation from '../../lib/navigation/appNavigation';
|
||||||
import { getMessageTranslation } from '../message/utils';
|
import { getMessageTranslation } from '../message/utils';
|
||||||
import { LISTENER } from '../Toast';
|
import { LISTENER } from '../Toast';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import { showConfirmationAlert } from '../../utils/info';
|
import { showConfirmationAlert } from '../../lib/methods/helpers/info';
|
||||||
import { TActionSheetOptionsItem, useActionSheet } from '../ActionSheet';
|
import { TActionSheetOptionsItem, useActionSheet } from '../ActionSheet';
|
||||||
import Header, { HEADER_HEIGHT, IHeader } from './Header';
|
import Header, { HEADER_HEIGHT, IHeader } from './Header';
|
||||||
import events from '../../utils/log/events';
|
import events from '../../lib/methods/helpers/log/events';
|
||||||
import { IApplicationState, ILoggedUser, TAnyMessageModel, TSubscriptionModel } from '../../definitions';
|
import { IApplicationState, ILoggedUser, TAnyMessageModel, TSubscriptionModel } from '../../definitions';
|
||||||
import { getPermalinkMessage, hasPermission } from '../../lib/methods';
|
import { getPermalinkMessage } from '../../lib/methods';
|
||||||
|
import { hasPermission } from '../../lib/methods/helpers';
|
||||||
import { Services } from '../../lib/services';
|
import { Services } from '../../lib/services';
|
||||||
|
|
||||||
export interface IMessageActionsProps {
|
export interface IMessageActionsProps {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
|
|
||||||
import { IEmoji } from '../../../definitions/IEmoji';
|
import { IEmoji } from '../../../definitions/IEmoji';
|
||||||
import shortnameToUnicode from '../../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import CustomEmoji from '../../EmojiPicker/CustomEmoji';
|
import CustomEmoji from '../../EmojiPicker/CustomEmoji';
|
||||||
import MessageboxContext from '../Context';
|
import MessageboxContext from '../Context';
|
||||||
import styles from '../styles';
|
import styles from '../styles';
|
||||||
|
|
|
@ -9,7 +9,7 @@ import styles from './styles';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { events, logEvent } from '../../utils/log';
|
import { events, logEvent } from '../../lib/methods/helpers/log';
|
||||||
import { TSupportedThemes } from '../../theme';
|
import { TSupportedThemes } from '../../theme';
|
||||||
|
|
||||||
interface IMessageBoxRecordAudioProps {
|
interface IMessageBoxRecordAudioProps {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ImageOrVideo } from 'react-native-image-crop-picker';
|
import { ImageOrVideo } from 'react-native-image-crop-picker';
|
||||||
|
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../../lib/methods/helpers';
|
||||||
|
|
||||||
const regex = new RegExp(/\.[^/.]+$/); // Check from last '.' of the string
|
const regex = new RegExp(/\.[^/.]+$/); // Check from last '.' of the string
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,10 @@ import { userTyping as userTypingAction } from '../../actions/room';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import database from '../../lib/database';
|
import database from '../../lib/database';
|
||||||
import { emojis } from '../EmojiPicker/emojis';
|
import { emojis } from '../EmojiPicker/emojis';
|
||||||
import log, { events, logEvent } from '../../utils/log';
|
import log, { events, logEvent } from '../../lib/methods/helpers/log';
|
||||||
import RecordAudio from './RecordAudio';
|
import RecordAudio from './RecordAudio';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import ReplyPreview from './ReplyPreview';
|
import ReplyPreview from './ReplyPreview';
|
||||||
import debounce from '../../utils/debounce';
|
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// eslint-disable-next-line import/extensions,import/no-unresolved
|
// eslint-disable-next-line import/extensions,import/no-unresolved
|
||||||
|
@ -26,9 +25,8 @@ import LeftButtons from './LeftButtons';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
// eslint-disable-next-line import/extensions,import/no-unresolved
|
// eslint-disable-next-line import/extensions,import/no-unresolved
|
||||||
import RightButtons from './RightButtons';
|
import RightButtons from './RightButtons';
|
||||||
import { isAndroid, isTablet } from '../../utils/deviceInfo';
|
import { canUploadFile } from '../../lib/methods/helpers/media';
|
||||||
import { canUploadFile } from '../../utils/media';
|
import EventEmiter from '../../lib/methods/helpers/events';
|
||||||
import EventEmiter from '../../utils/events';
|
|
||||||
import { KEY_COMMAND, handleCommandShowUpload, handleCommandSubmit, handleCommandTyping } from '../../commands';
|
import { KEY_COMMAND, handleCommandShowUpload, handleCommandSubmit, handleCommandTyping } from '../../commands';
|
||||||
import getMentionRegexp from './getMentionRegexp';
|
import getMentionRegexp from './getMentionRegexp';
|
||||||
import Mentions from './Mentions';
|
import Mentions from './Mentions';
|
||||||
|
@ -47,11 +45,11 @@ import Navigation from '../../lib/navigation/appNavigation';
|
||||||
import { withActionSheet } from '../ActionSheet';
|
import { withActionSheet } from '../ActionSheet';
|
||||||
import { sanitizeLikeString } from '../../lib/database/utils';
|
import { sanitizeLikeString } from '../../lib/database/utils';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { IMessage } from '../../definitions/IMessage';
|
|
||||||
import { forceJpgExtension } from './forceJpgExtension';
|
import { forceJpgExtension } from './forceJpgExtension';
|
||||||
import { IBaseScreen, IPreviewItem, IUser, TGetCustomEmoji, TSubscriptionModel, TThreadModel } from '../../definitions';
|
import { IBaseScreen, IPreviewItem, IUser, TGetCustomEmoji, TSubscriptionModel, TThreadModel, IMessage } from '../../definitions';
|
||||||
import { MasterDetailInsideStackParamList } from '../../stacks/MasterDetailStack/types';
|
import { MasterDetailInsideStackParamList } from '../../stacks/MasterDetailStack/types';
|
||||||
import { getPermalinkMessage, hasPermission, search, sendFileMessage } from '../../lib/methods';
|
import { getPermalinkMessage, search, sendFileMessage } from '../../lib/methods';
|
||||||
|
import { hasPermission, debounce, isAndroid, isTablet } from '../../lib/methods/helpers';
|
||||||
import { Services } from '../../lib/services';
|
import { Services } from '../../lib/services';
|
||||||
import { TSupportedThemes } from '../../theme';
|
import { TSupportedThemes } from '../../theme';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { StyleSheet } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../../lib/methods/helpers';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
|
|
||||||
const MENTION_HEIGHT = 50;
|
const MENTION_HEIGHT = 50;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import database from '../lib/database';
|
||||||
import protectedFunction from '../lib/methods/helpers/protectedFunction';
|
import protectedFunction from '../lib/methods/helpers/protectedFunction';
|
||||||
import { useActionSheet } from './ActionSheet';
|
import { useActionSheet } from './ActionSheet';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import log from '../utils/log';
|
import log from '../lib/methods/helpers/log';
|
||||||
import { TMessageModel } from '../definitions';
|
import { TMessageModel } from '../definitions';
|
||||||
import { resendMessage } from '../lib/methods';
|
import { resendMessage } from '../lib/methods';
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Text } from 'react-native';
|
||||||
|
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { themes } from '../../../lib/constants';
|
import { themes } from '../../../lib/constants';
|
||||||
import Touch from '../../../utils/touch';
|
import Touch from '../../../lib/methods/helpers/touch';
|
||||||
import { CustomIcon, TIconsName } from '../../CustomIcon';
|
import { CustomIcon, TIconsName } from '../../CustomIcon';
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||||
import { Grid } from 'react-native-easy-grid';
|
import { Grid } from 'react-native-easy-grid';
|
||||||
|
|
||||||
import { themes } from '../../../lib/constants';
|
import { themes } from '../../../lib/constants';
|
||||||
import { resetAttempts } from '../../../utils/localAuthentication';
|
import { resetAttempts } from '../../../lib/methods/helpers/localAuthentication';
|
||||||
import { TYPE } from '../constants';
|
import { TYPE } from '../constants';
|
||||||
import { getDiff, getLockedUntil } from '../utils';
|
import { getDiff, getLockedUntil } from '../utils';
|
||||||
import I18n from '../../../i18n';
|
import I18n from '../../../i18n';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Base, { IBase } from './Base';
|
||||||
import Locked from './Base/Locked';
|
import Locked from './Base/Locked';
|
||||||
import { TYPE } from './constants';
|
import { TYPE } from './constants';
|
||||||
import { ATTEMPTS_KEY, LOCKED_OUT_TIMER_KEY, MAX_ATTEMPTS, PASSCODE_KEY } from '../../lib/constants';
|
import { ATTEMPTS_KEY, LOCKED_OUT_TIMER_KEY, MAX_ATTEMPTS, PASSCODE_KEY } from '../../lib/constants';
|
||||||
import { biometryAuth, resetAttempts } from '../../utils/localAuthentication';
|
import { biometryAuth, resetAttempts } from '../../lib/methods/helpers/localAuthentication';
|
||||||
import { getDiff, getLockedUntil } from './utils';
|
import { getDiff, getLockedUntil } from './utils';
|
||||||
import { useUserPreferences } from '../../lib/methods/userPreferences';
|
import { useUserPreferences } from '../../lib/methods/userPreferences';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
PanGestureHandlerEventPayload
|
PanGestureHandlerEventPayload
|
||||||
} from 'react-native-gesture-handler';
|
} from 'react-native-gesture-handler';
|
||||||
|
|
||||||
import Touch from '../../utils/touch';
|
import Touch from '../../lib/methods/helpers/touch';
|
||||||
import { ACTION_WIDTH, LONG_SWIPE, SMALL_SWIPE } from './styles';
|
import { ACTION_WIDTH, LONG_SWIPE, SMALL_SWIPE } from './styles';
|
||||||
import { LeftActions, RightActions } from './Actions';
|
import { LeftActions, RightActions } from './Actions';
|
||||||
import { ITouchableProps } from './interfaces';
|
import { ITouchableProps } from './interfaces';
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Text } from 'react-native';
|
||||||
|
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { capitalize } from '../../utils/room';
|
import { capitalize } from '../../lib/methods/helpers/room';
|
||||||
import { IUpdatedAtProps } from './interfaces';
|
import { IUpdatedAtProps } from './interfaces';
|
||||||
|
|
||||||
const UpdatedAt = React.memo(({ date, theme, hideUnreadStatus, alert }: IUpdatedAtProps) => {
|
const UpdatedAt = React.memo(({ date, theme, hideUnreadStatus, alert }: IUpdatedAtProps) => {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { connect } from 'react-redux';
|
||||||
|
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import { ROW_HEIGHT, ROW_HEIGHT_CONDENSED } from './styles';
|
import { ROW_HEIGHT, ROW_HEIGHT_CONDENSED } from './styles';
|
||||||
import { formatDate } from '../../utils/room';
|
import { formatDate } from '../../lib/methods/helpers/room';
|
||||||
import RoomItem from './RoomItem';
|
import RoomItem from './RoomItem';
|
||||||
import { ISubscription, TUserStatus } from '../../definitions';
|
import { ISubscription, TUserStatus } from '../../definitions';
|
||||||
import { IRoomItemContainerProps } from './interfaces';
|
import { IRoomItemContainerProps } from './interfaces';
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { useTheme } from '../theme';
|
||||||
import sharedStyles from '../views/Styles';
|
import sharedStyles from '../views/Styles';
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import TextInput from './TextInput';
|
import TextInput from './TextInput';
|
||||||
import { isIOS, isTablet } from '../utils/deviceInfo';
|
import { isIOS, isTablet } from '../lib/methods/helpers';
|
||||||
import { useOrientation } from '../dimensions';
|
import { useOrientation } from '../dimensions';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { IServerInfo } from '../../definitions';
|
||||||
import Check from '../Check';
|
import Check from '../Check';
|
||||||
import styles, { ROW_HEIGHT } from './styles';
|
import styles, { ROW_HEIGHT } from './styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../../lib/methods/helpers';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
|
||||||
export { ROW_HEIGHT };
|
export { ROW_HEIGHT };
|
||||||
|
|
|
@ -4,7 +4,7 @@ import EasyToast from 'react-native-easy-toast';
|
||||||
|
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import sharedStyles from '../views/Styles';
|
import sharedStyles from '../views/Styles';
|
||||||
import EventEmitter from '../utils/events';
|
import EventEmitter from '../lib/methods/helpers/events';
|
||||||
import { TSupportedThemes, withTheme } from '../theme';
|
import { TSupportedThemes, withTheme } from '../theme';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { connect } from 'react-redux';
|
||||||
|
|
||||||
import FormTextInput from '../TextInput/FormTextInput';
|
import FormTextInput from '../TextInput/FormTextInput';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import Button from '../Button';
|
import Button from '../Button';
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { textParser } from './utils';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { isAndroid } from '../../utils/deviceInfo';
|
import { isAndroid } from '../../lib/methods/helpers';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import ActivityIndicator from '../ActivityIndicator';
|
import ActivityIndicator from '../ActivityIndicator';
|
||||||
import { IDatePicker } from './interfaces';
|
import { IDatePicker } from './interfaces';
|
||||||
|
|
|
@ -17,7 +17,7 @@ import FormTextInput from '../../TextInput/FormTextInput';
|
||||||
import { textParser } from '../utils';
|
import { textParser } from '../utils';
|
||||||
import { themes } from '../../../lib/constants';
|
import { themes } from '../../../lib/constants';
|
||||||
import I18n from '../../../i18n';
|
import I18n from '../../../i18n';
|
||||||
import { isIOS } from '../../../utils/deviceInfo';
|
import { isIOS } from '../../../lib/methods/helpers';
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
import { IText } from '../interfaces';
|
import { IText } from '../interfaces';
|
||||||
import Chips from './Chips';
|
import Chips from './Chips';
|
||||||
|
|
|
@ -6,7 +6,7 @@ import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { textParser } from './utils';
|
import { textParser } from './utils';
|
||||||
import { isAndroid, isIOS } from '../../utils/deviceInfo';
|
import { isAndroid, isIOS } from '../../lib/methods/helpers';
|
||||||
import ActivityIndicator from '../ActivityIndicator';
|
import ActivityIndicator from '../ActivityIndicator';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { IText, Option } from './interfaces';
|
import { IText, Option } from './interfaces';
|
||||||
|
|
|
@ -5,7 +5,7 @@ import Avatar from './Avatar';
|
||||||
import { CustomIcon, TIconsName } from './CustomIcon';
|
import { CustomIcon, TIconsName } from './CustomIcon';
|
||||||
import sharedStyles from '../views/Styles';
|
import sharedStyles from '../views/Styles';
|
||||||
import { themes } from '../lib/constants';
|
import { themes } from '../lib/constants';
|
||||||
import { isIOS } from '../utils/deviceInfo';
|
import { isIOS } from '../lib/methods/helpers';
|
||||||
import { TSupportedThemes } from '../theme';
|
import { TSupportedThemes } from '../theme';
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { StyleProp, Text, TextStyle } from 'react-native';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { events, logEvent } from '../../utils/log';
|
import { events, logEvent } from '../../lib/methods/helpers/log';
|
||||||
import { IUserMention } from './interfaces';
|
import { IUserMention } from './interfaces';
|
||||||
|
|
||||||
interface IAtMention {
|
interface IAtMention {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
|
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
|
|
|
@ -5,9 +5,9 @@ import Clipboard from '@react-native-clipboard/clipboard';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { LISTENER } from '../Toast';
|
import { LISTENER } from '../Toast';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import openLink from '../../utils/openLink';
|
import openLink from '../../lib/methods/helpers/openLink';
|
||||||
import { TOnLinkPress } from './interfaces';
|
import { TOnLinkPress } from './interfaces';
|
||||||
import { TSupportedThemes } from '../../theme';
|
import { TSupportedThemes } from '../../theme';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { Text, TextStyle } from 'react-native';
|
import { Text, TextStyle } from 'react-native';
|
||||||
import removeMarkdown from 'remove-markdown';
|
import removeMarkdown from 'remove-markdown';
|
||||||
|
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { formatText } from './formatText';
|
import { formatText } from './formatText';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
|
|
@ -16,7 +16,7 @@ import MarkdownTableRow from './TableRow';
|
||||||
import MarkdownTableCell from './TableCell';
|
import MarkdownTableCell from './TableCell';
|
||||||
import mergeTextNodes from './mergeTextNodes';
|
import mergeTextNodes from './mergeTextNodes';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { isValidURL } from '../../utils/url';
|
import { isValidURL } from '../../lib/methods/helpers/url';
|
||||||
import NewMarkdown from './new';
|
import NewMarkdown from './new';
|
||||||
import { formatText } from './formatText';
|
import { formatText } from './formatText';
|
||||||
import { IUserMention, IUserChannel, TOnLinkPress } from './interfaces';
|
import { IUserMention, IUserChannel, TOnLinkPress } from './interfaces';
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
import { Emoji as EmojiProps } from '@rocket.chat/message-parser';
|
import { Emoji as EmojiProps } from '@rocket.chat/message-parser';
|
||||||
|
|
||||||
import shortnameToUnicode from '../../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import { themes } from '../../../lib/constants';
|
import { themes } from '../../../lib/constants';
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
import styles from '../styles';
|
import styles from '../styles';
|
||||||
|
|
|
@ -7,8 +7,8 @@ import styles from '../styles';
|
||||||
import I18n from '../../../i18n';
|
import I18n from '../../../i18n';
|
||||||
import { LISTENER } from '../../Toast';
|
import { LISTENER } from '../../Toast';
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
import openLink from '../../../utils/openLink';
|
import openLink from '../../../lib/methods/helpers/openLink';
|
||||||
import EventEmitter from '../../../utils/events';
|
import EventEmitter from '../../../lib/methods/helpers/events';
|
||||||
import { themes } from '../../../lib/constants';
|
import { themes } from '../../../lib/constants';
|
||||||
import Strike from './Strike';
|
import Strike from './Strike';
|
||||||
import Italic from './Italic';
|
import Italic from './Italic';
|
||||||
|
|
|
@ -13,7 +13,7 @@ import MessageContext from './Context';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
import { IAttachment } from '../../definitions';
|
import { IAttachment } from '../../definitions';
|
||||||
import CollapsibleQuote from './Components/CollapsibleQuote';
|
import CollapsibleQuote from './Components/CollapsibleQuote';
|
||||||
import openLink from '../../utils/openLink';
|
import openLink from '../../lib/methods/helpers/openLink';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
|
|
||||||
export type TElement = {
|
export type TElement = {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import Markdown from '../markdown';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { isAndroid, isIOS } from '../../utils/deviceInfo';
|
import { isAndroid, isIOS } from '../../lib/methods/helpers';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import ActivityIndicator from '../ActivityIndicator';
|
import ActivityIndicator from '../ActivityIndicator';
|
||||||
import { withDimensions } from '../../dimensions';
|
import { withDimensions } from '../../dimensions';
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { CustomIcon } from '../CustomIcon';
|
||||||
import { DISCUSSION } from './constants';
|
import { DISCUSSION } from './constants';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import { formatDateThreads } from '../../utils/room';
|
import { formatDateThreads } from '../../lib/methods/helpers/room';
|
||||||
import { IMessage } from '../../definitions';
|
import { IMessage } from '../../definitions';
|
||||||
import { useTheme } from '../../theme';
|
import { useTheme } from '../../theme';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text } from 'react-native';
|
import { Text } from 'react-native';
|
||||||
|
|
||||||
import shortnameToUnicode from '../../utils/shortnameToUnicode';
|
import shortnameToUnicode from '../../lib/methods/helpers/shortnameToUnicode';
|
||||||
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
import CustomEmoji from '../EmojiPicker/CustomEmoji';
|
||||||
import { IMessageEmoji } from './interfaces';
|
import { IMessageEmoji } from './interfaces';
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,11 @@ import FastImage from 'react-native-fast-image';
|
||||||
|
|
||||||
import Touchable from './Touchable';
|
import Touchable from './Touchable';
|
||||||
import Markdown from '../markdown';
|
import Markdown from '../markdown';
|
||||||
import openLink from '../../utils/openLink';
|
import openLink from '../../lib/methods/helpers/openLink';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import { fileDownloadAndPreview } from '../../utils/fileDownload';
|
import { fileDownloadAndPreview } from './helpers/fileDownload';
|
||||||
import { IAttachment, TGetCustomEmoji } from '../../definitions';
|
import { IAttachment, TGetCustomEmoji } from '../../definitions';
|
||||||
import RCActivityIndicator from '../ActivityIndicator';
|
import RCActivityIndicator from '../ActivityIndicator';
|
||||||
import Attachments from './Attachments';
|
import Attachments from './Attachments';
|
||||||
|
|
|
@ -5,12 +5,12 @@ import FastImage from 'react-native-fast-image';
|
||||||
import { dequal } from 'dequal';
|
import { dequal } from 'dequal';
|
||||||
|
|
||||||
import Touchable from './Touchable';
|
import Touchable from './Touchable';
|
||||||
import openLink from '../../utils/openLink';
|
import openLink from '../../lib/methods/helpers/openLink';
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import { TSupportedThemes, useTheme, withTheme } from '../../theme';
|
import { TSupportedThemes, useTheme, withTheme } from '../../theme';
|
||||||
import { LISTENER } from '../Toast';
|
import { LISTENER } from '../Toast';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import { IUrl } from '../../definitions';
|
import { IUrl } from '../../definitions';
|
||||||
|
|
|
@ -4,12 +4,12 @@ import { dequal } from 'dequal';
|
||||||
|
|
||||||
import Touchable from './Touchable';
|
import Touchable from './Touchable';
|
||||||
import Markdown from '../markdown';
|
import Markdown from '../markdown';
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../../lib/methods/helpers';
|
||||||
import { CustomIcon } from '../CustomIcon';
|
import { CustomIcon } from '../CustomIcon';
|
||||||
import { themes } from '../../lib/constants';
|
import { themes } from '../../lib/constants';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import { fileDownload } from '../../utils/fileDownload';
|
import { fileDownload } from './helpers/fileDownload';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from '../../lib/methods/helpers/events';
|
||||||
import { LISTENER } from '../Toast';
|
import { LISTENER } from '../Toast';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../i18n';
|
||||||
import { IAttachment } from '../../definitions/IAttachment';
|
import { IAttachment } from '../../definitions/IAttachment';
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import RNFetchBlob, { FetchBlobResponse } from 'rn-fetch-blob';
|
import RNFetchBlob, { FetchBlobResponse } from 'rn-fetch-blob';
|
||||||
import FileViewer from 'react-native-file-viewer';
|
import FileViewer from 'react-native-file-viewer';
|
||||||
|
|
||||||
import EventEmitter from '../events';
|
import EventEmitter from '../../../../lib/methods/helpers/events';
|
||||||
import { LISTENER } from '../../containers/Toast';
|
import { LISTENER } from '../../../Toast';
|
||||||
import I18n from '../../i18n';
|
import I18n from '../../../../i18n';
|
||||||
import { DOCUMENTS_PATH, DOWNLOAD_PATH } from '../../lib/constants';
|
import { DOCUMENTS_PATH, DOWNLOAD_PATH } from '../../../../lib/constants';
|
||||||
import { IAttachment } from '../../definitions/IAttachment';
|
import { IAttachment } from '../../../../definitions';
|
||||||
|
|
||||||
export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`;
|
export const getLocalFilePathFromFile = (localPath: string, attachment: IAttachment): string => `${localPath}${attachment.title}`;
|
||||||
|
|
|
@ -4,10 +4,10 @@ import { Subscription } from 'rxjs';
|
||||||
|
|
||||||
import Message from './Message';
|
import Message from './Message';
|
||||||
import MessageContext from './Context';
|
import MessageContext from './Context';
|
||||||
import debounce from '../../utils/debounce';
|
import { debounce } from '../../lib/methods/helpers';
|
||||||
import { getMessageTranslation } from './utils';
|
import { getMessageTranslation } from './utils';
|
||||||
import { TSupportedThemes, withTheme } from '../../theme';
|
import { TSupportedThemes, withTheme } from '../../theme';
|
||||||
import openLink from '../../utils/openLink';
|
import openLink from '../../lib/methods/helpers/openLink';
|
||||||
import { IAttachment, TAnyMessageModel, TGetCustomEmoji } from '../../definitions';
|
import { IAttachment, TAnyMessageModel, TGetCustomEmoji } from '../../definitions';
|
||||||
import { IRoomInfoParam } from '../../views/SearchMessagesView';
|
import { IRoomInfoParam } from '../../views/SearchMessagesView';
|
||||||
import { E2E_MESSAGE_TYPE, E2E_STATUS, messagesStatus } from '../../lib/constants';
|
import { E2E_MESSAGE_TYPE, E2E_STATUS, messagesStatus } from '../../lib/constants';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { StyleSheet } from 'react-native';
|
import { StyleSheet } from 'react-native';
|
||||||
|
|
||||||
import sharedStyles from '../../views/Styles';
|
import sharedStyles from '../../views/Styles';
|
||||||
import { isTablet } from '../../utils/deviceInfo';
|
import { isTablet } from '../../lib/methods/helpers';
|
||||||
|
|
||||||
export default StyleSheet.create({
|
export default StyleSheet.create({
|
||||||
root: {
|
root: {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import * as List from '../../../../containers/List';
|
||||||
import styles from './styles';
|
import styles from './styles';
|
||||||
import { SWITCH_TRACK_COLOR, themes } from '../../../../lib/constants';
|
import { SWITCH_TRACK_COLOR, themes } from '../../../../lib/constants';
|
||||||
import { useTheme } from '../../../../theme';
|
import { useTheme } from '../../../../theme';
|
||||||
import { IUser } from '../../../../definitions/IUser';
|
import { IUser } from '../../../../definitions';
|
||||||
import { showConfirmationAlert } from '../../../../utils/info';
|
import { showConfirmationAlert } from '../../../../lib/methods/helpers/info';
|
||||||
import I18n from '../../../../i18n';
|
import I18n from '../../../../i18n';
|
||||||
import { changeLivechatStatus, isOmnichannelStatusAvailable } from '../../lib';
|
import { changeLivechatStatus, isOmnichannelStatusAvailable } from '../../lib';
|
||||||
import OmnichannelQueue from './OmnichannelQueue';
|
import OmnichannelQueue from './OmnichannelQueue';
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import sdk from '../../../lib/services/sdk';
|
import sdk from '../../../lib/services/sdk';
|
||||||
import { IUser } from '../../../definitions';
|
import { IUser } from '../../../definitions';
|
||||||
import EventEmitter from '../../../utils/events';
|
import EventEmitter from '../../../lib/methods/helpers/events';
|
||||||
import subscribeInquiry from './subscriptions/inquiry';
|
import subscribeInquiry from './subscriptions/inquiry';
|
||||||
|
|
||||||
export const isOmnichannelStatusAvailable = (user: IUser): boolean => user?.statusLivechat === 'available';
|
export const isOmnichannelStatusAvailable = (user: IUser): boolean => user?.statusLivechat === 'available';
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import log from '../../../../utils/log';
|
import log from '../../../../lib/methods/helpers/log';
|
||||||
import { store } from '../../../../lib/store/auxStore';
|
import { store } from '../../../../lib/store/auxStore';
|
||||||
import { inquiryQueueAdd, inquiryQueueRemove, inquiryQueueUpdate, inquiryRequest } from '../../actions/inquiry';
|
import { inquiryQueueAdd, inquiryQueueRemove, inquiryQueueUpdate, inquiryRequest } from '../../actions/inquiry';
|
||||||
import sdk from '../../../../lib/services/sdk';
|
import sdk from '../../../../lib/services/sdk';
|
||||||
import { IOmnichannelRoom } from '../../../../definitions';
|
import { IOmnichannelRoom } from '../../../../definitions';
|
||||||
import { hasRole } from '../../../../lib/methods';
|
import { hasRole } from '../../../../lib/methods/helpers';
|
||||||
import { Services } from '../../../../lib/services';
|
import { Services } from '../../../../lib/services';
|
||||||
|
|
||||||
interface IArgsQueueOmnichannel extends IOmnichannelRoom {
|
interface IArgsQueueOmnichannel extends IOmnichannelRoom {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { put, select, takeLatest } from 'redux-saga/effects';
|
||||||
|
|
||||||
import * as types from '../../../actions/actionsTypes';
|
import * as types from '../../../actions/actionsTypes';
|
||||||
import { Services } from '../../../lib/services';
|
import { Services } from '../../../lib/services';
|
||||||
import EventEmitter from '../../../utils/events';
|
import EventEmitter from '../../../lib/methods/helpers/events';
|
||||||
import { inquiryFailure, inquirySetEnabled, inquirySuccess } from '../actions/inquiry';
|
import { inquiryFailure, inquirySetEnabled, inquirySuccess } from '../actions/inquiry';
|
||||||
import { getInquiriesQueued, isOmnichannelStatusAvailable } from '../lib';
|
import { getInquiriesQueued, isOmnichannelStatusAvailable } from '../lib';
|
||||||
|
|
||||||
|
|
|
@ -6,21 +6,20 @@ import { shallowEqual, useSelector } from 'react-redux';
|
||||||
|
|
||||||
import I18n from '../../../i18n';
|
import I18n from '../../../i18n';
|
||||||
import RoomItem, { ROW_HEIGHT } from '../../../containers/RoomItem';
|
import RoomItem, { ROW_HEIGHT } from '../../../containers/RoomItem';
|
||||||
import { isIOS, isTablet } from '../../../utils/deviceInfo';
|
|
||||||
import { getUserSelector } from '../../../selectors/login';
|
import { getUserSelector } from '../../../selectors/login';
|
||||||
import { useTheme } from '../../../theme';
|
import { useTheme } from '../../../theme';
|
||||||
import { useDimensions } from '../../../dimensions';
|
import { useDimensions } from '../../../dimensions';
|
||||||
import SafeAreaView from '../../../containers/SafeAreaView';
|
import SafeAreaView from '../../../containers/SafeAreaView';
|
||||||
import StatusBar from '../../../containers/StatusBar';
|
import StatusBar from '../../../containers/StatusBar';
|
||||||
import { goRoom } from '../../../utils/goRoom';
|
import { goRoom } from '../../../lib/methods/helpers/goRoom';
|
||||||
import * as HeaderButton from '../../../containers/HeaderButton';
|
import * as HeaderButton from '../../../containers/HeaderButton';
|
||||||
import { events, logEvent } from '../../../utils/log';
|
import { events, logEvent } from '../../../lib/methods/helpers/log';
|
||||||
import { getInquiryQueueSelector } from '../selectors/inquiry';
|
import { getInquiryQueueSelector } from '../selectors/inquiry';
|
||||||
import { IOmnichannelRoom, IApplicationState } from '../../../definitions';
|
import { IOmnichannelRoom, IApplicationState } from '../../../definitions';
|
||||||
import { MAX_SIDEBAR_WIDTH } from '../../../lib/constants';
|
import { MAX_SIDEBAR_WIDTH } from '../../../lib/constants';
|
||||||
import { ChatsStackParamList } from '../../../stacks/types';
|
import { ChatsStackParamList } from '../../../stacks/types';
|
||||||
import { MasterDetailInsideStackParamList } from '../../../stacks/MasterDetailStack/types';
|
import { MasterDetailInsideStackParamList } from '../../../stacks/MasterDetailStack/types';
|
||||||
import { getRoomAvatar, getRoomTitle, getUidDirectMessage } from '../../../lib/methods';
|
import { getRoomAvatar, getRoomTitle, getUidDirectMessage, isIOS, isTablet } from '../../../lib/methods/helpers';
|
||||||
|
|
||||||
type TNavigation = CompositeNavigationProp<
|
type TNavigation = CompositeNavigationProp<
|
||||||
StackNavigationProp<ChatsStackParamList, 'QueueListView'>,
|
StackNavigationProp<ChatsStackParamList, 'QueueListView'>,
|
||||||
|
|
|
@ -4,7 +4,7 @@ import * as RNLocalize from 'react-native-localize';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import 'moment/min/locales';
|
import 'moment/min/locales';
|
||||||
|
|
||||||
import { toMomentLocale } from '../utils/moment';
|
import { toMomentLocale } from './moment';
|
||||||
import { isRTL } from './isRTL';
|
import { isRTL } from './isRTL';
|
||||||
import englishJson from './locales/en.json';
|
import englishJson from './locales/en.json';
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,10 @@ import { initializePushNotifications, onNotification } from './lib/notifications
|
||||||
import store from './lib/store';
|
import store from './lib/store';
|
||||||
import { initStore } from './lib/store/auxStore';
|
import { initStore } from './lib/store/auxStore';
|
||||||
import { ThemeContext, TSupportedThemes } from './theme';
|
import { ThemeContext, TSupportedThemes } from './theme';
|
||||||
import debounce from './utils/debounce';
|
import { debounce, isTablet } from './lib/methods/helpers';
|
||||||
import { isTablet } from './utils/deviceInfo';
|
import EventEmitter from './lib/methods/helpers/events';
|
||||||
import EventEmitter from './utils/events';
|
import { toggleAnalyticsEventsReport, toggleCrashErrorsReport } from './lib/methods/helpers/log';
|
||||||
import { toggleAnalyticsEventsReport, toggleCrashErrorsReport } from './utils/log';
|
import { getTheme, initialTheme, newThemeState, subscribeTheme, unsubscribeTheme } from './lib/methods/helpers/theme';
|
||||||
import { getTheme, initialTheme, newThemeState, subscribeTheme, unsubscribeTheme } from './utils/theme';
|
|
||||||
import ChangePasscodeView from './views/ChangePasscodeView';
|
import ChangePasscodeView from './views/ChangePasscodeView';
|
||||||
import ScreenLockedView from './views/ScreenLockedView';
|
import ScreenLockedView from './views/ScreenLockedView';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { getBundleId, isIOS } from '../../utils/deviceInfo';
|
import { getBundleId, isIOS } from '../methods/helpers';
|
||||||
|
|
||||||
const APP_STORE_ID = '1148741252';
|
const APP_STORE_ID = '1148741252';
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { NativeModules } from 'react-native';
|
import { NativeModules } from 'react-native';
|
||||||
|
|
||||||
import { isIOS } from './deviceInfo';
|
import { isIOS } from '../methods/helpers';
|
||||||
|
|
||||||
const { AppGroup } = NativeModules;
|
const { AppGroup } = NativeModules;
|
||||||
|
|
|
@ -2,8 +2,8 @@ import { Database } from '@nozbe/watermelondb';
|
||||||
import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
|
import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
|
||||||
import logger from '@nozbe/watermelondb/utils/common/logger';
|
import logger from '@nozbe/watermelondb/utils/common/logger';
|
||||||
|
|
||||||
import { isIOS } from '../../utils/deviceInfo';
|
import { isIOS } from '../methods/helpers';
|
||||||
import appGroup from '../../utils/appGroup';
|
import appGroup from './appGroup';
|
||||||
import { isOfficial } from '../constants';
|
import { isOfficial } from '../constants';
|
||||||
import Subscription from './model/Subscription';
|
import Subscription from './model/Subscription';
|
||||||
import Room from './model/Room';
|
import Room from './model/Room';
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { Q, Model } from '@nozbe/watermelondb';
|
||||||
import UserPreferences from '../methods/userPreferences';
|
import UserPreferences from '../methods/userPreferences';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import protectedFunction from '../methods/helpers/protectedFunction';
|
import protectedFunction from '../methods/helpers/protectedFunction';
|
||||||
import Deferred from '../../utils/deferred';
|
import Deferred from './helpers/deferred';
|
||||||
import log from '../../utils/log';
|
import log from '../methods/helpers/log';
|
||||||
import { store } from '../store/auxStore';
|
import { store } from '../store/auxStore';
|
||||||
import { joinVectorData, randomPassword, splitVectorData, toString, utf8ToBuffer } from './utils';
|
import { joinVectorData, randomPassword, splitVectorData, toString, utf8ToBuffer } from './utils';
|
||||||
import { EncryptionRoom } from './index';
|
import { EncryptionRoom } from './index';
|
||||||
|
|
|
@ -3,11 +3,11 @@ import { Base64 } from 'js-base64';
|
||||||
import SimpleCrypto from 'react-native-simple-crypto';
|
import SimpleCrypto from 'react-native-simple-crypto';
|
||||||
import ByteBuffer from 'bytebuffer';
|
import ByteBuffer from 'bytebuffer';
|
||||||
|
|
||||||
import { IMessage } from '../../definitions';
|
import { IMessage, IUser } from '../../definitions';
|
||||||
import Deferred from '../../utils/deferred';
|
import Deferred from './helpers/deferred';
|
||||||
import debounce from '../../utils/debounce';
|
import { debounce } from '../methods/helpers';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import log from '../../utils/log';
|
import log from '../methods/helpers/log';
|
||||||
import {
|
import {
|
||||||
b64ToBuffer,
|
b64ToBuffer,
|
||||||
bufferToB64,
|
bufferToB64,
|
||||||
|
@ -19,7 +19,6 @@ import {
|
||||||
utf8ToBuffer
|
utf8ToBuffer
|
||||||
} from './utils';
|
} from './utils';
|
||||||
import { Encryption } from './index';
|
import { Encryption } from './index';
|
||||||
import { IUser } from '../../definitions/IUser';
|
|
||||||
import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../constants';
|
import { E2E_MESSAGE_TYPE, E2E_STATUS } from '../constants';
|
||||||
import { Services } from '../services';
|
import { Services } from '../services';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import ByteBuffer from 'bytebuffer';
|
import ByteBuffer from 'bytebuffer';
|
||||||
import SimpleCrypto from 'react-native-simple-crypto';
|
import SimpleCrypto from 'react-native-simple-crypto';
|
||||||
|
|
||||||
import random from '../../utils/random';
|
import { random } from '../methods/helpers';
|
||||||
import { fromByteArray, toByteArray } from '../../utils/base64-js';
|
import { fromByteArray, toByteArray } from './helpers/base64-js';
|
||||||
|
|
||||||
const BASE64URI = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
|
const BASE64URI = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { ITriggerAction, IUserInteraction, ModalActions } from '../../containers/UIKit/interfaces';
|
import { ITriggerAction, IUserInteraction, ModalActions } from '../../containers/UIKit/interfaces';
|
||||||
import EventEmitter from '../../utils/events';
|
import EventEmitter from './helpers/events';
|
||||||
import fetch from '../../utils/fetch';
|
import fetch from './helpers/fetch';
|
||||||
import random from '../../utils/random';
|
import { random } from './helpers';
|
||||||
import Navigation from '../navigation/appNavigation';
|
import Navigation from '../navigation/appNavigation';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ISubscription } from '../../definitions';
|
import { ISubscription } from '../../definitions';
|
||||||
import { events, logEvent } from '../../utils/log';
|
import { events, logEvent } from './helpers/log';
|
||||||
import { store } from '../store/auxStore';
|
import { store } from '../store/auxStore';
|
||||||
import Navigation from '../navigation/appNavigation';
|
import Navigation from '../navigation/appNavigation';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../store/auxStore';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { clearEnterpriseModules, setEnterpriseModules as setEnterpriseModulesAction } from '../../actions/enterpriseModules';
|
import { clearEnterpriseModules, setEnterpriseModules as setEnterpriseModulesAction } from '../../actions/enterpriseModules';
|
||||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
import { compareServerVersion } from './helpers';
|
||||||
|
|
||||||
const LICENSE_OMNICHANNEL_MOBILE_ENTERPRISE = 'omnichannel-mobile-enterprise';
|
const LICENSE_OMNICHANNEL_MOBILE_ENTERPRISE = 'omnichannel-mobile-enterprise';
|
||||||
const LICENSE_LIVECHAT_ENTERPRISE = 'livechat-enterprise';
|
const LICENSE_LIVECHAT_ENTERPRISE = 'livechat-enterprise';
|
||||||
|
|
|
@ -3,11 +3,11 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||||
|
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../store/auxStore';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { setCustomEmojis as setCustomEmojisAction } from '../../actions/customEmojis';
|
import { setCustomEmojis as setCustomEmojisAction } from '../../actions/customEmojis';
|
||||||
import { ICustomEmojiModel, TCustomEmojiModel, ICustomEmojis } from '../../definitions';
|
import { ICustomEmojiModel, TCustomEmojiModel, ICustomEmojis } from '../../definitions';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
import { compareServerVersion } from './helpers';
|
||||||
|
|
||||||
interface IUpdateEmojis {
|
interface IUpdateEmojis {
|
||||||
update: TCustomEmojiModel[];
|
update: TCustomEmojiModel[];
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { TMessageModel, TSubscriptionModel } from '../../definitions';
|
import { TMessageModel, TSubscriptionModel } from '../../definitions';
|
||||||
import { store } from '../store/auxStore';
|
import { store } from '../store/auxStore';
|
||||||
import { isGroupChat } from './helpers';
|
import { isGroupChat } from './helpers';
|
||||||
|
|
|
@ -4,12 +4,12 @@ import orderBy from 'lodash/orderBy';
|
||||||
|
|
||||||
import { setPermissions as setPermissionsAction } from '../../actions/permissions';
|
import { setPermissions as setPermissionsAction } from '../../actions/permissions';
|
||||||
import { IPermission, TPermissionModel } from '../../definitions';
|
import { IPermission, TPermissionModel } from '../../definitions';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../store/auxStore';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
import protectedFunction from './helpers/protectedFunction';
|
import protectedFunction from './helpers/protectedFunction';
|
||||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
import { compareServerVersion } from './helpers';
|
||||||
|
|
||||||
export const SUPPORTED_PERMISSIONS = [
|
export const SUPPORTED_PERMISSIONS = [
|
||||||
'add-user-to-any-c-room',
|
'add-user-to-any-c-room',
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Model from '@nozbe/watermelondb/Model';
|
||||||
|
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import { getRoleById } from '../database/services/Role';
|
import { getRoleById } from '../database/services/Role';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../store/auxStore';
|
||||||
import { removeRoles, setRoles as setRolesAction, updateRoles } from '../../actions/roles';
|
import { removeRoles, setRoles as setRolesAction, updateRoles } from '../../actions/roles';
|
||||||
import { TRoleModel } from '../../definitions';
|
import { TRoleModel } from '../../definitions';
|
||||||
|
|
|
@ -4,8 +4,8 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||||
import { addSettings, clearSettings } from '../../actions/settings';
|
import { addSettings, clearSettings } from '../../actions/settings';
|
||||||
import { DEFAULT_AUTO_LOCK, defaultSettings } from '../constants';
|
import { DEFAULT_AUTO_LOCK, defaultSettings } from '../constants';
|
||||||
import { IPreparedSettings, ISettingsIcon } from '../../definitions';
|
import { IPreparedSettings, ISettingsIcon } from '../../definitions';
|
||||||
import fetch from '../../utils/fetch';
|
import fetch from './helpers/fetch';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../store/auxStore';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||||
|
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import protectedFunction from './helpers/protectedFunction';
|
import protectedFunction from './helpers/protectedFunction';
|
||||||
import { ISlashCommandResult, TSlashCommandModel } from '../../definitions';
|
import { ISlashCommandResult, TSlashCommandModel } from '../../definitions';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import { getMessageById } from '../database/services/Message';
|
import { getMessageById } from '../database/services/Message';
|
||||||
import { getThreadById } from '../database/services/Thread';
|
import { getThreadById } from '../database/services/Thread';
|
||||||
import log from '../../utils/log';
|
import log from './helpers/log';
|
||||||
import { Encryption } from '../encryption';
|
import { Encryption } from '../encryption';
|
||||||
import getSingleMessage from './getSingleMessage';
|
import getSingleMessage from './getSingleMessage';
|
||||||
import { IMessage, IThread, TThreadModel } from '../../definitions';
|
import { IMessage, IThread, TThreadModel } from '../../definitions';
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { setUser } from '../../actions/login';
|
||||||
import database from '../database';
|
import database from '../database';
|
||||||
import { IUser } from '../../definitions';
|
import { IUser } from '../../definitions';
|
||||||
import sdk from '../services/sdk';
|
import sdk from '../services/sdk';
|
||||||
import { compareServerVersion } from './helpers/compareServerVersion';
|
import { compareServerVersion } from './helpers';
|
||||||
|
|
||||||
export const _activeUsersSubTimeout: { activeUsersSubTimeout: boolean | ReturnType<typeof setTimeout> | number } = {
|
export const _activeUsersSubTimeout: { activeUsersSubTimeout: boolean | ReturnType<typeof setTimeout> | number } = {
|
||||||
activeUsersSubTimeout: false
|
activeUsersSubTimeout: false
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
export default function debounce(func: Function, wait?: number, immediate?: boolean) {
|
export function debounce(func: Function, wait?: number, immediate?: boolean) {
|
||||||
let timeout: ReturnType<typeof setTimeout> | null;
|
let timeout: ReturnType<typeof setTimeout> | null;
|
||||||
function _debounce(...args: any[]) {
|
function _debounce(...args: any[]) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
|
@ -1,5 +1,5 @@
|
||||||
import { IEmitUserInteraction } from '../containers/UIKit/interfaces';
|
import { IEmitUserInteraction } from '../../../containers/UIKit/interfaces';
|
||||||
import { ICommand } from '../definitions/ICommand';
|
import { ICommand } from '../../../definitions/ICommand';
|
||||||
import log from './log';
|
import log from './log';
|
||||||
|
|
||||||
type TEventEmitterEmmitArgs =
|
type TEventEmitterEmmitArgs =
|
|
@ -1,10 +1,10 @@
|
||||||
import { SubscriptionType } from '../definitions/ISubscription';
|
import { SubscriptionType } from '../../../definitions';
|
||||||
import { IAvatar } from '../containers/Avatar/interfaces';
|
import { IAvatar } from '../../../containers/Avatar/interfaces';
|
||||||
import { compareServerVersion } from '../lib/methods/helpers/compareServerVersion';
|
import { compareServerVersion } from './compareServerVersion';
|
||||||
|
|
||||||
const formatUrl = (url: string, size: number, query?: string) => `${url}?format=png&size=${size}${query}`;
|
const formatUrl = (url: string, size: number, query?: string) => `${url}?format=png&size=${size}${query}`;
|
||||||
|
|
||||||
export const avatarURL = ({
|
export const getAvatarURL = ({
|
||||||
type,
|
type,
|
||||||
text,
|
text,
|
||||||
size = 25,
|
size = 25,
|
|
@ -1,8 +1,8 @@
|
||||||
import { ChatsStackParamList } from '../stacks/types';
|
import { ChatsStackParamList } from '../../../stacks/types';
|
||||||
import Navigation from '../lib/navigation/appNavigation';
|
import Navigation from '../../navigation/appNavigation';
|
||||||
import { IOmnichannelRoom, SubscriptionType, IVisitor, TSubscriptionModel, ISubscription } from '../definitions';
|
import { IOmnichannelRoom, SubscriptionType, IVisitor, TSubscriptionModel, ISubscription } from '../../../definitions';
|
||||||
import { getRoomTitle, getUidDirectMessage } from '../lib/methods';
|
import { getRoomTitle, getUidDirectMessage } from './helpers';
|
||||||
import { Services } from '../lib/services';
|
import { Services } from '../../services';
|
||||||
|
|
||||||
interface IGoRoomItem {
|
interface IGoRoomItem {
|
||||||
search?: boolean; // comes from spotlight
|
search?: boolean; // comes from spotlight
|
|
@ -1,7 +1,7 @@
|
||||||
// @ts-nocheck - TEMP
|
// @ts-nocheck - TEMP
|
||||||
import log from '../../utils/log';
|
import log from './log';
|
||||||
import { store as reduxStore } from '../store/auxStore';
|
import { store as reduxStore } from '../../store/auxStore';
|
||||||
import database from '../database';
|
import database from '../../database';
|
||||||
|
|
||||||
export function isGroupChat(room): boolean {
|
export function isGroupChat(room): boolean {
|
||||||
return ((room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2)) ?? false;
|
return ((room.uids && room.uids.length > 2) || (room.usernames && room.usernames.length > 2)) ?? false;
|
|
@ -0,0 +1,16 @@
|
||||||
|
export * from './helpers';
|
||||||
|
export * from './compareServerVersion';
|
||||||
|
export * from './debounce';
|
||||||
|
export * from './deviceInfo';
|
||||||
|
export * from './formatAttachmentUrl';
|
||||||
|
export * from './generateLoadMoreId';
|
||||||
|
export * from './getAvatarUrl';
|
||||||
|
export * from './layoutAnimation';
|
||||||
|
export * from './info';
|
||||||
|
export * from './isReadOnly';
|
||||||
|
export * from './media';
|
||||||
|
export * from './room';
|
||||||
|
export * from './server';
|
||||||
|
export * from './url';
|
||||||
|
export * from './isValidEmail';
|
||||||
|
export * from './random';
|
|
@ -1,6 +1,6 @@
|
||||||
import { Alert } from 'react-native';
|
import { Alert } from 'react-native';
|
||||||
|
|
||||||
import I18n from '../i18n';
|
import I18n from '../../../i18n';
|
||||||
|
|
||||||
export const showErrorAlert = (message: string, title?: string, onPress = () => {}): void =>
|
export const showErrorAlert = (message: string, title?: string, onPress = () => {}): void =>
|
||||||
Alert.alert(title!, message, [{ text: 'OK', onPress }], { cancelable: true });
|
Alert.alert(title!, message, [{ text: 'OK', onPress }], { cancelable: true });
|
|
@ -1,6 +1,6 @@
|
||||||
import { store as reduxStore } from '../lib/store/auxStore';
|
import { store as reduxStore } from '../../store/auxStore';
|
||||||
import { ISubscription } from '../definitions/ISubscription';
|
import { ISubscription } from '../../../definitions';
|
||||||
import { hasPermission } from '../lib/methods';
|
import { hasPermission } from './helpers';
|
||||||
|
|
||||||
const canPostReadOnly = async ({ rid }: { rid: string }) => {
|
const canPostReadOnly = async ({ rid }: { rid: string }) => {
|
||||||
// TODO: this is not reactive. If this permission changes, the component won't be updated
|
// TODO: this is not reactive. If this permission changes, the component won't be updated
|
|
@ -1,4 +1,4 @@
|
||||||
export default function isValidEmail(email: string): boolean {
|
export function isValidEmail(email: string): boolean {
|
||||||
/* eslint-disable no-useless-escape */
|
/* eslint-disable no-useless-escape */
|
||||||
const reg =
|
const reg =
|
||||||
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
@ -1,6 +1,6 @@
|
||||||
import { LayoutAnimation } from 'react-native';
|
import { LayoutAnimation } from 'react-native';
|
||||||
|
|
||||||
import debounce from './debounce';
|
import { debounce } from '.';
|
||||||
import { isIOS } from './deviceInfo';
|
import { isIOS } from './deviceInfo';
|
||||||
|
|
||||||
export const animateNextTransition = debounce(
|
export const animateNextTransition = debounce(
|
|
@ -4,10 +4,10 @@ import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import { sha256 } from 'js-sha256';
|
import { sha256 } from 'js-sha256';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import UserPreferences from '../lib/methods/userPreferences';
|
import UserPreferences from '../userPreferences';
|
||||||
import { store } from '../lib/store/auxStore';
|
import { store } from '../../store/auxStore';
|
||||||
import database from '../lib/database';
|
import database from '../../database';
|
||||||
import { getServerTimeSync } from '../lib/services/getServerTimeSync';
|
import { getServerTimeSync } from '../../services/getServerTimeSync';
|
||||||
import {
|
import {
|
||||||
ATTEMPTS_KEY,
|
ATTEMPTS_KEY,
|
||||||
BIOMETRY_ENABLED_KEY,
|
BIOMETRY_ENABLED_KEY,
|
||||||
|
@ -15,10 +15,10 @@ import {
|
||||||
LOCAL_AUTHENTICATE_EMITTER,
|
LOCAL_AUTHENTICATE_EMITTER,
|
||||||
LOCKED_OUT_TIMER_KEY,
|
LOCKED_OUT_TIMER_KEY,
|
||||||
PASSCODE_KEY
|
PASSCODE_KEY
|
||||||
} from '../lib/constants';
|
} from '../../constants';
|
||||||
import I18n from '../i18n';
|
import I18n from '../../../i18n';
|
||||||
import { setLocalAuthenticated } from '../actions/login';
|
import { setLocalAuthenticated } from '../../../actions/login';
|
||||||
import { TServerModel } from '../definitions/IServer';
|
import { TServerModel } from '../../../definitions';
|
||||||
import EventEmitter from './events';
|
import EventEmitter from './events';
|
||||||
import { isIOS } from './deviceInfo';
|
import { isIOS } from './deviceInfo';
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue