chore: new arrow key navigation (#3229)
* rebuild keyboard navigation lists * add new keyboard navigation components * remove references to boundless-arrow-key-navigation * fix aria-labels on paginated lists everywhere
This commit is contained in:
@@ -9,9 +9,11 @@ const LocaleTime = React.lazy(
|
||||
)
|
||||
);
|
||||
|
||||
type Props = React.ComponentProps<typeof LocaleTime>;
|
||||
type Props = React.ComponentProps<typeof LocaleTime> & {
|
||||
onClick?: () => void;
|
||||
};
|
||||
|
||||
function Time(props: Props) {
|
||||
function Time({ onClick, ...props }: Props) {
|
||||
let content = formatDistanceToNow(Date.parse(props.dateTime), {
|
||||
addSuffix: props.addSuffix,
|
||||
});
|
||||
@@ -24,13 +26,15 @@ function Time(props: Props) {
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Suspense
|
||||
fallback={
|
||||
<time dateTime={props.dateTime}>{props.children || content}</time>
|
||||
}
|
||||
>
|
||||
<LocaleTime tooltipDelay={250} {...props} />
|
||||
</React.Suspense>
|
||||
<span onClick={onClick}>
|
||||
<React.Suspense
|
||||
fallback={
|
||||
<time dateTime={props.dateTime}>{props.children || content}</time>
|
||||
}
|
||||
>
|
||||
<LocaleTime tooltipDelay={250} {...props} />
|
||||
</React.Suspense>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user