diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 0eb72257..be964795 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -40262,6 +40262,659 @@ exports[`Storyshots Message list message 1`] = ` + + Colored attachments + + + + + + + + + + + + + + + + + diego.mello + + + + 10:00 AM + + + + + + + + + Field 1 + + + Value 1 + + + + + Field 2 + + + Value 2 + + + + + + + + + + + Field 1 + + + Value 1 + + + + + Field 2 + + + Value 2 + + + + + + + + + + + Field 1 + + + Value 1 + + + + + Field 2 + + + Value 2 + + + + + + + + + + 0 && styles.marginTop, attachment.description && styles.marginBottom, { - backgroundColor: themes[theme].chatComponentBackground, - borderColor: themes[theme].borderColor + backgroundColor: attachment.color ? transparentize(attachment.color, 0.80) : themes[theme].chatComponentBackground, + borderColor: attachment.color || themes[theme].borderColor } ]} background={Touchable.Ripple(themes[theme].bannerBackground)} diff --git a/package.json b/package.json index 901e7095..767faa33 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@rocket.chat/ui-kit": "0.13.0", "bugsnag-react-native": "2.23.10", "bytebuffer": "^5.0.1", + "color2k": "^1.2.2", "commonmark": "git+https://github.com/RocketChat/commonmark.js.git", "commonmark-react-renderer": "git+https://github.com/RocketChat/commonmark-react-renderer.git", "dequal": "^2.0.2", diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index 7e8e0664..da1517a9 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -740,6 +740,44 @@ export default ({ theme }) => { }]} /> + + + alert('broadcast!')} /> diff --git a/yarn.lock b/yarn.lock index 633d519b..2938649e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5140,6 +5140,11 @@ color-support@^1.1.3: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== +color2k@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/color2k/-/color2k-1.2.2.tgz#468b98ae35141c802dcfa1fb594d396baaa052d3" + integrity sha512-uxfa7byLts8cg2EGGZB6ZJTcUOvQt9V6sNbaVf5luAFLFfVqfl1srPL88NMwVFrO/vpZnAUxRdBkiuVQ99lnHg== + color@^3.1.0: version "3.1.3" resolved "https://registry.yarnpkg.com/color/-/color-3.1.3.tgz#ca67fb4e7b97d611dcde39eceed422067d91596e"