This unit cover some more advanced techniques
In this unit the layout components were refactored to include the actual look&feel and also to gain access to dedicated context used as state management. As mentioned earlier we will not discuss about the implementation of the state management as it will be covered in the following course.
IMPORTANT: This unit introduce two types of components, smart and dump components. You are adviced not to change the type of the components. if a component is wrapped with High order component (HOC) it means that it has access to the context, all other component should be treated as dump components.
NOTICE: before you start working, please checkout branch intermediate-2 and use it to develop this unit tasks
This task is not personal and should be completed together during a joined session with the trainer.
- review together changes done in plop templates and in many app components to consume channels context
You can continue your work or checkout and continue with branch intermediate-2.1
This ticket modifies
UserProfile
component
- show your avatar using
ChannelsService.user
and@material-ui/core/Avatar
Once completed, you can review the suggested solution here
You can continue your work or checkout and continue with branch intermediate-2.2
This ticket modifies
ChannelList
component
- use component
ChannelSection
to show user channels - use another component of
ChannelSection
to show available channels - show refresh button on available channels and refresh list when clicked
- note that the component already support refresh api, see component props
- (bonus) check automatically for updates every 10 seconds
- clicking on a channel should activate it using relevant api in
ChannelsService
Once completed, you can review the suggested solution here
You can continue your work or checkout and continue with branch intermediate-2.3
This ticket modifies
ChannelView
component
- in
ChannelView
showempty.svg
if no active channel selected. - in
ChannelView
showChannelMessages
andMessageCreate
if has active channel. - in
ChannelMessages
fillrenderMessages
to render all messages withChannelMessage
- in
ChannelMessage
usemoment
api support to show time from now. see moment documentation
Once completed, you can review the suggested solution here
You can continue your work or checkout and continue with branch intermediate-2.4
This ticket modifies
ChannelHeader
component
- show empty header until has connected user
- show actual channel name
- show the edit name button only on hover (onMouseEnter, onMouseLeave)
- the edit logic will be handled in another ticket
Once completed, you can review the suggested solution here
You can continue your work or checkout and continue with branch intermediate-2.5
This ticket modifies
ChannelCreate
component
- open modal component when clicked
- discard changes if modal closed
- create channel if modal approved
- use
_newChannelInputRef
to get the value from the modal input
- use
Once completed, you can review the suggested solution here
You can continue your work or checkout and continue with branch intermediate-2.6
This ticket modifies
ChannelList
component
- sort list of channels in each section. Make sure the sort is done in the component, no need to modify the channels context.
This ticket modifies
ChannelHeader
component
- open material-ui modal when clicking on channel name and use relevant api in
ChannelsService
to change name in server.
- uncontrolled component
- material-ui modal
- onMouseLeave / onMouseEnter
- smart/dump components