{days.map((day, dayIdx) => (
;
+}
+
+export default WeekMode;
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumn.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumn.tsx
deleted file mode 100644
index 8fbe6c5..0000000
--- a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumn.tsx
+++ /dev/null
@@ -1,44 +0,0 @@
-import { cn } from "@/lib/utils";
-import { CalendarStateInterface } from "@/store/calendarState";
-import { engToMyanmarNumber } from "@/utils/engToMyanmarNumber";
-import { englishToMyanmarDate, i18n } from "burma-calendar";
-import React from "react";
-
-interface WeekColumnPropsI {
- day: Date;
- calendarState: CalendarStateInterface;
-}
-
-function WeekColumn({ day, calendarState }: WeekColumnPropsI) {
- const { preferance } = calendarState;
- const myanmar_calendar = englishToMyanmarDate(day);
- const mmDate = i18n(engToMyanmarNumber(myanmar_calendar.date), "myanmar", "myanmar" as any);
-
- return (
-
- {/*
-
- {myanmar_calendar.month}
- {myanmar_calendar.moonPhase} {mmDate}
-
-
*/}
- {/*
- {preferance.astro && (myanmar_calendar.pyathada || myanmar_calendar.yatyaza) && (
-
- {myanmar_calendar.pyathada || myanmar_calendar.yatyaza}
-
- )}
-
*/}
-
- );
-}
-
-export default WeekColumn;
-
-// function MainFeatureCell() {
-// return
-// }
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumnHead.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumnHead.tsx
deleted file mode 100644
index 98117c3..0000000
--- a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekColumnHead.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import { cn } from "@/lib/utils";
-import { setDayDialongTargetDay } from "@/store/modelControlState";
-import { engToMyanmarNumber } from "@/utils/engToMyanmarNumber";
-import { englishToMyanmarDate, i18n } from "burma-calendar";
-import { format, isToday, isWeekend } from "date-fns";
-import React from "react";
-import { useDispatch } from "react-redux";
-
-function WeekColumnHead({ day, scrollReachedTop }: { day: Date; scrollReachedTop: boolean }) {
- const dispatch = useDispatch();
- const dayIsToday = isToday(day);
- const myanmar_calendar = englishToMyanmarDate(day);
- const mmDate = i18n(engToMyanmarNumber(myanmar_calendar.date), "myanmar", "myanmar" as any);
-
- return (
-
-
-
{format(day, "iii")}
-
-
-
-
-
-
-
-
- );
-}
-
-export default WeekColumnHead;
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekMode.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekMode.tsx
deleted file mode 100644
index cde170d..0000000
--- a/apps/myanmar_calendar/src/components/layouts/Calendar/WeekMode/WeekMode.tsx
+++ /dev/null
@@ -1,71 +0,0 @@
-import React, { useState } from "react";
-import CommingSoonBanner from "../CommingSoonBanner";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
-import { eachDayOfInterval, endOfWeek, format, isToday, startOfWeek } from "date-fns";
-import { ScrollArea, ScrollBar, ScrollViewport } from "@/components/ui/areas/ScrollArea";
-import useScrollEvent from "@/hooks/useScrollEvent";
-import { cn } from "@/lib/utils";
-import { setDayDialongTargetDay } from "@/store/modelControlState";
-import WeekColumn from "./WeekColumn";
-import WeekColumnHead from "./WeekColumnHead";
-
-function WeekMode() {
- const dispatch = useDispatch();
- const calendarState = useSelector((state: RootState) => state.calendarState);
-
- const days = eachDayOfInterval({
- start: startOfWeek(new Date(calendarState.activeDate)),
- end: endOfWeek(new Date(calendarState.activeDate)),
- });
-
- // Scroll Events Handling
- const [scrollReachedTop, setScrollReachedTop] = useState(true);
-
- const scrollViewportRef = useScrollEvent(({ offsetHeight, scrollHeight, scrollTop }) => {
- if (scrollTop < 7) {
- setScrollReachedTop(true);
- } else {
- setScrollReachedTop(false);
- }
- });
-
- // console.log("WeekMode render");
-
- return (
- <>
-
- {days.map((day) => (
-
- ))}
-
-
-
-
- {days.map((day) => {
- return (
-
- );
- })}
-
-
-
-
- >
- );
-}
-
-export default WeekMode;
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode.tsx
new file mode 100644
index 0000000..f6ba7e9
--- /dev/null
+++ b/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode.tsx
@@ -0,0 +1,8 @@
+import React from "react";
+import CommingSoonBanner from "./CommingSoonBanner";
+
+function YearMode() {
+ return
;
+}
+
+export default YearMode;
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearCell.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearCell.tsx
deleted file mode 100644
index 5d451f7..0000000
--- a/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearCell.tsx
+++ /dev/null
@@ -1,79 +0,0 @@
-import { cn } from "@/lib/utils";
-import { RootState } from "@/store";
-import { setActiveDate, setCalendarMode } from "@/store/calendarState";
-import { setDayDialongTargetDay } from "@/store/modelControlState";
-import { CALENDAR_MODE_ENUM } from "@/type-models/calendarState.type";
-import { CALENDAR_MODE, MIN_WIDTHS, WEEK_DAYS } from "@/utils/constants";
-import { eachDayOfInterval, endOfMonth, endOfWeek, format, isSameMonth, isThisMonth, isToday, nextDay, startOfMonth, startOfWeek } from "date-fns";
-import React, { useState } from "react";
-import { useDispatch, useSelector } from "react-redux";
-
-function YearCell({ month }: { month: Date }) {
- // let monthName = month.toLocaleString("en-US", { month: "long" });
-
- const enterMobileMode = useSelector((state: RootState) => state.systemState.enterMobileMode);
- const dispatch = useDispatch();
- const endOfTheMonth = endOfMonth(month);
-
- let days = eachDayOfInterval({
- start: startOfWeek(startOfMonth(month)),
- end: endOfWeek(nextDay(endOfTheMonth, 0)),
- });
-
- // const monthIsThisMonth = isThisMonth(month);
-
- const handleViewMonth = () => {
- dispatch(setCalendarMode(CALENDAR_MODE_ENUM.MONTH));
- dispatch(setActiveDate(month.toISOString()));
- };
-
- return (
-
- );
-}
-
-export default YearCell;
diff --git a/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearMode.tsx b/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearMode.tsx
deleted file mode 100644
index ca3f29c..0000000
--- a/apps/myanmar_calendar/src/components/layouts/Calendar/YearMode/YearMode.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { eachMonthOfInterval, endOfYear, startOfYear } from "date-fns";
-import YearCell from "./YearCell";
-import { useSelector } from "react-redux";
-import { RootState } from "@/store";
-
-function YearMode() {
- const { activeDate } = useSelector((state: RootState) => state.calendarState);
- const [activeDateObj, setActiveDateObj] = useState
(new Date());
- useEffect(() => {
- setActiveDateObj(new Date(activeDate));
- }, [activeDate]);
-
- const months = eachMonthOfInterval({
- start: startOfYear(activeDateObj),
- end: endOfYear(activeDateObj),
- });
-
- return (
-
- {months.map((month) => {
- return (
-
- );
- })}
-
- );
-}
-
-export default YearMode;
diff --git a/apps/myanmar_calendar/src/components/layouts/Navbar/ActiveDateIndicator.tsx b/apps/myanmar_calendar/src/components/layouts/Navbar/ActiveDateIndicator.tsx
index ff02be6..a377626 100644
--- a/apps/myanmar_calendar/src/components/layouts/Navbar/ActiveDateIndicator.tsx
+++ b/apps/myanmar_calendar/src/components/layouts/Navbar/ActiveDateIndicator.tsx
@@ -1,5 +1,4 @@
import { RootState } from "@/store";
-import { CALENDAR_MODE_ENUM } from "@/type-models/calendarState.type";
import { engToMyanmarNumber } from "@/utils/engToMyanmarNumber";
import { englishToMyanmarDate, i18n } from "burma-calendar";
import { add, format, startOfMonth } from "date-fns";
@@ -7,7 +6,7 @@ import React from "react";
import { useSelector } from "react-redux";
function ActiveDateIndicator() {
- const { activeDate, calendarLanguage, calendarMode } = useSelector((state: RootState) => state.calendarState);
+ const { activeDate, calendarLanguage } = useSelector((state: RootState) => state.calendarState);
const activeDateObj = new Date(activeDate);
@@ -17,24 +16,17 @@ function ActiveDateIndicator() {
-
-
+ {i18n("Ku", "english", calendarLanguage as any)} {i18n(englishToMyanmarDate(firstDayCurrentMonth).month, "myanmar", calendarLanguage as any)}
+ {" - "}
+ {i18n(englishToMyanmarDate(add(firstDayCurrentMonth, { months: 1 })).month, "myanmar", calendarLanguage as any)}
+
);
diff --git a/apps/myanmar_calendar/src/components/layouts/Navbar/CalendarModeSelectBox.tsx b/apps/myanmar_calendar/src/components/layouts/Navbar/CalendarModeSelectBox.tsx
index 0b17433..42b7f1f 100644
--- a/apps/myanmar_calendar/src/components/layouts/Navbar/CalendarModeSelectBox.tsx
+++ b/apps/myanmar_calendar/src/components/layouts/Navbar/CalendarModeSelectBox.tsx
@@ -1,27 +1,20 @@
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/selectBoxes/PrimarySelect";
import { RootState } from "@/store";
import { setCalendarMode } from "@/store/calendarState";
-import { CALENDAR_MODE_ENUM } from "@/type-models/calendarState.type";
-import { CALENDAR_MODE, MIN_WIDTHS } from "@/utils/constants";
-import React, { useEffect, useState } from "react";
+import { CALENDAR_MODE } from "@/utils/constants";
+import React, { useState } from "react";
import { BiCaretDown } from "react-icons/bi";
import { FaCalendarAlt } from "react-icons/fa";
import { useDispatch, useSelector } from "react-redux";
function CalendarModeSelectBox() {
const dispatch = useDispatch();
- const enterMobileMode = useSelector((state: RootState) => state.systemState.enterMobileMode);
const calendarMode = useSelector((state: RootState) => state.calendarState.calendarMode);
- const selectHandler = (value: CALENDAR_MODE_ENUM) => {
+ const selectHandler = (value) => {
dispatch(setCalendarMode(value));
};
- useEffect(() => {
- if (enterMobileMode) selectHandler(CALENDAR_MODE_ENUM.YEAR);
- }, [enterMobileMode]);
-
- if (enterMobileMode) return <>>;
return (