diff --git a/services/web/frontend/js/features/ui/components/bootstrap-5/badge-link.tsx b/services/web/frontend/js/features/ui/components/bootstrap-5/badge-link.tsx new file mode 100644 index 0000000000..b4fd20d5c6 --- /dev/null +++ b/services/web/frontend/js/features/ui/components/bootstrap-5/badge-link.tsx @@ -0,0 +1,24 @@ +import classNames from 'classnames' +import type { MergeAndOverride } from '../../../../../../types/utils' +import Badge, { type BadgeProps } from './badge' + +type BadgeLinkProps = MergeAndOverride< + BadgeProps, + { + href: string + } +> + +function BadgeLink({ href, children, ...badgeProps }: BadgeLinkProps) { + const containerClass = classNames('badge-link', { + [`badge-link-${badgeProps.bg}`]: badgeProps.bg, + }) + + return ( + + {children} + + ) +} + +export default BadgeLink diff --git a/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx b/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx index 6df11c3f09..f3d1ee20fa 100644 --- a/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx +++ b/services/web/frontend/js/features/ui/components/bootstrap-5/badge.tsx @@ -1,7 +1,7 @@ import { Badge as BSBadge, BadgeProps as BSBadgeProps } from 'react-bootstrap-5' import { MergeAndOverride } from '../../../../../../types/utils' -type BadgeProps = MergeAndOverride< +export type BadgeProps = MergeAndOverride< BSBadgeProps, { prepend?: React.ReactNode diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/badge.scss b/services/web/frontend/stylesheets/bootstrap-5/components/badge.scss index 1d2dbb8337..73e13d61f5 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/components/badge.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/components/badge.scss @@ -98,6 +98,25 @@ $max-width: 160px; font-weight: var(--badge-font-weight); } +.badge-link { + display: inline-block; + + &.badge-link-light:hover .badge { + background-color: var(--neutral-30) !important; + } + + .badge { + @include body-sm; + + padding: 0 var(--bs-badge-padding-x); + transition: background-color 0.15s ease-in-out; + + &:hover { + transition: background-color 0.15s ease-in-out; + } + } +} + .tags { .tags-list { list-style: none; @@ -107,15 +126,7 @@ $max-width: 160px; flex-wrap: wrap; } - .badge-tag { - padding: 0 var(--bs-badge-padding-x); - } - li { display: inline-flex; } - - a { - font-size: small; - } } diff --git a/services/web/frontend/stylesheets/bootstrap-5/components/gallery-search.scss b/services/web/frontend/stylesheets/bootstrap-5/components/gallery-search.scss index a0dc63389d..a097688dfb 100644 --- a/services/web/frontend/stylesheets/bootstrap-5/components/gallery-search.scss +++ b/services/web/frontend/stylesheets/bootstrap-5/components/gallery-search.scss @@ -103,18 +103,6 @@ display: flex; flex-wrap: wrap; gap: var(--spacing-04); - - li a { - @include body-sm; - - color: var(--color-primary-dark); - text-decoration: none; - - &:hover { - text-decoration: underline; - color: var(--green-50); - } - } } } }