Skip to content

Commit

Permalink
feat: update badge with title styles (#1387)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyesp authored Nov 1, 2023
1 parent 8ffcf72 commit 170f451
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/User/Badges/Badge.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import classNames from 'classnames'

import { BadgeStatus, Badge as GovernanceBadge } from '../../../entities/Badges/types'
import { Badge as GovernanceBadge } from '../../../entities/Badges/types'

import './Badge.css'

Expand Down
4 changes: 3 additions & 1 deletion src/components/User/Badges/BadgeCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
flex-direction: column;
align-items: center;
cursor: pointer;
transition: box-shadow 0.1s ease, transform 0.1s ease;
}

@media (min-width: 768px) {
Expand All @@ -20,7 +21,8 @@
}

.BadgeCard:hover {
box-shadow: 0 0 8px var(--black-600);
box-shadow: var(--shadow-2);
transform: translateY(-4px);
}

.BadgeCard__Icon {
Expand Down
14 changes: 10 additions & 4 deletions src/components/User/Badges/BadgeWithTitle.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@
margin-left: -12px;
}

.BadgeWithTitle__BadgeContainer {
z-index: 1;
border-radius: 25px;
border: 1px solid var(--alpha-black-300);
}

.BadgeWithTitle:first-child {
margin-left: 0;
}

.BadgeWithTitle__Title {
background: var(--black-300);
background: var(--black-200);
display: flex;
height: 24px;
opacity: 0.56;
border-radius: 4px;
padding: 3px 6px 3px 24px;
position: relative;
right: 20px;
gap: 4px;
transition: box-shadow 0.1s ease;
}

.BadgeWithTitle__Title:hover {
box-shadow: 0 0 8px var(--black-600);
.BadgeWithTitle:hover > .BadgeWithTitle__Title {
box-shadow: 0 0 8px var(--black-400);
}

.BadgeWithTitle__Title > span {
Expand Down
4 changes: 3 additions & 1 deletion src/components/User/Badges/BadgeWithTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ interface Props {
export default function BadgeWithTitle({ badge, onClick }: Props) {
return (
<div className="BadgeWithTitle" key={`${badge.name}-id`} onClick={onClick}>
<Badge badge={badge} variant={BadgeVariant.FilledMono} />
<div className="BadgeWithTitle__BadgeContainer">
<Badge badge={badge} variant={BadgeVariant.FilledMono} />
</div>
<div className="BadgeWithTitle__Title">
<span>{badge.name}</span>
</div>
Expand Down

0 comments on commit 170f451

Please sign in to comment.