diff --git a/__tests__/__snapshots__/Storyshots.test.js.snap b/__tests__/__snapshots__/Storyshots.test.js.snap index 8b698bc0..ae844bbb 100644 --- a/__tests__/__snapshots__/Storyshots.test.js.snap +++ b/__tests__/__snapshots__/Storyshots.test.js.snap @@ -41357,6 +41357,85 @@ exports[`Storyshots Message list message 1`] = ` + + + + + + Invalid color + + + + + diff --git a/app/containers/message/Reply.js b/app/containers/message/Reply.js index caa80039..698eec94 100644 --- a/app/containers/message/Reply.js +++ b/app/containers/message/Reply.js @@ -158,6 +158,16 @@ const Reply = React.memo(({ openLink(url, theme); }; + let { borderColor, chatComponentBackground: backgroundColor } = themes[theme]; + try { + if (attachment.color) { + backgroundColor = transparentize(attachment.color, 0.80); + borderColor = attachment.color; + } + } catch (e) { + // fallback to default + } + return ( <> 0 && styles.marginTop, attachment.description && styles.marginBottom, { - backgroundColor: attachment.color ? transparentize(attachment.color, 0.80) : themes[theme].chatComponentBackground, - borderColor: attachment.color || themes[theme].borderColor + backgroundColor, borderColor } ]} background={Touchable.Ripple(themes[theme].bannerBackground)} diff --git a/storybook/stories/Message.js b/storybook/stories/Message.js index ac5181d8..e4dbf6e2 100644 --- a/storybook/stories/Message.js +++ b/storybook/stories/Message.js @@ -775,6 +775,12 @@ export default ({ theme }) => { value: 'Value 2', short: true }] + }, { + color: 'ASDASD', + fields: [{ + title: 'Invalid color', + short: true + }] }]} />