2.8.0 • Published 1 month ago
@lskjs/chat v2.8.0
LSK CHAT
React components for internationalization
Just press on t and take a result from @lskjs/chat. Or in reverse.
Installation and usage
The easiest way to use is to install it from npm and build it into your app with Webpack.
npm install @lskjs/chat
Then use it in your app:
import Chat from '@lskjs/chat';
class ChatComponent extends React.Component {
state = {
messages: [],
};
constructor() {
super();
serverMessages.forEach((serverMessage) => {
const { messages } = this.state;
const timeout = serverMessage.createdAt - Date.now();
setTimeout(() => {
// this.state.messages.push(serverMessage);
this.setState({
messages: [...messages, serverMessage],
});
}, timeout);
});
}
render() {
const { messages } = this.state;
return <Chat items={messages} userId={2} />;
}
}
export default ({ storiesOf }) => {
return storiesOf('chat/Chat').add('Chat', () => (
<Story>
<ChatComponent />
</Story>
));
};
For more examples and usage, please refer
Examples
See the more examples in Storybook.
More info
Links
Contact
Contributors ✨
Thanks goes to these wonderful people (emoji key):
License
This project is licensed under the MIT License - see the LICENSE file for details
Inspired by
- i18next
- mobx
- mobx-provider
Contributing
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
2.8.0
1 month ago
2.7.5
2 months ago
2.7.0
2 years ago
2.6.3
2 years ago
2.5.3
3 years ago
2.5.2
3 years ago
2.5.1
3 years ago
2.4.0-beta.1
3 years ago
2.3.0-beta.15
3 years ago
2.3.0-beta.17
3 years ago
2.3.0-beta.10
3 years ago
2.3.0-beta.6
3 years ago
2.3.0-beta.4
3 years ago
2.0.0-beta.2
3 years ago
1.36.10
3 years ago
1.34.2
3 years ago
1.34.1
3 years ago
1.33.0
3 years ago