We want to add an emoji picker to our message form. Add this by using a single file component. It should use $emit
to add the emoji to the message text.
You may not use window.chat
in chat-section
and search-sidebar
anymore. Use props to pass down messages. Also use $emit
to add a new message in App
.
Add a vuex store to the application. Make it possible to store messages and the user in it.
Messages and the user should be stored in the store. Create mutations to modify the store and use mapState
and mapMutations
to use them in the components. Make sure window.chat
is not used for messages or the user anymore.
Connect the application to the api by using actions in the store. Get the messages and put them in the store using a mutation.
Make it possible to navigate between channels. Add routes to pass down the ID of the channel and load the corresponding messages.
Write a unit tests for the message-field component according to the requirements:
- emits the message when pressing enter
- allows you to add emoji’s
- clears the text after it has been submitted
Handle errors in chat-section
using errorCaptured
.