Skip to content

Commit 739a249

Browse files
Code cleanup - early return and import order
1 parent 0c7a216 commit 739a249

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/components/MessageList/InlineLoadingIndicator.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ export const InlineLoadingIndicator: React.FC<InlineLoadingIndicatorProps> = ({
2222
colors: { accent_blue },
2323
} = theme;
2424

25-
if (loadingMore) {
26-
return (
27-
<View style={styles.activityIndicatorContainer}>
28-
<ActivityIndicator color={accent_blue} size='small' />
29-
</View>
30-
);
25+
if (!loadingMore) {
26+
return null;
3127
}
3228

33-
return null;
29+
return (
30+
<View style={styles.activityIndicatorContainer}>
31+
<ActivityIndicator color={accent_blue} size='small' />
32+
</View>
33+
);
3434
};

src/components/MessageList/MessageList.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ import {
99
ViewToken,
1010
} from 'react-native';
1111

12+
import {
13+
InlineLoadingIndicator,
14+
InlineLoadingIndicatorProps,
15+
} from './InlineLoadingIndicator';
16+
import { getLastReceivedMessage } from './utils/getLastReceivedMessage';
1217
import {
1318
isMessagesWithStylesAndReadBy,
1419
MessageType,
1520
useMessageList,
1621
} from './hooks/useMessageList';
17-
import { getLastReceivedMessage } from './utils/getLastReceivedMessage';
1822

1923
import {
2024
AttachmentPickerContextValue,
@@ -63,10 +67,6 @@ import type {
6367
DefaultUserType,
6468
UnknownType,
6569
} from '../../types/types';
66-
import {
67-
InlineLoadingIndicator,
68-
InlineLoadingIndicatorProps,
69-
} from './InlineLoadingIndicator';
7070

7171
const styles = StyleSheet.create({
7272
container: {

0 commit comments

Comments
 (0)