import React, { useMemo } from 'react' import { Dimensions, Pressable, StyleSheet, View } from 'react-native' import { useNavigation } from '@react-navigation/native' import Actioned from './Toot/Actioned' import Avatar from './Toot/Avatar' import Header from './Toot/Header' import Content from './Toot/Content' import Poll from './Toot/Poll' import Attachment from './Toot/Attachment' import Card from './Toot/Card' import Actions from './Toot/Actions' export interface Props { toot: mastodon.Status } const TootTimeline: React.FC = ({ toot }) => { const navigation = useNavigation() let actualContent = toot.reblog ? toot.reblog : toot const tootView = useMemo(() => { return ( {toot.reblog && ( )}
{/* Can pass toot info to next page to speed up performance */} navigation.navigate('Toot', { toot: actualContent.id }) } > {actualContent.content ? ( ) : ( <> )} {actualContent.poll && } {actualContent.media_attachments.length > 0 && ( )} {actualContent.card && } ) }, [toot]) return tootView } const styles = StyleSheet.create({ tootTimeline: { flex: 1, flexDirection: 'column', padding: 12 }, toot: { flex: 1, flexDirection: 'row' }, details: { flex: 1, flexGrow: 1 } }) export default TootTimeline