about summary refs log tree commit diff
path: root/src/view/com/posts/FeedItem.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/posts/FeedItem.tsx')
-rw-r--r--src/view/com/posts/FeedItem.tsx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx
index 9bb94ad05..6eb2b38fb 100644
--- a/src/view/com/posts/FeedItem.tsx
+++ b/src/view/com/posts/FeedItem.tsx
@@ -1,7 +1,7 @@
 import React, {useMemo} from 'react'
 import {observer} from 'mobx-react-lite'
 import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native'
-import {AdxUri} from '../../../third-party/uri'
+import {AtUri} from '../../../third-party/uri'
 import * as PostType from '../../../third-party/api/src/types/app/bsky/post'
 import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
 import {FeedViewItemModel} from '../../../state/models/feed-view'
@@ -23,24 +23,26 @@ export const FeedItem = observer(function FeedItem({
   const store = useStores()
   const record = item.record as unknown as PostType.Record
   const itemHref = useMemo(() => {
-    const urip = new AdxUri(item.uri)
-    return `/profile/${item.author.name}/post/${urip.recordKey}`
+    const urip = new AtUri(item.uri)
+    return `/profile/${item.author.name}/post/${urip.rkey}`
   }, [item.uri, item.author.name])
   const itemTitle = `Post by ${item.author.name}`
   const authorHref = `/profile/${item.author.name}`
   const replyAuthorDid = useMemo(() => {
     if (!record.reply) return ''
-    const urip = new AdxUri(record.reply.parent || record.reply.root)
+    const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
     return urip.hostname
   }, [record.reply])
   const replyHref = useMemo(() => {
     if (!record.reply) return ''
-    const urip = new AdxUri(record.reply.parent || record.reply.root)
-    return `/profile/${urip.hostname}/post/${urip.recordKey}`
+    const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
+    return `/profile/${urip.hostname}/post/${urip.rkey}`
   }, [record.reply])
 
   const onPressReply = () => {
-    store.shell.openModal(new ComposePostModel({replyTo: item.uri}))
+    store.shell.openModal(
+      new ComposePostModel({replyTo: {uri: item.uri, cid: item.cid}}),
+    )
   }
   const onPressToggleRepost = () => {
     item