feat: colors for card tags
This commit is contained in:
30
src/components/CardTag/CardTag.tsx
Normal file
30
src/components/CardTag/CardTag.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { CardTagSchema } from "../../client";
|
||||
import { Pill, useMantineColorScheme } from "@mantine/core";
|
||||
|
||||
type Props = {
|
||||
tag: Partial<CardTagSchema>;
|
||||
}
|
||||
|
||||
const CardTag = ({ tag }: Props) => {
|
||||
const theme = useMantineColorScheme();
|
||||
|
||||
let color = "lightgray";
|
||||
if (tag?.tagColor?.backgroundColor === "inherit" && theme.colorScheme == "light") {
|
||||
color = "gray";
|
||||
}
|
||||
|
||||
return (
|
||||
<Pill
|
||||
key={tag.id}
|
||||
style={{
|
||||
color,
|
||||
backgroundColor: tag?.tagColor?.backgroundColor,
|
||||
border: "1px solid " + tag?.tagColor?.color,
|
||||
}}
|
||||
>
|
||||
{tag.name}
|
||||
</Pill>
|
||||
);
|
||||
};
|
||||
|
||||
export default CardTag;
|
||||
Reference in New Issue
Block a user