about summary refs log tree commit diff
path: root/src/view/com/post-thread/PostThreadItem.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-07-19 12:16:57 -0500
committerGitHub <noreply@github.com>2023-07-19 12:16:57 -0500
commit0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5 (patch)
treea395def20fc038da3f41920733d18f3a93b07541 /src/view/com/post-thread/PostThreadItem.tsx
parent4515559b1a7db493188cfe92abf8ea5cfd53c6dc (diff)
downloadvoidsky-0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5.tar.zst
#984 Updating `indexedAt` timestamps (#1024)
* add TimeElapsed util component, integrate into PostThreadItem

* integrate into posts

* use consistent naming

* use mobx and single interval for TimeElapsed
Diffstat (limited to 'src/view/com/post-thread/PostThreadItem.tsx')
-rw-r--r--src/view/com/post-thread/PostThreadItem.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx
index 133d38421..efc9fe694 100644
--- a/src/view/com/post-thread/PostThreadItem.tsx
+++ b/src/view/com/post-thread/PostThreadItem.tsx
@@ -15,7 +15,7 @@ import {PostDropdownBtn} from '../util/forms/DropdownButton'
 import * as Toast from '../util/Toast'
 import {PreviewableUserAvatar} from '../util/UserAvatar'
 import {s} from 'lib/styles'
-import {ago, niceDate} from 'lib/strings/time'
+import {niceDate} from 'lib/strings/time'
 import {sanitizeDisplayName} from 'lib/strings/display-names'
 import {pluralize} from 'lib/strings/helpers'
 import {getTranslatorLink, isPostInLanguage} from '../../../locale/helpers'
@@ -30,6 +30,7 @@ import {PostSandboxWarning} from '../util/PostSandboxWarning'
 import {ErrorMessage} from '../util/error/ErrorMessage'
 import {usePalette} from 'lib/hooks/usePalette'
 import {formatCount} from '../util/numeric/format'
+import {TimeElapsed} from 'view/com/util/TimeElapsed'
 
 const PARENT_REPLY_LINE_LENGTH = 8
 
@@ -189,7 +190,10 @@ export const PostThreadItem = observer(function PostThreadItem({
                   </Text>
                 </Link>
                 <Text type="md" style={[styles.metaItem, pal.textLight]}>
-                  &middot; {ago(item.post.indexedAt)}
+                  &middot;&nbsp;
+                  <TimeElapsed timestamp={item.post.indexedAt}>
+                    {({timeElapsed}) => <>{timeElapsed}</>}
+                  </TimeElapsed>
                 </Text>
               </View>
               <View style={s.flex1} />