From fcb73aaf43e6db03544e27010c9dfb2e8108e0bc Mon Sep 17 00:00:00 2001 From: rizky Date: Tue, 20 Aug 2024 02:49:12 -0700 Subject: [PATCH] fix flow --- comps/custom/Datepicker/components/Calendar/Days.tsx | 2 +- comps/custom/Datepicker/components/Calendar/index.tsx | 5 ++--- comps/ui/flow.tsx | 5 +++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/comps/custom/Datepicker/components/Calendar/Days.tsx b/comps/custom/Datepicker/components/Calendar/Days.tsx index 0c4e233..33c8c0d 100755 --- a/comps/custom/Datepicker/components/Calendar/Days.tsx +++ b/comps/custom/Datepicker/components/Calendar/Days.tsx @@ -365,7 +365,7 @@ const Days: React.FC = ({ type="button" key={index} disabled={isDateDisabled(item, "current")} - className={`${buttonClass(item, "current")}`} + className={cx(`${buttonClass(item, "current")}`, item === 1 && "highlight")} onClick={() => handleClickDay(item, "current")} onMouseOver={() => { hoverDay(item, "current"); diff --git a/comps/custom/Datepicker/components/Calendar/index.tsx b/comps/custom/Datepicker/components/Calendar/index.tsx index 111607b..de6086c 100755 --- a/comps/custom/Datepicker/components/Calendar/index.tsx +++ b/comps/custom/Datepicker/components/Calendar/index.tsx @@ -116,7 +116,7 @@ const Calendar: React.FC = ({ setShowMonths(!showMonths); } else { hideDatepicker(); - clickDay(1,month, date.year() ); + clickDay(1, month, date.year()); } }, 250); }, @@ -130,7 +130,7 @@ const Calendar: React.FC = ({ setShowYears(!showYears); if (mode === "monthly") { setShowMonths(true); - clickDay(1,date.month() + 1, year ); + clickDay(1, date.month() + 1, year); } }, 250); }, @@ -339,7 +339,6 @@ const Calendar: React.FC = ({ )} -
{showMonths && ( string); }> = ({ PassProp, children, flow, props, active }) => { + const active_str = typeof active === "function" ? active() : active; + const active_idx = flow.findIndex(e=> e.text === active_str) + return (
{flow.map((item, idx) => { @@ -17,7 +20,9 @@ export const Flow: FC<{ idx={idx} key={idx} active={active} + active_idx={active_idx} is_last={idx === flow.length - 1} + is_first={idx === 0} > {children}