Skip to content

Commit

Permalink
chore: fix require cycle (#5754)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello authored Jun 24, 2024
1 parent 20e7c79 commit ce18290
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 25 deletions.
5 changes: 1 addition & 4 deletions app/containers/markdown/new/Bold.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { StyleSheet, Text } from 'react-native';
import { Bold as BoldProps } from '@rocket.chat/message-parser';

import sharedStyles from '../../../views/Styles';
import Strike from './Strike';
import Italic from './Italic';
import Plain from './Plain';
import Link from './Link';
import { Strike, Italic, Plain, Link } from './components';

interface IBoldProps {
value: BoldProps['value'];
Expand Down
5 changes: 1 addition & 4 deletions app/containers/markdown/new/Italic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React from 'react';
import { StyleSheet, Text } from 'react-native';
import { Italic as ItalicProps } from '@rocket.chat/message-parser';

import Strike from './Strike';
import Bold from './Bold';
import Plain from './Plain';
import Link from './Link';
import { Bold, Strike, Plain, Link } from './components';

interface IItalicProps {
value: ItalicProps['value'];
Expand Down
4 changes: 1 addition & 3 deletions app/containers/markdown/new/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import { useTheme } from '../../../theme';
import openLink from '../../../lib/methods/helpers/openLink';
import EventEmitter from '../../../lib/methods/helpers/events';
import { themes } from '../../../lib/constants';
import Strike from './Strike';
import Italic from './Italic';
import Bold from './Bold';
import MarkdownContext from './MarkdownContext';
import { Bold, Italic, Strike } from './components';

interface ILinkProps {
value: LinkProps['value'];
Expand Down
5 changes: 1 addition & 4 deletions app/containers/markdown/new/Strike.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React from 'react';
import { StyleSheet, Text } from 'react-native';
import { Strike as StrikeProps } from '@rocket.chat/message-parser';

import Bold from './Bold';
import Italic from './Italic';
import Plain from './Plain';
import Link from './Link';
import { Bold, Italic, Plain, Link } from './components';

interface IStrikeProps {
value: StrikeProps['value'];
Expand Down
7 changes: 7 additions & 0 deletions app/containers/markdown/new/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Bold from './Bold';
import Italic from './Italic';
import Plain from './Plain';
import Link from './Link';
import Strike from './Strike';

export { Bold, Italic, Plain, Link, Strike };
2 changes: 1 addition & 1 deletion app/containers/message/Attachments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IMessageAttachments } from './interfaces';
import Image from './Image';
import Audio from './Audio';
import Video from './Video';
import Reply from './Reply';
import { Reply } from './components';
import Button from '../Button';
import MessageContext from './Context';
import { IAttachment, TGetCustomEmoji } from '../../definitions';
Expand Down
8 changes: 3 additions & 5 deletions app/containers/message/Reply.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TSupportedThemes, useTheme } from '../../theme';
import sharedStyles from '../../views/Styles';
import RCActivityIndicator from '../ActivityIndicator';
import Markdown from '../markdown';
import Attachments from './Attachments';
import { Attachments } from './components';
import MessageContext from './Context';
import Touchable from './Touchable';
import messageStyles from './styles';
Expand Down Expand Up @@ -243,8 +243,7 @@ const Reply = React.memo(
}
]}
background={Touchable.Ripple(themes[theme].surfaceNeutral)}
disabled={!!(loading || attachment.message_link)}
>
disabled={!!(loading || attachment.message_link)}>
<View style={styles.attachmentContainer}>
<Title attachment={attachment} timeFormat={timeFormat} theme={theme} />
<Description attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
Expand All @@ -264,8 +263,7 @@ const Reply = React.memo(
style={[
styles.backdrop,
{ backgroundColor: themes[theme].surfaceNeutral, opacity: themes[theme].attachmentLoadingOpacity }
]}
></View>
]}></View>
<RCActivityIndicator />
</View>
) : null}
Expand Down
4 changes: 4 additions & 0 deletions app/containers/message/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Attachments from './Attachments';
import Reply from './Reply';

export { Attachments, Reply };
2 changes: 1 addition & 1 deletion app/lib/constants/links.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getBundleId, isIOS } from '../methods/helpers';
import { getBundleId, isIOS } from '../methods/helpers/deviceInfo';

const APP_STORE_ID = '1148741252';

Expand Down
2 changes: 1 addition & 1 deletion app/lib/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SQLiteAdapter from '@nozbe/watermelondb/adapters/sqlite';
import logger from '@nozbe/watermelondb/utils/common/logger';

import { appGroupPath } from './appGroup';
import { isOfficial } from '../constants';
import { isOfficial } from '../constants/environment';
import Subscription from './model/Subscription';
import Room from './model/Room';
import Message from './model/Message';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/methods/helpers/layoutAnimation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LayoutAnimation } from 'react-native';

import { debounce } from '.';
import { debounce } from './debounce';
import { isIOS } from './deviceInfo';

export const animateNextTransition = debounce(
Expand Down
2 changes: 1 addition & 1 deletion app/lib/methods/helpers/log/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import firebaseAnalytics from '@react-native-firebase/analytics';

import { isFDroidBuild } from '../../../constants';
import { isFDroidBuild } from '../../../constants/environment';
import events from './events';

const analytics = firebaseAnalytics || '';
Expand Down

0 comments on commit ce18290

Please sign in to comment.