({state, ...props}: AriaCalendarGridProps & {state: CalendarState})
| 46 | } |
| 47 | |
| 48 | function CalendarGrid({state, ...props}: AriaCalendarGridProps & {state: CalendarState}) { |
| 49 | let {gridProps, headerProps, weekDays, weeksInMonth} = useCalendarGrid(props, state); |
| 50 | |
| 51 | return ( |
| 52 | <table {...gridProps} className="react-aria-CalendarGrid"> |
| 53 | <thead {...headerProps}> |
| 54 | <tr> |
| 55 | {weekDays.map((day, i) => ( |
| 56 | <th className="react-aria-CalendarHeaderCell" key={i}> |
| 57 | {day} |
| 58 | </th> |
| 59 | ))} |
| 60 | </tr> |
| 61 | </thead> |
| 62 | <tbody> |
| 63 | {[...new Array(weeksInMonth).keys()].map(weekIndex => ( |
| 64 | <tr key={weekIndex}> |
| 65 | {state |
| 66 | .getDatesInWeek(weekIndex) |
| 67 | .map((date, i) => |
| 68 | date ? <CalendarCell key={i} state={state} date={date} /> : <td key={i} /> |
| 69 | )} |
| 70 | </tr> |
| 71 | ))} |
| 72 | </tbody> |
| 73 | </table> |
| 74 | ); |
| 75 | } |
| 76 | |
| 77 | function CalendarCell({state, date}: {state: CalendarState; date: CalendarDate}) { |
| 78 | let ref = useRef<HTMLDivElement>(null); |
nothing calls this directly
no test coverage detected