mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 14:35:45 +01:00
Add keyboard navigation to repository overview list (#2146)
A new api is introduced to allow focus-based list iteration through keyboard shortcuts. The api is initially considered closed and only used in the repository overview. Co-authored-by: Eduard Heimbuch <eduard.heimbuch@cloudogu.com>
This commit is contained in:
committed by
GitHub
parent
7b933c6821
commit
e74d0c9c8b
@@ -26,6 +26,7 @@ import { Link } from "react-router-dom";
|
||||
import classNames from "classnames";
|
||||
import styled from "styled-components";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useKeyboardIteratorTarget } from "@scm-manager/ui-shortcuts";
|
||||
|
||||
const StyledGroupEntry = styled.div`
|
||||
max-height: calc(90px - 1.5rem);
|
||||
@@ -82,9 +83,11 @@ type Props = {
|
||||
|
||||
const GroupEntry: FC<Props> = ({ link, avatar, title, name, description, contentRight, ariaLabel }) => {
|
||||
const [t] = useTranslation("repos");
|
||||
const ref = useKeyboardIteratorTarget();
|
||||
return (
|
||||
<div className="is-relative">
|
||||
<OverlayLink
|
||||
ref={ref}
|
||||
to={link}
|
||||
className="has-hover-background-blue"
|
||||
aria-label={t("overview.ariaLabel", { name: ariaLabel })}
|
||||
|
||||
Reference in New Issue
Block a user