Skip to content

Commit

Permalink
feat: news item highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
berenteb committed Feb 3, 2024
1 parent 487633f commit 4c84d02
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions components/news/elements/news-item.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Feather } from '@expo/vector-icons';
import { useNavigation } from 'expo-router';
import { PressableProps } from 'react-native';
import { PressableProps, View } from 'react-native';
import { NativeStackNavigationProp } from 'react-native-screens/native-stack';

import { NewsItemDto } from '../../../types/news-api.type';
Expand All @@ -17,7 +18,13 @@ export function NewsItem({ newsItem, ...props }: NewsItemProps) {
router.navigate('news-details', { id: newsItem.url });
};
return (
<ItemCard onPress={onPress} {...props}>
<ItemCard className='space-y-2' onPress={onPress} {...props}>
{newsItem.highlighted && (
<View className='flex-row space-x-1 items-center'>
<Feather name='alert-circle' size={15} color='#ef4444' />
<StyledText className='text-red-500'>Kiemelt</StyledText>
</View>
)}
<StyledText className='text-xl' numberOfLines={2}>
{newsItem.title}
</StyledText>
Expand Down

0 comments on commit 4c84d02

Please sign in to comment.