mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at remove-preload 66 lines 1.5 kB view raw
1import React from 'react' 2import {StyleProp, StyleSheet, View, ViewStyle} from 'react-native' 3import {IconProp} from '@fortawesome/fontawesome-svg-core' 4import { 5 FontAwesomeIcon, 6 FontAwesomeIconStyle, 7} from '@fortawesome/react-native-fontawesome' 8import {Text} from './text/Text' 9import {UserGroupIcon} from 'lib/icons' 10import {usePalette} from 'lib/hooks/usePalette' 11 12export function EmptyState({ 13 testID, 14 icon, 15 message, 16 style, 17}: { 18 testID?: string 19 icon: IconProp | 'user-group' 20 message: string 21 style?: StyleProp<ViewStyle> 22}) { 23 const pal = usePalette('default') 24 return ( 25 <View testID={testID} style={[styles.container, pal.border, style]}> 26 <View style={styles.iconContainer}> 27 {icon === 'user-group' ? ( 28 <UserGroupIcon size="64" style={styles.icon} /> 29 ) : ( 30 <FontAwesomeIcon 31 icon={icon} 32 size={64} 33 style={[ 34 styles.icon, 35 {color: pal.colors.emptyStateIcon} as FontAwesomeIconStyle, 36 ]} 37 /> 38 )} 39 </View> 40 <Text 41 type="xl-medium" 42 style={[{color: pal.colors.textVeryLight}, styles.text]}> 43 {message} 44 </Text> 45 </View> 46 ) 47} 48 49const styles = StyleSheet.create({ 50 container: { 51 paddingVertical: 20, 52 paddingHorizontal: 36, 53 borderTopWidth: 1, 54 }, 55 iconContainer: { 56 flexDirection: 'row', 57 }, 58 icon: { 59 marginLeft: 'auto', 60 marginRight: 'auto', 61 }, 62 text: { 63 textAlign: 'center', 64 paddingTop: 20, 65 }, 66})