Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-chat-awesome
Advanced tools
The package can be installed via NPM:
npm install react-chat-awesome --save
Or YARN:
yarn add react-chat-awesome --save
import React, { Component } from 'react'
import { ChatAwesome } from 'react-chat-awesome'
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
history: []
}
this.sender = {
id: 1
}
this.receiver = {
id: 2,
imageUrl: 'path/to/source'
}
}
onSendMessageClick = (msgText) => {
this.setState({ history: [...this.state.history, {
id: +new Date(),
msg: {
type: 'text'
text: msgText
},
userID: this.sender.id
}]})
}
render() {
return (
<div>
<ChatAwesome
history={ this.state.history }
sender={ this.sender }
receiver={ this.receiver }
onSendMessageClick={ this.onSendMessageClick }
/>
</div>
);
}
}
ChatAwesome
is the only component you need to import.
*
- required prop
ChatAwesome props:
prop | type | description |
---|---|---|
*sender | object | person who interacts with the UI and types the message. |
*receiver | object | person who receives the messages and send responses to sender |
history | message[] | array of messages |
onSendMessageClick | function | callback function, executes when user send the message |
onMessageChange | function | callback function, executes when user type something |
onChatClose | function | callback on close button click |
onChatOpen | function | callback on open button click |
isOpen | boolean | programatically close/open chat (default false) |
showReceiverImageOnMessage | boolean | set if image should be displayed near each receiver message |
sendMessageIcon | string | url for alternative icon |
wrapperStyles | object | |
headerStyles | object | styles for chat header |
sendButtonStyles | object | styles for send button(not icon) |
bodyStyles | object | styles for messages wrapper |
footerStyles | object | styles for wrapper of the input field and chat button |
inputStyles | object | styles for input field |
closedChatStyles | object | styles for closed chat button |
headerNameStyles | object | styles for receiver name at the header |
{
id: number | string; // required
}
{
id: number | string; // required
imageUrl: string;
}
{
id: number | string;
userID: number | string;
msg: {
type: string;
text: string;
}
}
FAQs
Configurable react chat widget
The npm package react-chat-awesome receives a total of 6 weekly downloads. As such, react-chat-awesome popularity was classified as not popular.
We found that react-chat-awesome demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.