tooot/src/components/Timelines/Timeline/Shared/End.tsx

47 lines
1.1 KiB
TypeScript
Raw Normal View History

import { Feather } from '@expo/vector-icons'
import React from 'react'
2020-12-12 22:19:18 +01:00
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native'
2020-12-13 14:04:25 +01:00
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
2020-12-12 22:19:18 +01:00
export interface Props {
isFetchingMore: false | 'previous' | 'next' | undefined
}
const TimelineEnd: React.FC<Props> = ({ isFetchingMore }) => {
const { theme } = useTheme()
return (
<View style={styles.base}>
2020-12-12 22:19:18 +01:00
{isFetchingMore ? (
<ActivityIndicator />
) : (
<Text style={[styles.text, { color: theme.secondary }]}>
{' '}
<Feather
name='coffee'
size={StyleConstants.Font.Size.S}
color={theme.secondary}
/>{' '}
</Text>
)}
</View>
)
}
const styles = StyleSheet.create({
base: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
padding: StyleConstants.Spacing.M
},
text: {
fontSize: StyleConstants.Font.Size.S,
marginLeft: StyleConstants.Spacing.S
}
})
export default TimelineEnd