mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-19 05:30:44 -05:00
* Add types * Delete stuff * wip * findAllBetweenTwoTimestamps refactor * wip * wip * wip * wip * wip * wip * wip * Fixes * wip * wip * Fix InfoPopover button styling * wip * wip * wip * Merge branch 'rewrite' into new-calendar * wip * wip * wip * wip * Rename myform -> sendouform * wip * wip * wip * wip * wip * wip * wip * wip * wip * rename * fix test
42 lines
915 B
TypeScript
42 lines
915 B
TypeScript
import clsx from "clsx";
|
|
import {
|
|
Button,
|
|
Calendar,
|
|
CalendarCell,
|
|
CalendarGrid,
|
|
type CalendarProps,
|
|
type DateValue,
|
|
Heading,
|
|
} from "react-aria-components";
|
|
import { ArrowLeftIcon } from "~/components/icons/ArrowLeft";
|
|
import { ArrowRightIcon } from "~/components/icons/ArrowRight";
|
|
|
|
export interface SendouCalendarProps<T extends DateValue>
|
|
extends CalendarProps<T> {
|
|
className?: string;
|
|
}
|
|
|
|
export function SendouCalendar<T extends DateValue>({
|
|
className,
|
|
...rest
|
|
}: SendouCalendarProps<T>) {
|
|
return (
|
|
<Calendar className={clsx(className, "react-aria-Calendar")} {...rest}>
|
|
<header>
|
|
<Button slot="previous">
|
|
<ArrowLeftIcon />
|
|
</Button>
|
|
<Heading />
|
|
<Button slot="next">
|
|
<ArrowRightIcon />
|
|
</Button>
|
|
</header>
|
|
<CalendarGrid>
|
|
{(date) => {
|
|
return <CalendarCell date={date} data-testid="choose-date-button" />;
|
|
}}
|
|
</CalendarGrid>
|
|
</Calendar>
|
|
);
|
|
}
|