1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-03-06 21:01:38 +01:00
parent 17f15a199c
commit 83048450e8
15 changed files with 476 additions and 520 deletions

View File

@ -10,24 +10,29 @@ export interface Props {
application?: Mastodon.Application
}
const HeaderSharedApplication: React.FC<Props> = ({ application }) => {
const { theme } = useTheme()
const { t } = useTranslation('componentTimeline')
const HeaderSharedApplication = React.memo(
({ application }: Props) => {
const { theme } = useTheme()
const { t } = useTranslation('componentTimeline')
return application && application.name !== 'Web' ? (
<Text
onPress={async () => {
analytics('timeline_shared_header_application_press', {
application
})
application.website && (await openLink(application.website))
}}
style={[styles.application, { color: theme.secondary }]}
>
{t('shared.header.shared.application', { application: application.name })}
</Text>
) : null
}
return application && application.name !== 'Web' ? (
<Text
onPress={async () => {
analytics('timeline_shared_header_application_press', {
application
})
application.website && (await openLink(application.website))
}}
style={[styles.application, { color: theme.secondary }]}
>
{t('shared.header.shared.application', {
application: application.name
})}
</Text>
) : null
},
() => true
)
const styles = StyleSheet.create({
application: {