mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
3bf590b67e
* dev: calendar view init * chore: new render logic * chore: implement calendar view * chore: calendar view * refactor: calendar payload * chore: remove active month logic from backend * chore: setup new store for calendar * refactor: issues fetching structure * chore: months dropdown * chore: modify request query params for calendar layout * refactor: remove console logs and add comments
31 lines
921 B
TypeScript
31 lines
921 B
TypeScript
import { observer } from "mobx-react-lite";
|
|
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// constants
|
|
import { DAYS_LIST } from "constants/calendar";
|
|
|
|
export const CalendarWeekHeader: React.FC = observer(() => {
|
|
const { issueFilter: issueFilterStore } = useMobxStore();
|
|
|
|
const showWeekends = issueFilterStore.userDisplayFilters.calendar?.show_weekends ?? false;
|
|
|
|
return (
|
|
<div
|
|
className={`grid text-sm font-medium divide-x-[0.5px] divide-custom-border-200 ${
|
|
showWeekends ? "grid-cols-7" : "grid-cols-5"
|
|
}`}
|
|
>
|
|
{Object.values(DAYS_LIST).map((day) => {
|
|
if (!showWeekends && (day.shortTitle === "Sat" || day.shortTitle === "Sun")) return null;
|
|
|
|
return (
|
|
<div key={day.shortTitle} className="h-11 bg-custom-background-90 flex items-center px-4">
|
|
{day.shortTitle}
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
});
|