Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/ChatInput/ChatInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Notes,
Attachment,
Forward,
BookOpen,
CannedResponses,
Comment thread
abhijithsheheer marked this conversation as resolved.
Down,
SendPlane,
Expand Down Expand Up @@ -149,6 +150,8 @@ export const ChatInput = forwardRef(
onChangeText = () => {},
onForward,
onCannedResponse,
onArticles,
showArticlesFor = [OPTION_TYPES.REPLY, OPTION_TYPES.NOTE],
Comment thread
abhijithsheheer marked this conversation as resolved.
toEmails: initialToEmails,
onReply = () => {},
onAddNote = () => {},
Expand Down Expand Up @@ -417,6 +420,16 @@ export const ChatInput = forwardRef(
onPress={onCannedResponse}
/>
)}
{onArticles && showArticlesFor.includes(selectedOption) && (
Comment thread
abhijithsheheer marked this conversation as resolved.
<IconButton
Comment thread
abhijithsheheer marked this conversation as resolved.
Icon={BookOpen}
opacity={0.5}
iconProps={{
size: moderateScale(30),
}}
onPress={onArticles}
/>
)}
<IconButton
{...(isLoading && {
iconProps: { color: "grey" },
Expand Down Expand Up @@ -520,6 +533,16 @@ ChatInput.propTypes = {
* Callback to be called on click of canned responses icon.
*/
onCannedResponse: PropTypes.func,
/**
* Callback to be called on click of articles icon. Icon is shown only when this is passed.
*/
onArticles: PropTypes.func,
/**
* Array for options to show the articles icon. Example: ["REPLY","NOTE"]
*/
showArticlesFor: PropTypes.arrayOf(
PropTypes.oneOf(Object.values(OPTION_TYPES))
),
/**
* Email list separated by comma.
*/
Expand Down