1
0
mirror of https://github.com/tooot-app/app synced 2025-04-19 20:57:36 +02:00
Zhiyuan Zheng 2020-12-29 12:33:22 +01:00
parent 2ce842e15f
commit 8e93492ae3
No known key found for this signature in database
GPG Key ID: 078A93AB607D85E0
4 changed files with 14 additions and 18 deletions

View File

@ -54,21 +54,19 @@ const renderNode = ({
</Text>
)
} else if (classes.includes('mention') && mentions) {
const accountIndex = mentions.findIndex(mention => mention.url === href)
return (
<Text
key={index}
style={{
color: theme.blue,
color: accountIndex !== -1 ? theme.blue : undefined,
...StyleConstants.FontStyle[size]
}}
onPress={() => {
const username = href.split(new RegExp(/@(.*)/))
const usernameIndex = mentions.findIndex(
m => m.username === username[1]
)
navigation.push('Screen-Shared-Account', {
account: mentions[usernameIndex]
})
accountIndex !== -1 &&
navigation.push('Screen-Shared-Account', {
account: mentions[accountIndex]
})
}}
>
{node.children[0].data}
@ -97,13 +95,11 @@ const renderNode = ({
}
>
{!shouldBeTag ? (
<>
<Feather
name='external-link'
size={StyleConstants.Font.Size[size]}
color={theme.blue}
/>{' '}
</>
<Feather
name='external-link'
size={StyleConstants.Font.Size[size]}
color={theme.blue}
/>
) : null}
{content || (showFullLink ? href : domain[1])}
</Text>

View File

@ -3,7 +3,7 @@ import { Image, StyleSheet, Text } from 'react-native'
import { useTheme } from '@utils/styles/ThemeManager'
import { StyleConstants } from '@utils/styles/constants'
const regexEmoji = new RegExp(/(:[a-z0-9_]+:)/)
const regexEmoji = new RegExp(/(:[A-Za-z0-9_]+:)/)
export interface Props {
content: string

View File

@ -57,7 +57,7 @@ const fireMutation = async ({
export interface Props {
queryKey?: QueryKey.Timeline
account: Mastodon.Account
account: Pick<Mastodon.Account, 'id' | 'username' | 'acct' | 'url'>
setBottomSheetVisible: React.Dispatch<React.SetStateAction<boolean>>
}

View File

@ -20,7 +20,7 @@ import layoutAnimation from '@root/utils/styles/layoutAnimation'
export interface Props {
route: {
params: {
account: Mastodon.Account
account: Pick<Mastodon.Account, 'id' | 'username' | 'acct' | 'url'>
}
}
navigation: any