mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-20 20:34:19 +00:00
fix(ui): show the link icon on a linked group until hovered
The unlink icon at rest read as a broken link, not as the linked folder it marks. Show the link icon and swap to the unlink icon in the danger color only on hover or keyboard focus, so the row says what it is and the action appears where the pointer is.
This commit is contained in:
@@ -511,9 +511,11 @@ export default function ResourcesPage({ kind }: { kind: Kind }) {
|
||||
|
||||
const unlinkButton = (link: SourceLink) => (
|
||||
<Tooltip content={t('sourceLinks.unlink')}>
|
||||
<button type="button" className="ss-ib hover:!text-bad focus-visible:!text-bad" aria-label={t('sourceLinks.unlink')}
|
||||
{/* Reads as the link it is; only hover or focus turns it into the unlink action. */}
|
||||
<button type="button" className="ss-ib group hover:!text-bad focus-visible:!text-bad" aria-label={t('sourceLinks.unlink')}
|
||||
onClick={() => setUnlinking(link)}>
|
||||
<Unlink2 size={16} />
|
||||
<Link2 size={16} className="group-hover:hidden group-focus-visible:hidden" />
|
||||
<Unlink2 size={16} className="hidden group-hover:block group-focus-visible:block" />
|
||||
</button>
|
||||
</Tooltip>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user