Remove all links from post meta to ensure taps are more consistent
parent
6a01e0529b
commit
302acaccb6
|
@ -284,7 +284,6 @@ export const PostThreadItem = observer(function PostThreadItem({
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.layoutContent}>
|
<View style={styles.layoutContent}>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
authorHref={authorHref}
|
|
||||||
authorHandle={item.post.author.handle}
|
authorHandle={item.post.author.handle}
|
||||||
authorDisplayName={item.post.author.displayName}
|
authorDisplayName={item.post.author.displayName}
|
||||||
timestamp={item.post.indexedAt}
|
timestamp={item.post.indexedAt}
|
||||||
|
|
|
@ -86,11 +86,9 @@ export const Post = observer(function Post({
|
||||||
const authorHref = `/profile/${item.post.author.handle}`
|
const authorHref = `/profile/${item.post.author.handle}`
|
||||||
const authorTitle = item.post.author.handle
|
const authorTitle = item.post.author.handle
|
||||||
let replyAuthorDid = ''
|
let replyAuthorDid = ''
|
||||||
let replyHref = ''
|
|
||||||
if (record.reply) {
|
if (record.reply) {
|
||||||
const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
|
const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
|
||||||
replyAuthorDid = urip.hostname
|
replyAuthorDid = urip.hostname
|
||||||
replyHref = `/profile/${urip.hostname}/post/${urip.rkey}`
|
|
||||||
}
|
}
|
||||||
const onPressReply = () => {
|
const onPressReply = () => {
|
||||||
store.shell.openComposer({
|
store.shell.openComposer({
|
||||||
|
@ -153,12 +151,11 @@ export const Post = observer(function Post({
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.layoutContent}>
|
<View style={styles.layoutContent}>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
authorHref={authorHref}
|
|
||||||
authorHandle={item.post.author.handle}
|
authorHandle={item.post.author.handle}
|
||||||
authorDisplayName={item.post.author.displayName}
|
authorDisplayName={item.post.author.displayName}
|
||||||
timestamp={item.post.indexedAt}
|
timestamp={item.post.indexedAt}
|
||||||
/>
|
/>
|
||||||
{replyHref !== '' && (
|
{replyAuthorDid !== '' && (
|
||||||
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
|
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon="reply"
|
icon="reply"
|
||||||
|
@ -168,14 +165,12 @@ export const Post = observer(function Post({
|
||||||
<Text type="sm" style={[pal.textLight, s.mr2]}>
|
<Text type="sm" style={[pal.textLight, s.mr2]}>
|
||||||
Reply to
|
Reply to
|
||||||
</Text>
|
</Text>
|
||||||
<Link href={replyHref} title="Parent post">
|
<UserInfoText
|
||||||
<UserInfoText
|
type="sm"
|
||||||
type="sm"
|
did={replyAuthorDid}
|
||||||
did={replyAuthorDid}
|
attr="displayName"
|
||||||
attr="displayName"
|
style={[pal.textLight]}
|
||||||
style={[pal.textLight]}
|
/>
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{item.post.author.viewer?.muted ? (
|
{item.post.author.viewer?.muted ? (
|
||||||
|
|
|
@ -44,11 +44,6 @@ export const FeedItem = observer(function ({
|
||||||
const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
|
const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri)
|
||||||
return urip.hostname
|
return urip.hostname
|
||||||
}, [record?.reply])
|
}, [record?.reply])
|
||||||
const replyHref = useMemo(() => {
|
|
||||||
if (!record?.reply) return ''
|
|
||||||
const urip = new AtUri(record?.reply.parent?.uri || record?.reply.root.uri)
|
|
||||||
return `/profile/${urip.hostname}/post/${urip.rkey}`
|
|
||||||
}, [record?.reply])
|
|
||||||
|
|
||||||
const onPressReply = () => {
|
const onPressReply = () => {
|
||||||
store.shell.openComposer({
|
store.shell.openComposer({
|
||||||
|
@ -162,12 +157,11 @@ export const FeedItem = observer(function ({
|
||||||
</View>
|
</View>
|
||||||
<View style={styles.layoutContent}>
|
<View style={styles.layoutContent}>
|
||||||
<PostMeta
|
<PostMeta
|
||||||
authorHref={authorHref}
|
|
||||||
authorHandle={item.post.author.handle}
|
authorHandle={item.post.author.handle}
|
||||||
authorDisplayName={item.post.author.displayName}
|
authorDisplayName={item.post.author.displayName}
|
||||||
timestamp={item.post.indexedAt}
|
timestamp={item.post.indexedAt}
|
||||||
/>
|
/>
|
||||||
{!isChild && replyHref !== '' && (
|
{!isChild && replyAuthorDid !== '' && (
|
||||||
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
|
<View style={[s.flexRow, s.mb2, {alignItems: 'center'}]}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon="reply"
|
icon="reply"
|
||||||
|
@ -177,14 +171,12 @@ export const FeedItem = observer(function ({
|
||||||
<Text type="md" style={[pal.textLight, s.mr2]}>
|
<Text type="md" style={[pal.textLight, s.mr2]}>
|
||||||
Reply to
|
Reply to
|
||||||
</Text>
|
</Text>
|
||||||
<Link href={replyHref} title="Parent post">
|
<UserInfoText
|
||||||
<UserInfoText
|
type="md"
|
||||||
type="md"
|
did={replyAuthorDid}
|
||||||
did={replyAuthorDid}
|
attr="displayName"
|
||||||
attr="displayName"
|
style={[pal.textLight, s.ml2]}
|
||||||
style={[pal.textLight, s.ml2]}
|
/>
|
||||||
/>
|
|
||||||
</Link>
|
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
{item.post.author.viewer?.muted &&
|
{item.post.author.viewer?.muted &&
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Platform, StyleSheet, View} from 'react-native'
|
import {Platform, StyleSheet, View} from 'react-native'
|
||||||
import {Link} from '../util/Link'
|
|
||||||
import {Text} from './text/Text'
|
import {Text} from './text/Text'
|
||||||
import {ago} from '../../../lib/strings'
|
import {ago} from '../../../lib/strings'
|
||||||
import {usePalette} from '../../lib/hooks/usePalette'
|
import {usePalette} from '../../lib/hooks/usePalette'
|
||||||
|
|
||||||
interface PostMetaOpts {
|
interface PostMetaOpts {
|
||||||
authorHref: string
|
|
||||||
authorHandle: string
|
authorHandle: string
|
||||||
authorDisplayName: string | undefined
|
authorDisplayName: string | undefined
|
||||||
timestamp: string
|
timestamp: string
|
||||||
|
@ -36,10 +34,7 @@ export function PostMeta(opts: PostMetaOpts) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.meta}>
|
<View style={styles.meta}>
|
||||||
<Link
|
<View style={[styles.metaItem, styles.maxWidth]}>
|
||||||
style={[styles.metaItem, styles.maxWidth]}
|
|
||||||
href={opts.authorHref}
|
|
||||||
title={opts.authorHandle}>
|
|
||||||
<Text type="lg-bold" style={[pal.text]} numberOfLines={1}>
|
<Text type="lg-bold" style={[pal.text]} numberOfLines={1}>
|
||||||
{displayName}
|
{displayName}
|
||||||
{handle ? (
|
{handle ? (
|
||||||
|
@ -48,7 +43,7 @@ export function PostMeta(opts: PostMetaOpts) {
|
||||||
</Text>
|
</Text>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
</Text>
|
</Text>
|
||||||
</Link>
|
</View>
|
||||||
<Text type="md" style={[styles.metaItem, pal.textLight]}>
|
<Text type="md" style={[styles.metaItem, pal.textLight]}>
|
||||||
· {ago(opts.timestamp)}
|
· {ago(opts.timestamp)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
Loading…
Reference in New Issue