Add tag datatable
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
27
src/components/tagChip.tsx
Normal file
27
src/components/tagChip.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import { getContrastColor } from '../utilities';
|
||||
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);
|
||||
|
||||
return (
|
||||
<Chip
|
||||
icon={() => {
|
||||
return <FontAwesome5 name="tag" color={contrastColor} />;
|
||||
}}
|
||||
compact
|
||||
style={[
|
||||
{
|
||||
backgroundColor: properties.tag.color,
|
||||
},
|
||||
]}
|
||||
textStyle={{ color: contrastColor }}>
|
||||
{'#' + properties.tag.name}
|
||||
</Chip>
|
||||
);
|
||||
};
|
||||
|
||||
export default TagChip;
|
Reference in New Issue
Block a user