INSTALL
This is simple Create React App
application. Run yarn
(npm i
) and yarn start
(npm run start
) in order to install dependencies and to run application;
FEATURES
- Messages list is reversed. To show new messages ast the bottom of the list;
- You can send new message on
enter
, however onshift + enter
you can add new line; - User is hardcoder by default to
{ id: 1 }
, but you can change the user by adding to the query string:http://localhost:3000/?userId=2
; - When you hit
enter
to send a new message UI doesn't wait response from a server. it was done intentionally to show someOptimistic
UI approach; - Selected chat is highlighted.
- Date format internationalization.
- BEM naming convetion for the styles.
- Will work on last 1 version of: Edge, Firefox, Chrome.
WHAT TO IMPROVE
- There is not much of decomposition, because app itself quite small and simple. The only component that I moved out of the
App
isInput
component. BecauseInput
was sharing state withApp
and affected the performance of the whole app; - It would be nice to add
Proptypes
orTypescript
to describe data structures in the app more eloquently; - This app could have been implemented using
Websockets
to make this app more responsive and reactive; - Missing
esLint
config; - No tests though, sorry :)