mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
Merge pull request #441 from Hexastack/440-issue-missing-dynamic-maxinput-prop-in-quick-replies-input-component
Some checks failed
Build and Push Docker API Image / build-and-push (push) Has been cancelled
Build and Push Docker Base Image / build-and-push (push) Has been cancelled
Build and Push Docker NLU Image / build-and-push (push) Has been cancelled
Build and Push Docker UI Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker API Image / build-and-push (push) Has been cancelled
Build and Push Docker Base Image / build-and-push (push) Has been cancelled
Build and Push Docker NLU Image / build-and-push (push) Has been cancelled
Build and Push Docker UI Image / build-and-push (push) Has been cancelled
fix: update quick replies maxInput value
This commit is contained in:
commit
b8d8bfeaa6
@ -21,12 +21,14 @@ type QuickRepliesInput = {
|
|||||||
value: StdQuickReply[];
|
value: StdQuickReply[];
|
||||||
onChange: (patterns: StdQuickReply[]) => void;
|
onChange: (patterns: StdQuickReply[]) => void;
|
||||||
minInput?: number;
|
minInput?: number;
|
||||||
|
maxInput?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
const QuickRepliesInput: FC<QuickRepliesInput> = ({
|
const QuickRepliesInput: FC<QuickRepliesInput> = ({
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
minInput = 1,
|
minInput = 1,
|
||||||
|
maxInput = 11,
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslate();
|
const { t } = useTranslate();
|
||||||
const [quickReplies, setQuickReplies] = useState<
|
const [quickReplies, setQuickReplies] = useState<
|
||||||
@ -122,7 +124,7 @@ const QuickRepliesInput: FC<QuickRepliesInput> = ({
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
startIcon={<AddIcon />}
|
startIcon={<AddIcon />}
|
||||||
onClick={addInput}
|
onClick={addInput}
|
||||||
disabled={quickReplies.length > 10}
|
disabled={quickReplies.length >= maxInput}
|
||||||
>
|
>
|
||||||
{t("button.add_quick_reply")}
|
{t("button.add_quick_reply")}
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user