apply same text logic to input
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import {LayoutAnimation, View} from 'react-native'
|
import {LayoutAnimation, View} from 'react-native'
|
||||||
|
import {AppBskyEmbedRecord, ChatBskyEmbedJoinLink} from '@atproto/api'
|
||||||
import {useLingui} from '@lingui/react/macro'
|
import {useLingui} from '@lingui/react/macro'
|
||||||
|
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
@@ -34,6 +35,19 @@ export function MessageInputReply() {
|
|||||||
? createSanitizedDisplayName(senderProfile, false)
|
? createSanitizedDisplayName(senderProfile, false)
|
||||||
: null
|
: null
|
||||||
|
|
||||||
|
let text = replyTo.text
|
||||||
|
let subtle = false
|
||||||
|
if (!text.trim()) {
|
||||||
|
subtle = true
|
||||||
|
if (ChatBskyEmbedJoinLink.isView(replyTo.embed)) {
|
||||||
|
text = l`(chat invite link)`
|
||||||
|
} else if (AppBskyEmbedRecord.isView(replyTo.embed)) {
|
||||||
|
text = l`(contains embedded content)`
|
||||||
|
} else {
|
||||||
|
text = l`No text`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
@@ -58,8 +72,11 @@ export function MessageInputReply() {
|
|||||||
{displayName}
|
{displayName}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
<Text style={[a.text_sm]} emoji numberOfLines={2}>
|
<Text
|
||||||
{replyTo.text}
|
style={[a.text_sm, subtle && [a.italic, t.atoms.text_contrast_high]]}
|
||||||
|
emoji
|
||||||
|
numberOfLines={2}>
|
||||||
|
{text}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
Reference in New Issue
Block a user