Skip to content

Commit

Permalink
chore: replace titles attributes with custom tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
rxtsel committed Oct 12, 2024
1 parent 2426630 commit 7998c84
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/Popover.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const titleLabel =

<div class='relative size-6 popover-content'>
<label
class='popover-team hover:text-cBlue order-1 text-cWhite transition-colors duration-150 ease-in size-6 cursor-pointer'
class='popover-team relative group hover:text-cBlue order-1 text-cWhite transition-colors duration-150 ease-in size-6 cursor-pointer'
aria-label='Team members'
title={titleLabel}
>
<input type='checkbox' class='check-popover-team' />
<Users />
<Tooltip content={titleLabel} />
</label>

<nav
Expand Down
9 changes: 5 additions & 4 deletions src/components/ProjectCard.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Github from '@/icons/Github.astro'
import Lock from '@/icons/Lock.astro'
import Popover from '@/components/Popover.astro'
import { getLangFromUrl, useTranslations } from '@/i18n/utils'
import Tooltip from '@/components/Tooltip.astro'
export interface Props {
props: iProject
Expand Down Expand Up @@ -62,20 +63,20 @@ const descriptionT = lang === 'en' ? descriptionEn : description
href={gh}
target='_blank'
rel='nofollow'
title={t('single.repository')}
aria-label={t('single.repository')}
class='order-2'
>
<div class='text-cWhite transition-colors duration-150 ease-in hover:text-cBlue size-6'>
<div class='text-cWhite group relative transition-colors duration-150 ease-in hover:text-cBlue size-6'>
<Github />
<Tooltip content={t('single.repository')} />
</div>
</a>
) : (
<div
class='order-2 text-neutral-600 size-6'
title={t('messages.ghPrivate')}
class='order-2 relative group text-neutral-600 size-6'
>
<Lock />
<Tooltip content={t('messages.ghPrivate')} />
</div>
)
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/Tooltip.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
// For use tooltip, add `relative group` class to parent container
export interface Props {
content: string;
}
Expand Down

0 comments on commit 7998c84

Please sign in to comment.