Clean up label styling

This commit is contained in:
Jackson Harper
2023-06-26 16:30:02 +08:00
parent 3f17538cb8
commit 1e38154e54

View File

@ -11,19 +11,14 @@ type LabelChipProps = {
color: string // expected to be a RGB hex color string
isSelected?: boolean
useAppAppearance?: boolean
xAction?: () => void
}
export function LabelChip(props: LabelChipProps): JSX.Element {
const router = useRouter()
const isDark = isDarkTheme()
const luminance = getLuminance(props.color)
const textColor = luminance > 0.5 ? '#000000' : '#ffffff'
const selectedBorder = isDark ? '#FFEA9F' : 'black'
const unSelectedBorder = isDark ? '#6A6968' : '#D9D9D9'
// if (props.useAppAppearance) {
return (
<SpanBox
css={{
@ -44,30 +39,9 @@ export function LabelChip(props: LabelChipProps): JSX.Element {
backgroundColor: isDark ? '#2A2A2A' : '#F5F5F5',
}}
>
<HStack alignment="center" css={{ gap: '10px' }}>
<HStack alignment="center" css={{ gap: '5px' }}>
<Circle size={14} color={props.color} weight="fill" />
<SpanBox css={{ pt: '1px' }}>{props.text}</SpanBox>
{props.xAction && (
<Button
style="ghost"
css={{ display: 'flex', pt: '1px' }}
onClick={(event) => {
if (props.xAction) {
props.xAction()
event.preventDefault()
}
}}
>
<X
size={14}
color={
props.isSelected
? '#FFEA9F'
: theme.colors.thBorderSubtle.toString()
}
/>
</Button>
)}
</HStack>
</SpanBox>
)