mirror of
https://github.com/tooot-app/app
synced 2025-02-04 04:17:36 +01:00
Fixed #51
This commit is contained in:
parent
5fe6cd59f9
commit
b21f1b5a0e
@ -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 && (
|
||||
|
@ -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,
|
||||
|
35
src/components/Timeline/Shared/FullConversation.tsx
Normal file
35
src/components/Timeline/Shared/FullConversation.tsx
Normal 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
|
@ -51,6 +51,7 @@ export default {
|
||||
content: {
|
||||
expandHint: 'hidden content'
|
||||
},
|
||||
fullConversation: 'Read conversations',
|
||||
header: {
|
||||
shared: {
|
||||
application: 'Tooted with {{application}}'
|
||||
|
@ -51,6 +51,7 @@ export default {
|
||||
content: {
|
||||
expandHint: '隐藏内容'
|
||||
},
|
||||
fullConversation: '阅读全部对话',
|
||||
header: {
|
||||
shared: {
|
||||
application: '发自于 {{application}}'
|
||||
|
Loading…
x
Reference in New Issue
Block a user