Implement consistent Link component

This commit is contained in:
Paul Frazee
2022-09-02 11:52:33 -05:00
parent 2ed9ea85c6
commit 39f13f01bc
9 changed files with 177 additions and 143 deletions
+3 -7
View File
@@ -6,13 +6,13 @@ import {
Image,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native'
import {
UserFollowersViewModel,
FollowerItem,
} from '../../../state/models/user-followers-view'
import {Link} from '../util/Link'
import {useStores} from '../../../state'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
@@ -77,12 +77,8 @@ export const ProfileFollowers = observer(function ProfileFollowers({
})
const User = ({item}: {item: FollowerItem}) => {
const store = useStores()
const onPressOuter = () => {
store.nav.navigate(`/profile/${item.name}`)
}
return (
<TouchableOpacity style={styles.outer} onPress={onPressOuter}>
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
@@ -95,7 +91,7 @@ const User = ({item}: {item: FollowerItem}) => {
<Text style={[s.f14, s.gray5]}>@{item.name}</Text>
</View>
</View>
</TouchableOpacity>
</Link>
)
}
+3 -6
View File
@@ -14,6 +14,7 @@ import {
FollowItem,
} from '../../../state/models/user-follows-view'
import {useStores} from '../../../state'
import {Link} from '../util/Link'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
@@ -77,12 +78,8 @@ export const ProfileFollows = observer(function ProfileFollows({
})
const User = ({item}: {item: FollowItem}) => {
const store = useStores()
const onPressOuter = () => {
store.nav.navigate(`/profile/${item.name}`)
}
return (
<TouchableOpacity style={styles.outer} onPress={onPressOuter}>
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
@@ -95,7 +92,7 @@ const User = ({item}: {item: FollowItem}) => {
<Text style={[s.f14, s.gray5]}>@{item.name}</Text>
</View>
</View>
</TouchableOpacity>
</Link>
)
}