This commit is contained in:
rizky 2024-08-20 02:49:12 -07:00
parent b8064504d6
commit fcb73aaf43
3 changed files with 8 additions and 4 deletions

View File

@ -365,7 +365,7 @@ const Days: React.FC<Props> = ({
type="button" type="button"
key={index} key={index}
disabled={isDateDisabled(item, "current")} disabled={isDateDisabled(item, "current")}
className={`${buttonClass(item, "current")}`} className={cx(`${buttonClass(item, "current")}`, item === 1 && "highlight")}
onClick={() => handleClickDay(item, "current")} onClick={() => handleClickDay(item, "current")}
onMouseOver={() => { onMouseOver={() => {
hoverDay(item, "current"); hoverDay(item, "current");

View File

@ -116,7 +116,7 @@ const Calendar: React.FC<Props> = ({
setShowMonths(!showMonths); setShowMonths(!showMonths);
} else { } else {
hideDatepicker(); hideDatepicker();
clickDay(1,month, date.year() ); clickDay(1, month, date.year());
} }
}, 250); }, 250);
}, },
@ -130,7 +130,7 @@ const Calendar: React.FC<Props> = ({
setShowYears(!showYears); setShowYears(!showYears);
if (mode === "monthly") { if (mode === "monthly") {
setShowMonths(true); setShowMonths(true);
clickDay(1,date.month() + 1, year ); clickDay(1, date.month() + 1, year);
} }
}, 250); }, 250);
}, },
@ -339,7 +339,6 @@ const Calendar: React.FC<Props> = ({
</div> </div>
)} )}
</div> </div>
<div className={cx("c-mt-0.5 c-min-h-[285px]")}> <div className={cx("c-mt-0.5 c-min-h-[285px]")}>
{showMonths && ( {showMonths && (
<Months <Months

View File

@ -7,6 +7,9 @@ export const Flow: FC<{
props?: any; props?: any;
active?: string | (() => string); active?: string | (() => string);
}> = ({ PassProp, children, flow, props, active }) => { }> = ({ PassProp, children, flow, props, active }) => {
const active_str = typeof active === "function" ? active() : active;
const active_idx = flow.findIndex(e=> e.text === active_str)
return ( return (
<div {...props} className={cx(props.className, "c-flex-row")}> <div {...props} className={cx(props.className, "c-flex-row")}>
{flow.map((item, idx) => { {flow.map((item, idx) => {
@ -17,7 +20,9 @@ export const Flow: FC<{
idx={idx} idx={idx}
key={idx} key={idx}
active={active} active={active}
active_idx={active_idx}
is_last={idx === flow.length - 1} is_last={idx === flow.length - 1}
is_first={idx === 0}
> >
{children} {children}
</PassProp> </PassProp>