From 7cccd02cb30453378fecfb6d51f225791ab6b918 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 30 Oct 2020 12:58:48 -0300 Subject: [PATCH] [IMPROVEMENT] Mentions layout without background (#2559) * [IMPROVEMENT] Mentions layout without background * Fix RoomItem * Fix tests --- .../__snapshots__/Storyshots.test.js.snap | 524 +++++++++++++++--- app/constants/colors.js | 13 +- app/containers/markdown/AtMention.js | 9 +- app/containers/markdown/Hashtag.js | 3 +- app/containers/markdown/styles.js | 4 +- app/presentation/UnreadBadge.js | 4 +- storybook/stories/Message.js | 15 + 7 files changed, 482 insertions(+), 90 deletions(-) diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index c27e4dce..d5231909 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -5291,13 +5291,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#ffe9ec", - "color": "#f5455c", + "color": "#DB0C27", }, ] } @@ -5338,13 +5335,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fff6d6", - "color": "#b68d00", + "color": "#DFAC00", }, ] } @@ -5384,13 +5378,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -5430,13 +5421,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -5534,13 +5522,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#ffe9ec", - "color": "#f5455c", + "color": "#DB0C27", }, ] } @@ -5581,13 +5566,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fff6d6", - "color": "#b68d00", + "color": "#DFAC00", }, ] } @@ -5627,13 +5609,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -5673,13 +5652,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -5777,13 +5753,10 @@ exports[`Storyshots Markdown list Markdown 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fff6d6", - "color": "#b68d00", + "color": "#DFAC00", }, ] } @@ -15971,13 +15944,10 @@ exports[`Storyshots Message list message 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fff6d6", - "color": "#b68d00", + "color": "#DFAC00", }, ] } @@ -16019,13 +15989,10 @@ exports[`Storyshots Message list message 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#ffe9ec", - "color": "#f5455c", + "color": "#DB0C27", }, ] } @@ -16066,13 +16033,10 @@ exports[`Storyshots Message list message 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -16113,13 +16077,10 @@ exports[`Storyshots Message list message 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fde8d7", - "color": "#f38c39", + "color": "#E26D0E", }, ] } @@ -16161,13 +16122,10 @@ exports[`Storyshots Message list message 1`] = ` "backgroundColor": "transparent", "fontFamily": "System", "fontSize": 16, - "fontWeight": "500", - "letterSpacing": 0.5, - "padding": 5, + "fontWeight": "600", }, Object { - "backgroundColor": "#fff6d6", - "color": "#b68d00", + "color": "#DFAC00", }, ] } @@ -16181,6 +16139,432 @@ exports[`Storyshots Message list message 1`] = ` + + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + + + + rocket.cat + + + Lorem ipsum dolor + + + diego.mello + + + sit amet, + + + all + + + consectetur adipiscing + + + here + + + elit, sed do eiusmod tempor + + + #general + + + incididunt ut labore et dolore magna aliqua. + + + + + + + + 0) { - backgroundColor = themes[theme].mentionMeColor; + backgroundColor = themes[theme].mentionMeBackground; } else if (groupMentions > 0) { - backgroundColor = themes[theme].mentionGroupColor; + backgroundColor = themes[theme].mentionGroupBackground; } return ( diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index dc7340b9..1da166ff 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -210,6 +210,21 @@ export default ({ theme }) => { name: 'general' }]} /> +