-
Notifications
You must be signed in to change notification settings - Fork 374
Expand file tree
/
Copy pathChannelListHeaderNetworkDownIndicator.tsx
More file actions
49 lines (44 loc) · 1.52 KB
/
ChannelListHeaderNetworkDownIndicator.tsx
File metadata and controls
49 lines (44 loc) · 1.52 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
46
47
48
49
import React, { useMemo } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { useTheme } from '../../contexts/themeContext/ThemeContext';
import { useTranslationContext } from '../../contexts/translationContext/TranslationContext';
import { primitives } from '../../theme';
export const ChannelListHeaderNetworkDownIndicator = () => {
const styles = useStyles();
const { t } = useTranslationContext();
return (
<View style={styles.container} testID='network-down-indicator'>
<Text style={styles.errorText}>{t('Reconnecting...')}</Text>
</View>
);
};
ChannelListHeaderNetworkDownIndicator.displayName =
'ChannelListHeaderNetworkDownIndicator{channelListHeaderErrorIndicator}';
const useStyles = () => {
const {
theme: {
channelListHeaderErrorIndicator: { container, errorText },
semantics,
},
} = useTheme();
return useMemo(() => {
return StyleSheet.create({
container: {
alignItems: 'center',
justifyContent: 'center',
width: '100%',
backgroundColor: semantics.backgroundCoreSurfaceDefault,
paddingVertical: primitives.spacingXs,
paddingHorizontal: primitives.spacingSm,
...container,
},
errorText: {
fontSize: primitives.typographyFontSizeXs,
fontWeight: primitives.typographyFontWeightSemiBold,
lineHeight: primitives.typographyLineHeightTight,
color: semantics.chatTextSystem,
...errorText,
},
});
}, [container, errorText, semantics]);
};