feat: calendar component

This commit is contained in:
2025-04-20 14:04:39 +03:00
parent 97879cc41b
commit bdb3effaf0
4 changed files with 20 additions and 5 deletions

View File

@@ -1,5 +1,3 @@
import { withTitle } from "@/constructors/Component";
import { UrlsTitle } from "@/enums/urls";
import { cn } from "@/utils/class-merge"; import { cn } from "@/utils/class-merge";
import { BackwardIcon } from "@heroicons/react/24/solid"; import { BackwardIcon } from "@heroicons/react/24/solid";
import { FunctionComponent, h } from "preact"; import { FunctionComponent, h } from "preact";
@@ -221,7 +219,7 @@ const BigCalendar: FunctionComponent<BigCalendarProps> = ({
}; };
return ( return (
<div className={`flex flex-col ${className}`}> <div className={`flex w-full flex-col ${className}`}>
<div className="mb-4 flex items-center justify-between px-2"> <div className="mb-4 flex items-center justify-between px-2">
<button <button
onClick={handlePrevMonth} onClick={handlePrevMonth}
@@ -266,4 +264,4 @@ const BigCalendar: FunctionComponent<BigCalendarProps> = ({
); );
}; };
export default withTitle(UrlsTitle.CALENDAR, BigCalendar); export default BigCalendar;

View File

@@ -14,7 +14,7 @@ const ProfilePage: FunctionComponent = () => {
<Router> <Router>
<Route path="/settings" component={lazy(() => import("./profile_settings"))} /> <Route path="/settings" component={lazy(() => import("./profile_settings"))} />
<Route path="/tasks" component={lazy(() => import("./profile_tasks"))} /> <Route path="/tasks" component={lazy(() => import("./profile_tasks"))} />
<Route path="/calendar" component={lazy(() => import("./calendar"))} /> <Route path="/calendar" component={lazy(() => import("./profile_calendar"))} />
<Route <Route
default default
component={() => { component={() => {

View File

@@ -0,0 +1,17 @@
import BigCalendar from "@/components/calendar";
import { withTitle } from "@/constructors/Component";
import { UrlsTitle } from "@/enums/urls";
import { FunctionComponent } from "preact";
const ProfileCalendar: FunctionComponent = () => {
const onDateSelect = (date: Date) => {
console.log(date);
};
return (
<div class="flex w-full flex-col items-center">
<BigCalendar onDateSelect={onDateSelect} />
</div>
);
};
export default withTitle(UrlsTitle.CALENDAR, ProfileCalendar);