Skip to content

Commit

Permalink
Merge pull request #179 from amansoni7477030/main
Browse files Browse the repository at this point in the history
max words functionality added for text input
  • Loading branch information
HenryHengZJ authored Jun 4, 2024
2 parents 4af5671 + 02c64c4 commit 0431caf
Show file tree
Hide file tree
Showing 12 changed files with 83 additions and 59 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ You can also customize chatbot with different configuration
backgroundColor: '#ffffff',
textColor: '#303235',
sendButtonColor: '#3B81F6',
maxWords: 50,
maxWordsWarningMessage: 'You exceeded the word limit. Please input less than 50 words.',
},
feedback: {
color: '#303235',
Expand Down
2 changes: 1 addition & 1 deletion dist/components/Bot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/components/inputs/textInput/components/TextInput.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type Props = {
setPreviews: Setter<unknown[]>;
onMicrophoneClicked: () => void;
handleFileChange: (event: FileEvent<HTMLInputElement>) => void;
maxWords?: number;
maxWordsWarningMessage?: string;
};
export declare const TextInput: (props: Props) => import("solid-js").JSX.Element;
export {};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dist/features/bubble/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export type TextInputTheme = {
textColor?: string;
placeholder?: string;
sendButtonColor?: string;
maxWords?: number;
maxWordsWarningMessage?: string;
};
export type UserMessageTheme = {
backgroundColor?: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/features/bubble/types.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web.js

Large diffs are not rendered by default.

10 changes: 2 additions & 8 deletions src/components/Bot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,6 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
};
}),
);

return (
<>
<div
Expand Down Expand Up @@ -1048,6 +1047,8 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
textColor={props.textInput?.textColor}
placeholder={props.textInput?.placeholder}
sendButtonColor={props.textInput?.sendButtonColor}
maxWords={props.textInput?.maxWords}
maxWordsWarningMessage={props.textInput?.maxWordsWarningMessage}
fontSize={props.fontSize}
disabled={loading() || (leadsConfig()?.status && !isLeadSaved())}
defaultValue={userInput()}
Expand All @@ -1071,10 +1072,3 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
</>
);
};

// type BottomSpacerProps = {
// ref: HTMLDivElement | undefined;
// };
// const BottomSpacer = (props: BottomSpacerProps) => {
// return <div ref={props.ref} class="w-full h-32" />;
// };
Loading

0 comments on commit 0431caf

Please sign in to comment.