diff --git a/app/containers/ActivityIndicator.tsx b/app/containers/ActivityIndicator.tsx
index 69ef22ceb..701926416 100644
--- a/app/containers/ActivityIndicator.tsx
+++ b/app/containers/ActivityIndicator.tsx
@@ -1,14 +1,11 @@
import React from 'react';
import { ActivityIndicator, ActivityIndicatorProps, StyleSheet } from 'react-native';
+import { useTheme } from '../theme';
import { themes } from '../constants/colors';
-type TTheme = 'light' | 'dark' | 'black' | string;
-
interface IActivityIndicator extends ActivityIndicatorProps {
- theme?: TTheme;
absolute?: boolean;
- props?: object;
}
const styles = StyleSheet.create({
@@ -27,8 +24,11 @@ const styles = StyleSheet.create({
}
});
-const RCActivityIndicator = ({ theme = 'light', absolute, ...props }: IActivityIndicator) => (
-
-);
+const RCActivityIndicator = ({ absolute, ...props }: IActivityIndicator): React.ReactElement => {
+ const { theme } = useTheme();
+ return (
+
+ );
+};
export default RCActivityIndicator;
diff --git a/app/containers/MessageBox/CommandsPreview/Item.tsx b/app/containers/MessageBox/CommandsPreview/Item.tsx
index 33e3c4ff3..3f18d2aac 100644
--- a/app/containers/MessageBox/CommandsPreview/Item.tsx
+++ b/app/containers/MessageBox/CommandsPreview/Item.tsx
@@ -34,7 +34,7 @@ const Item = ({ item, theme }: IMessageBoxCommandsPreviewItem) => {
resizeMode={FastImage.resizeMode.cover}
onLoadStart={() => setLoading(true)}
onLoad={() => setLoading(false)}>
- {loading ? : null}
+ {loading ? : null}
) : (
diff --git a/app/containers/TextInput.tsx b/app/containers/TextInput.tsx
index f829bb909..1ec1f1e19 100644
--- a/app/containers/TextInput.tsx
+++ b/app/containers/TextInput.tsx
@@ -116,8 +116,7 @@ export default class RCTextInput extends React.PureComponent;
+ return ;
}
tooglePassword = () => {
diff --git a/app/containers/UIKit/Overflow.tsx b/app/containers/UIKit/Overflow.tsx
index 50d77920b..a48fadd36 100644
--- a/app/containers/UIKit/Overflow.tsx
+++ b/app/containers/UIKit/Overflow.tsx
@@ -66,7 +66,7 @@ export const Overflow = ({ element, loading, action, parser, theme }: IOverflow)
{!loading ? (
) : (
-
+
)}
(
hitSlop={BUTTON_HIT_SLOP}
background={Touchable.SelectableBackgroundBorderless()}>
{loading ? (
-
+
) : (
)}
diff --git a/app/containers/message/Reply.tsx b/app/containers/message/Reply.tsx
index 7a7089248..31284b06c 100644
--- a/app/containers/message/Reply.tsx
+++ b/app/containers/message/Reply.tsx
@@ -258,7 +258,7 @@ const Reply = React.memo(
styles.backdrop,
{ backgroundColor: themes[theme].bannerBackground, opacity: themes[theme].attachmentLoadingOpacity }
]}>
-
+
) : null}
diff --git a/app/containers/message/Video.tsx b/app/containers/message/Video.tsx
index 6fb823f82..51e8631a0 100644
--- a/app/containers/message/Video.tsx
+++ b/app/containers/message/Video.tsx
@@ -77,11 +77,7 @@ const Video = React.memo(
onPress={onPress}
style={[styles.button, { backgroundColor: themes[theme].videoBackground }]}
background={Touchable.Ripple(themes[theme].bannerBackground)}>
- {loading ? (
-
- ) : (
-
- )}
+ {loading ? : }
{content}
- {loading ? : null}
+ {loading ? : null}
);
}
diff --git a/app/views/AuthenticationWebView.tsx b/app/views/AuthenticationWebView.tsx
index ac304fbfb..9a1381089 100644
--- a/app/views/AuthenticationWebView.tsx
+++ b/app/views/AuthenticationWebView.tsx
@@ -175,7 +175,7 @@ class AuthenticationWebView extends React.PureComponent
- {loading ? : null}
+ {loading ? : null}
>
);
}
diff --git a/app/views/CannedResponsesListView/index.tsx b/app/views/CannedResponsesListView/index.tsx
index ef3d0d214..e9dec1475 100644
--- a/app/views/CannedResponsesListView/index.tsx
+++ b/app/views/CannedResponsesListView/index.tsx
@@ -353,7 +353,7 @@ const CannedResponsesListView = ({ navigation, route }: ICannedResponsesListView
onEndReached={onEndReached}
onEndReachedThreshold={0.5}
ItemSeparatorComponent={List.Separator}
- ListFooterComponent={loading ? : null}
+ ListFooterComponent={loading ? : null}
/>
);
};
diff --git a/app/views/DirectoryView/index.tsx b/app/views/DirectoryView/index.tsx
index 73e6a45c9..1ad798ec6 100644
--- a/app/views/DirectoryView/index.tsx
+++ b/app/views/DirectoryView/index.tsx
@@ -292,7 +292,7 @@ class DirectoryView extends React.Component {
renderItem={this.renderItem}
ItemSeparatorComponent={List.Separator}
keyboardShouldPersistTaps='always'
- ListFooterComponent={loading ? : null}
+ ListFooterComponent={loading ? : null}
onEndReached={() => this.load({})}
/>
{showOptionsDropdown ? (
diff --git a/app/views/DiscussionsView/index.tsx b/app/views/DiscussionsView/index.tsx
index 8a977a36e..93963b0c5 100644
--- a/app/views/DiscussionsView/index.tsx
+++ b/app/views/DiscussionsView/index.tsx
@@ -198,7 +198,7 @@ const DiscussionsView = ({ navigation, route }: IDiscussionsViewProps): JSX.Elem
removeClippedSubviews={isIOS}
onEndReached={() => (isSearching ? searchTotal : total) > API_FETCH_COUNT ?? load()}
ItemSeparatorComponent={List.Separator}
- ListFooterComponent={loading ? : null}
+ ListFooterComponent={loading ? : null}
scrollIndicatorInsets={{ right: 1 }}
/>
diff --git a/app/views/JitsiMeetView.tsx b/app/views/JitsiMeetView.tsx
index aa6658d20..9145f2e3c 100644
--- a/app/views/JitsiMeetView.tsx
+++ b/app/views/JitsiMeetView.tsx
@@ -117,7 +117,7 @@ class JitsiMeetView extends React.Component
- {loading ? : null}
+ {loading ? : null}
>
);
}
diff --git a/app/views/MessagesView/index.tsx b/app/views/MessagesView/index.tsx
index 66070d1f7..67ddffdd6 100644
--- a/app/views/MessagesView/index.tsx
+++ b/app/views/MessagesView/index.tsx
@@ -369,7 +369,7 @@ class MessagesView extends React.Component {
style={[styles.list, { backgroundColor: themes[theme].backgroundColor }]}
keyExtractor={item => item._id}
onEndReached={this.load}
- ListFooterComponent={loading ? : null}
+ ListFooterComponent={loading ? : null}
/>
);
diff --git a/app/views/ModalBlockView.tsx b/app/views/ModalBlockView.tsx
index 5167663df..c87a3fd9c 100644
--- a/app/views/ModalBlockView.tsx
+++ b/app/views/ModalBlockView.tsx
@@ -277,7 +277,7 @@ class ModalBlockView extends React.Component
- {loading ? : null}
+ {loading ? : null}
);
}
diff --git a/app/views/RoomMembersView/index.tsx b/app/views/RoomMembersView/index.tsx
index 4212e7856..2ad9a7344 100644
--- a/app/views/RoomMembersView/index.tsx
+++ b/app/views/RoomMembersView/index.tsx
@@ -636,7 +636,7 @@ class RoomMembersView extends React.Component {
if (isLoading) {
- return ;
+ return ;
}
return null;
}}
diff --git a/app/views/RoomView/List/index.tsx b/app/views/RoomView/List/index.tsx
index 6f136748f..eb3e7c4e6 100644
--- a/app/views/RoomView/List/index.tsx
+++ b/app/views/RoomView/List/index.tsx
@@ -319,9 +319,9 @@ class ListContainer extends React.Component {
- const { rid, theme, loading } = this.props;
+ const { rid, loading } = this.props;
if (loading && rid) {
- return ;
+ return ;
}
return null;
};
diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx
index ec375c237..24c6414d1 100644
--- a/app/views/RoomsListView/index.tsx
+++ b/app/views/RoomsListView/index.tsx
@@ -1000,7 +1000,7 @@ class RoomsListView extends React.Component;
+ return ;
}
return (
diff --git a/app/views/SearchMessagesView/index.tsx b/app/views/SearchMessagesView/index.tsx
index c2a48367b..585bf76aa 100644
--- a/app/views/SearchMessagesView/index.tsx
+++ b/app/views/SearchMessagesView/index.tsx
@@ -291,7 +291,7 @@ class SearchMessagesView extends React.Component item._id}
onEndReached={this.onEndReached}
- ListFooterComponent={loading ? : null}
+ ListFooterComponent={loading ? : null}
onEndReachedThreshold={0.5}
removeClippedSubviews={isIOS}
{...scrollPersistTaps}
diff --git a/app/views/ShareListView/index.tsx b/app/views/ShareListView/index.tsx
index ced0badd5..b89603242 100644
--- a/app/views/ShareListView/index.tsx
+++ b/app/views/ShareListView/index.tsx
@@ -450,7 +450,7 @@ class ShareListView extends React.Component {
const { theme } = this.props;
if (loading) {
- return ;
+ return ;
}
if (needsPermission) {
diff --git a/app/views/TeamChannelsView.tsx b/app/views/TeamChannelsView.tsx
index b8b32cdd2..330126f74 100644
--- a/app/views/TeamChannelsView.tsx
+++ b/app/views/TeamChannelsView.tsx
@@ -540,9 +540,8 @@ class TeamChannelsView extends React.Component {
const { loadingMore } = this.state;
- const { theme } = this.props;
if (loadingMore) {
- return ;
+ return ;
}
return null;
};
diff --git a/app/views/ThreadMessagesView/index.tsx b/app/views/ThreadMessagesView/index.tsx
index 5d17729df..2c6dcc6a4 100644
--- a/app/views/ThreadMessagesView/index.tsx
+++ b/app/views/ThreadMessagesView/index.tsx
@@ -524,7 +524,7 @@ class ThreadMessagesView extends React.Component : null}
+ ListFooterComponent={loading ? : null}
scrollIndicatorInsets={{ right: 1 }} // https://github.com/facebook/react-native/issues/26610#issuecomment-539843444
/>
);
diff --git a/app/views/UserNotificationPreferencesView/index.tsx b/app/views/UserNotificationPreferencesView/index.tsx
index a4d23291b..1b9a5cd83 100644
--- a/app/views/UserNotificationPreferencesView/index.tsx
+++ b/app/views/UserNotificationPreferencesView/index.tsx
@@ -114,7 +114,6 @@ class UserNotificationPreferencesView extends React.Component<
};
render() {
- const { theme } = this.props;
const { loading } = this.state;
return (
@@ -159,7 +158,7 @@ class UserNotificationPreferencesView extends React.Component<
>
) : (
-
+
)}