(react) render Button as link

For a variety of reasons, such as accessibility or integration with
external react-router deps style we needed to be able to provide the
ability to render the Button component as link in order to be able
to provide link-specific attribute for rendering such as href.
This commit is contained in:
Nathan Vasse
2023-10-18 17:38:48 +02:00
committed by NathanVss
parent b86ba5cc8e
commit 01528b9377
6 changed files with 65 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ import {
isToday,
} from "@internationalized/date";
import { CalendarState, RangeCalendarState } from "@react-stately/calendar";
import { Button } from ":/components/Button";
import { Button, ButtonElement } from ":/components/Button";
interface CalendarCellProps {
state: CalendarState | RangeCalendarState;
@@ -20,7 +20,7 @@ const isRangeCalendar = (object: any): object is RangeCalendarState => {
};
export const CalendarCell = ({ state, date }: CalendarCellProps) => {
const ref = useRef<HTMLButtonElement>(null);
const ref = useRef<ButtonElement>(null);
const {
cellProps,
buttonProps,