Refactor tag screen to use FlashList

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2023-07-15 19:37:15 +03:00
parent bd1dcd6809
commit 622d88cf40
11 changed files with 95 additions and 49 deletions

View File

@@ -4,8 +4,8 @@ import { Chip } from 'react-native-paper';
import { Tag } from '../database';
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
const TagChip = (properties: { tag: Tag }) => {
const contrastColor = getContrastColor(properties.tag.color);
const TagChip = ({ tag }: { tag: Tag }) => {
const contrastColor = getContrastColor(tag.color);
return (
<Chip
@@ -15,11 +15,11 @@ const TagChip = (properties: { tag: Tag }) => {
compact
style={[
{
backgroundColor: properties.tag.color,
backgroundColor: tag.color,
},
]}
textStyle={{ color: contrastColor }}>
{'#' + properties.tag.name}
{'#' + tag.name}
</Chip>
);
};