fix edge case when feed is liked only by one person

zio/stable
Ansh Nanda 2023-05-16 16:31:35 -07:00
parent 5397447ca7
commit 532bc88ecc
1 changed files with 6 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import {useFocusEffect, useNavigation} from '@react-navigation/native'
import {NavigationProp} from 'lib/routes/types' import {NavigationProp} from 'lib/routes/types'
import {useStores} from 'state/index' import {useStores} from 'state/index'
import {HeartIconSolid} from 'lib/icons' import {HeartIconSolid} from 'lib/icons'
import {pluralize} from 'lib/strings/helpers'
const AlgoItem = observer( const AlgoItem = observer(
({ ({
@ -80,8 +81,11 @@ const AlgoItem = observer(
<HeartIconSolid size={16} style={[s.mr2, {color: colors.red3}]} /> <HeartIconSolid size={16} style={[s.mr2, {color: colors.red3}]} />
<Text style={[pal.text, pal.textLight]}> <Text style={[pal.text, pal.textLight]}>
{item.data.likeCount && item.data.likeCount > 1 {item.data.likeCount && item.data.likeCount > 0
? `Liked by ${item.data.likeCount} others` ? `Liked by ${item.data.likeCount} ${pluralize(
item.data.likeCount,
'other',
)}`
: 'Be the first to like this'} : 'Be the first to like this'}
</Text> </Text>
</View> </View>