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

First commit

Public timeline working, with refreshing and load more
This commit is contained in:
Zhiyuan Zheng
2020-10-22 00:47:02 +02:00
parent fb152fece9
commit 4af19d0588
10 changed files with 587 additions and 22 deletions

View File

@ -0,0 +1,47 @@
import React from 'react'
import { Image, StyleSheet, Text, View } from 'react-native'
import HTML from 'react-native-render-html'
import relative_time from '../utils/relative-time'
export default function TootTimeline ({ item }) {
return (
<View style={styles.tootTimeline}>
<View style={styles.header}>
<Image source={{ uri: item.account.avatar }} style={styles.avatar} />
<View>
<View style={styles.name}>
<Text>{item.account.display_name}</Text>
<Text>{item.account.acct}</Text>
</View>
<View>
<Text>{relative_time(item.created_at)}</Text>
{item.application && item.application.name !== 'Web' && (
<Text onPress={() => Linking.openURL(item.application.website)}>
{item.application.name}
</Text>
)}
</View>
</View>
</View>
{item.content ? <HTML html={item.content} /> : <></>}
</View>
)
}
const styles = StyleSheet.create({
tootTimeline: {
flex: 1,
padding: 15
},
header: {
flexDirection: 'row'
},
avatar: {
width: 40,
height: 40
},
name: {
flexDirection: 'row'
}
})