From 9c30edcc65642b3e0dd86724a8e18c1937493391 Mon Sep 17 00:00:00 2001 From: Zhiyuan Zheng Date: Thu, 29 Oct 2020 21:29:52 +0100 Subject: [PATCH] Update details --- src/components/Toot.jsx | 31 +++++++++++++------------------ src/stacks/common/Timeline.jsx | 2 +- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/src/components/Toot.jsx b/src/components/Toot.jsx index 1e0d3a36..5987b554 100644 --- a/src/components/Toot.jsx +++ b/src/components/Toot.jsx @@ -12,27 +12,23 @@ import Media from './Toot/Media' import Card from './Toot/Card' import Actions from './Toot/Actions' -// Maybe break away notification types? https://docs.joinmastodon.org/entities/notification/ - -export default function Toot ({ item, notification }) { +export default function Toot ({ toot }) { const navigation = useNavigation() let actualContent - if (notification && item.status) { - actualContent = item.status - } else if (item.reblog) { - actualContent = item.reblog + if (toot.reblog) { + actualContent = toot.reblog } else { - actualContent = item + actualContent = toot } - const toot = useMemo(() => { + const tootView = useMemo(() => { return ( - {item.reblog && ( + {toot.reblog && ( )} @@ -48,8 +44,8 @@ export default function Toot ({ item, notification }) { } emojis={actualContent.account.emojis} account={actualContent.account.acct} - created_at={item.created_at} - application={item.application} + created_at={toot.created_at} + application={toot.application} /> {/* Can pass toot info to next page to speed up performance */} id} renderItem={({ item, index, separators }) => ( - + )} {...(state.pointer && { initialScrollIndex: state.pointer })} {...(!disableRefresh && {