1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Account actions working for #638

This commit is contained in:
xmflsct
2023-01-02 02:08:12 +01:00
parent 62df29a479
commit 6dafbc96af
73 changed files with 262 additions and 626 deletions

View File

@ -37,7 +37,8 @@ const TimelineActioned: React.FC<Props> = ({ action, isNotification, ...rest })
/>
)
const onPress = () => navigation.push('Tab-Shared-Account', { account })
const onPress = () =>
navigation.push('Tab-Shared-Account', { account, isRemote: status?._remote })
const children = () => {
switch (action) {

View File

@ -1,8 +1,7 @@
import Button from '@components/Button'
import { useNavigation } from '@react-navigation/native'
import { StackNavigationProp } from '@react-navigation/stack'
import { RootStackParamList } from '@utils/navigation/navigators'
import { StyleConstants } from '@utils/styles/constants'
import { useTranslation } from 'react-i18next'
import { Alert } from 'react-native'
export interface Props {
sensitiveShown: boolean
@ -14,7 +13,7 @@ const AttachmentAltText: React.FC<Props> = ({ sensitiveShown, text }) => {
return null
}
const navigation = useNavigation<StackNavigationProp<RootStackParamList>>()
const { t } = useTranslation('componentTimeline')
return !sensitiveShown ? (
<Button
@ -28,7 +27,7 @@ const AttachmentAltText: React.FC<Props> = ({ sensitiveShown, text }) => {
type='text'
content='ALT'
fontBold
onPress={() => navigation.navigate('Screen-Actions', { type: 'alt_text', text })}
onPress={() => Alert.alert(t('shared.attachment.altText'), text)}
/>
) : null
}

View File

@ -31,7 +31,8 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
})
})}
onPress={() =>
!disableOnPress && navigation.push('Tab-Shared-Account', { account: actualAccount })
!disableOnPress &&
navigation.push('Tab-Shared-Account', { account: actualAccount, isRemote: status?._remote })
}
uri={{ original: actualAccount.avatar, static: actualAccount.avatar_static }}
dimension={

View File

@ -14,7 +14,7 @@ export interface Props {
}
const TimelineContent: React.FC<Props> = ({ notificationOwnToot = false, setSpoilerExpanded }) => {
const { status, highlighted, inThread, disableDetails } = useContext(StatusContext)
const { status, highlighted, inThread } = useContext(StatusContext)
if (!status || typeof status.content !== 'string' || !status.content.length) return null
const { colors } = useTheme()

View File

@ -40,7 +40,12 @@ const HeaderSharedReplies: React.FC = () => {
<CustomText
style={{ color: colors.blue, paddingLeft: StyleConstants.Spacing.S }}
children={`@${mention.username}`}
onPress={() => navigation.push('Tab-Shared-Account', { account: mention })}
onPress={() =>
navigation.push('Tab-Shared-Account', {
account: mention,
isRemote: status?._remote
})
}
/>
</Fragment>
))}