Skip to content

Commit

Permalink
Merge pull request #2422 from stakwork/feature/label-color
Browse files Browse the repository at this point in the history
feat: updated icon and color for label
  • Loading branch information
Rassl authored Nov 1, 2024
2 parents a1a314c + 21880ec commit c7f124b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/components/Universe/Graph/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const Graph = () => {

material.color = new Color(lineColor)
material.transparent = true
material.opacity = 1
material.opacity = 0.5
}
})
}
Expand Down
16 changes: 4 additions & 12 deletions src/components/common/TypeBadge/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type BadgeProps = {
export const TypeBadge = ({ type }: Props) => {
let badgeProps: Omit<BadgeProps, 'label'>
const [normalizedSchemasByType] = useSchemaStore((s) => [s.normalizedSchemasByType])
const nodeType = type.toLowerCase()
const nodeType = type

const primaryColor = normalizedSchemasByType[type]?.primary_color
const primaryIcon = normalizedSchemasByType[type]?.icon
Expand Down Expand Up @@ -93,14 +93,6 @@ export const TypeBadge = ({ type }: Props) => {

break

case 'topic':
badgeProps = {
iconStart: icon ?? 'topic_badge.svg',
color: primaryColor ?? colors.TOPIC,
}

break

default:
badgeProps = {
iconStart: icon ?? 'thing_badge.svg',
Expand All @@ -114,15 +106,15 @@ export const TypeBadge = ({ type }: Props) => {
}

const Badge = ({ iconStart, color, label }: BadgeProps) => (
<EpisodeWrapper color={color} label={label}>
<EpisodeWrapper color={color}>
<img alt={label} className="badge__img" src={iconStart} />
<div className="badge__label">{label}</div>
</EpisodeWrapper>
)

const EpisodeWrapper = styled(Flex).attrs({
direction: 'row',
})<{ color: string; label: string }>`
})<{ color: string }>`
cursor: pointer;
background: ${({ color }) => color};
border-radius: 3px;
Expand All @@ -139,7 +131,7 @@ const EpisodeWrapper = styled(Flex).attrs({
}
.badge__label {
color: ${({ label }) => (label.toLowerCase() === 'topic' ? colors.black : colors.white)};
color: ${colors.white};
font-family: Barlow;
font-size: 8px;
font-style: normal;
Expand Down

0 comments on commit c7f124b

Please sign in to comment.