This commit is contained in:
Zhiyuan Zheng 2021-03-14 01:35:38 +01:00
parent 5fe6cd59f9
commit b21f1b5a0e
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
5 changed files with 51 additions and 3 deletions

View File

@ -17,6 +17,7 @@ import { uniqBy } from 'lodash'
import React, { useCallback } from 'react'
import { Pressable, StyleSheet, View } from 'react-native'
import { useSelector } from 'react-redux'
import TimelineFullConversation from './Shared/FullConversation'
export interface Props {
item: Mastodon.Status & { _pinned?: boolean } // For account page, internal property
@ -124,6 +125,7 @@ const TimelineDefault: React.FC<Props> = ({
{!disableDetails && actualStatus.card && (
<TimelineCard card={actualStatus.card} />
)}
<TimelineFullConversation status={actualStatus} />
</View>
{queryKey && !disableDetails && (

View File

@ -17,6 +17,7 @@ import { uniqBy } from 'lodash'
import React, { useCallback } from 'react'
import { Pressable, StyleSheet, View } from 'react-native'
import { useSelector } from 'react-redux'
import TimelineFullConversation from './Shared/FullConversation'
export interface Props {
notification: Mastodon.Notification
@ -52,7 +53,15 @@ const TimelineNotifications: React.FC<Props> = ({
return (
<Pressable
style={[styles.notificationView, { backgroundColor: theme.background }]}
style={[
styles.notificationView,
{
backgroundColor: theme.background,
paddingBottom: notification.status
? 0
: StyleConstants.Spacing.Global.PagePadding
}
]}
onPress={onPress}
>
{notification.type !== 'mention' ? (
@ -112,6 +121,7 @@ const TimelineNotifications: React.FC<Props> = ({
{notification.status.card && (
<TimelineCard card={notification.status.card} />
)}
<TimelineFullConversation status={notification.status} />
</View>
) : null}
</View>
@ -144,8 +154,7 @@ const TimelineNotifications: React.FC<Props> = ({
const styles = StyleSheet.create({
notificationView: {
padding: StyleConstants.Spacing.Global.PagePadding,
paddingBottom: 0
padding: StyleConstants.Spacing.Global.PagePadding
},
header: {
flex: 1,

View File

@ -0,0 +1,35 @@
import { StyleConstants } from '@utils/styles/constants'
import { useTheme } from '@utils/styles/ThemeManager'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Text } from 'react-native'
export interface Props {
status: Mastodon.Status
}
const TimelineFullConversation = React.memo(
({ status }: Props) => {
const { t } = useTranslation('componentTimeline')
const { theme } = useTheme()
return status.in_reply_to_account_id &&
(status.mentions.length === 0 ||
status.mentions.filter(
mention => mention.id !== status.in_reply_to_account_id
).length) ? (
<Text
style={{
...StyleConstants.FontStyle.M,
color: theme.blue,
marginTop: StyleConstants.Font.Size.M / 2
}}
>
{t('shared.fullConversation')}
</Text>
) : null
},
() => true
)
export default TimelineFullConversation

View File

@ -51,6 +51,7 @@ export default {
content: {
expandHint: 'hidden content'
},
fullConversation: 'Read conversations',
header: {
shared: {
application: 'Tooted with {{application}}'

View File

@ -51,6 +51,7 @@ export default {
content: {
expandHint: '隐藏内容'
},
fullConversation: '阅读全部对话',
header: {
shared: {
application: '发自于 {{application}}'