-
Notifications
You must be signed in to change notification settings - Fork 373
Expand file tree
/
Copy pathNetworkDownIndicator.tsx
More file actions
45 lines (42 loc) · 1.1 KB
/
NetworkDownIndicator.tsx
File metadata and controls
45 lines (42 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Spinner, useTheme } from 'stream-chat-react-native';
import { useLegacyColors } from '../theme/useLegacyColors';
const styles = StyleSheet.create({
networkDownContainer: {
alignItems: 'center',
flexDirection: 'row',
},
networkDownText: {
fontSize: 12,
marginLeft: 4,
},
networkDownTextLarge: {
fontSize: 16,
fontWeight: '700',
},
});
export const NetworkDownIndicator: React.FC<{ titleSize: 'small' | 'large' }> = ({
titleSize = 'small',
}) => {
const {
theme: { semantics },
} = useTheme();
const { black } = useLegacyColors();
return (
<View style={styles.networkDownContainer} testID='network-down-indicator'>
<Spinner height={12} style={{ backgroundColor: semantics.backgroundCoreElevation1 }} width={12} />
<Text
style={[
styles.networkDownText,
{
color: black,
},
titleSize === 'large' ? styles.networkDownTextLarge : {},
]}
>
Searching for Network
</Text>
</View>
);
};