fix flow
This commit is contained in:
parent
b8064504d6
commit
fcb73aaf43
|
|
@ -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");
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue