tooot/src/components/Timeline/End.tsx

51 lines
1.2 KiB
TypeScript
Raw Normal View History

import Icon from '@components/Icon'
2020-12-13 14:04:25 +01:00
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
2021-01-01 23:10:47 +01:00
import React from 'react'
import { Trans } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
2021-02-08 23:47:20 +01:00
import { Circle } from 'react-native-animated-spinkit'
2020-12-12 22:19:18 +01:00
export interface Props {
2020-12-18 23:58:53 +01:00
hasNextPage?: boolean
2020-12-12 22:19:18 +01:00
}
2020-12-18 23:58:53 +01:00
const TimelineEnd: React.FC<Props> = ({ hasNextPage }) => {
const { theme } = useTheme()
return (
<View style={styles.base}>
2020-12-18 23:58:53 +01:00
{hasNextPage ? (
2021-02-08 23:47:20 +01:00
<Circle size={StyleConstants.Font.Size.L} color={theme.secondary} />
2020-12-12 22:19:18 +01:00
) : (
<Text style={[styles.text, { color: theme.secondary }]}>
2021-01-01 23:10:47 +01:00
<Trans
2021-01-19 01:13:45 +01:00
i18nKey='componentTimeline:end.message'
2021-01-01 23:10:47 +01:00
components={[
<Icon
name='Coffee'
2021-01-01 23:10:47 +01:00
size={StyleConstants.Font.Size.S}
color={theme.secondary}
/>
]}
/>
2020-12-12 22:19:18 +01:00
</Text>
)}
</View>
)
}
const styles = StyleSheet.create({
base: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
padding: StyleConstants.Spacing.M
},
text: {
...StyleConstants.FontStyle.S
}
})
export default TimelineEnd