Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] file image upload #291

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,44 @@ coverage

# vscode
.vscode

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# config ide
.idea

#local config
/config/local.json
53 changes: 27 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,34 +143,35 @@ export default App;

#### Props

|prop|type|required|default value|description|
|---|--- |--- |--- |--- |
|**handleNewUserMessage**|(...args: any[]) => any|YES| |Function to handle the user input, will receive the full text message when submitted|
|**title**|string|NO|'Welcome'|Title of the widget|
|**subtitle**|string|NO|'This is your chat subtitle'|Subtitle of the widget|
|**senderPlaceHolder**|string|NO|'Type a message...'|The placeholder of the message input|
|**profileAvatar**|string|NO| |The profile image that will be set on the responses|
|**profileClientAvatar**|string|NO| |The profile image that will be set on the client messages|
|**titleAvatar**|string|NO| |The picture image that will be shown next to the chat title|
|**showCloseButton**|boolean|NO|false|Show or hide the close button in full screen mode|
|**fullScreenMode**|boolean|NO|false|Allow the use of full screen in full desktop mode|
|**autofocus**|boolean|NO|true|Autofocus or not the user input|
|prop|type|required|default value| description |
|---|--- |--- |--- |--------------------------------------------------------------------------------------|
|**handleNewUserMessage**|(...args: any[]) => any|YES| | Function to handle the user input, will receive the full text message when submitted |
|**title**|string|NO|'Welcome'| Title of the widget |
|**subtitle**|string|NO|'This is your chat subtitle'| Subtitle of the widget |
|**senderPlaceHolder**|string|NO|'Type a message...'| The placeholder of the message input |
|**profileAvatar**|string|NO| | The profile image that will be set on the responses |
|**profileClientAvatar**|string|NO| | The profile image that will be set on the client messages |
|**titleAvatar**|string|NO| | The picture image that will be shown next to the chat title |
|**showCloseButton**|boolean|NO|false| Show or hide the close button in full screen mode |
|**fullScreenMode**|boolean|NO|false| Allow the use of full screen in full desktop mode |
|**autofocus**|boolean|NO|true| Autofocus or not the user input |
|**launcher**|(handleToggle) => ElementType|NO||Custom Launcher component to use instead of the default|
|**handleQuickButtonClicked**|(...args: any[]) => any|NO||Function to handle the user clicking a quick button, will receive the 'value' when clicked.|
|**showTimeStamp**|boolean|NO|true|Show time stamp on messages|
|**chatId**|string|NO|'rcw-chat-container'|Chat container id for a11y|
|**handleToggle**|(...args: any[]) => any|NO|'rcw-chat-container'|Function to handle when the widget is toggled, will receive the toggle status|
|**launcherOpenLabel**|string|NO|'Open chat'|Alt value for the laucher when closed|
|**launcherCloseLabel**|string|NO|'Close chat'|Alt value for the laucher when open|
|**launcherOpenImg**|string|NO|''|local or remote image url, if not provided it will show default image|
|**launcherCloseImg**|string|NO|''|local or remote image url, if not provided it will show default image|
|**sendButtonAlt**|string|NO|'Send'|Send button alt for a11y purposes|
|**handleTextInputChange**|(event) => any|NO| |Prop that triggers on input change|
|**handleSubmit**|(event) => any|NO| |Prop that triggers when a message is submitted, used for custom validation|
|**resizable**|boolean|NO|false|Prop that allows to resize the widget by dragging it's left border|
|**emojis**|boolean|NO|false|enable emoji picker|
|**showBadge**|boolean|NO|true|Prop that allows to show or hide the unread message badge|

|**showTimeStamp**|boolean|NO|true| Show time stamp on messages |
|**chatId**|string|NO|'rcw-chat-container'| Chat container id for a11y |
|**handleToggle**|(...args: any[]) => any|NO|'rcw-chat-container'| Function to handle when the widget is toggled, will receive the toggle status |
|**launcherOpenLabel**|string|NO|'Open chat'| Alt value for the laucher when closed |
|**launcherCloseLabel**|string|NO|'Close chat'| Alt value for the laucher when open |
|**launcherOpenImg**|string|NO|''| local or remote image url, if not provided it will show default image |
|**launcherCloseImg**|string|NO|''| local or remote image url, if not provided it will show default image |
|**sendButtonAlt**|string|NO|'Send'| Send button alt for a11y purposes |
|**handleTextInputChange**|(event) => any|NO| | Prop that triggers on input change |
|**handleSubmit**|(event) => any|NO| | Prop that triggers when a message is submitted, used for custom validation |
|**resizable**|boolean|NO|false| Prop that allows to resize the widget by dragging it's left border |
|**emojis**|boolean|NO|false| enable emoji picker |
|**showBadge**|boolean|NO|true| Prop that allows to show or hide the unread message badge |
|**isShowEmoji**|boolean|NO|false| Prop that allows to show or hide emodji icons |
|**isShowFileUploader**|boolean|NO|true| Prop that allows to show or hide the file upload icon |
#### Styles

To change the styles you need the widget to have, simply override the CSS classes wrapping them within the containers and add your own style to them! All classes are prefixed with `rcw-` so they don't override your other classes in case you are not hasing them.
Expand Down
3 changes: 3 additions & 0 deletions assets/clip.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading