Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(chat): remove layout component and allow styling slots #518

Merged
merged 7 commits into from
Nov 26, 2018

Conversation

bmdalex
Copy link
Collaborator

@bmdalex bmdalex commented Nov 22, 2018

feat(chat): remove layout component and allow styling slots

Description

This PR includes the following changes:

1. Refactors the render function for Chat.Message component to not use Layout component

Layout component does not allow the users to achieve proper styling of slots and it introduces a lot of unnecessary DOM nodes; we are using Slot instead.

2. Reduces the size of the tree for Chat.Message by 50% (from 6 to 3):

  • before:
    screenshot 2018-11-22 at 16 19 34
  • after:
    screenshot 2018-11-22 at 16 18 38

3. Adds functionality for targeting all subcomponents of Chat.Message:

  • avatar;
  • messageBody than contains author, timestamp and content;

4. Docs example:

For showing the users the Chat.Message anatomy and how they can style every slot:
screenshot 2018-11-22 at 16 16 24

5. Styles (see short demo below):

  • for focusing the correct area (messageBody instead of the whole Chat.Message)
  • Teams theme styles for focus outline for messageBody;
  • Teams theme styles for focus underline for links.
    key-nav

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #518 into master will decrease coverage by 0.14%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #518      +/-   ##
==========================================
- Coverage   88.32%   88.17%   -0.15%     
==========================================
  Files          42       42              
  Lines        1456     1455       -1     
  Branches      212      212              
==========================================
- Hits         1286     1283       -3     
- Misses        165      167       +2     
  Partials        5        5
Impacted Files Coverage Δ
src/components/Chat/ChatMessage.tsx 96.22% <100%> (-0.07%) ⬇️
src/components/Chat/Chat.tsx 91.66% <66.66%> (ø) ⬆️
src/components/Layout/Layout.tsx 94% <0%> (-4%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83bccfb...3cada1c. Read the comment docs.

@bmdalex bmdalex added this to Bugaa92 in Core Team Nov 22, 2018
CHANGELOG.md Show resolved Hide resolved
@bmdalex bmdalex added the help wanted Extra attention is needed label Nov 22, 2018
Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any other comments, LGTM 👍

Core Team automation moved this from Bugaa92 to bcalvery Nov 26, 2018
Copy link
Contributor

@kuzhelov kuzhelov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, take a look on the comment related to message body's styles - other than that everything looks fine to me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed 🚀 ready for review
Projects
No open projects
Core Team
  
bcalvery
Development

Successfully merging this pull request may close these issues.

None yet

6 participants