From c6dc3663dab16e70bdec5ecbefd39c607d9931c3 Mon Sep 17 00:00:00 2001 From: Ivan Wang Date: Mon, 2 Oct 2023 23:33:05 +1100 Subject: [PATCH] feat(Message): support custom color for icon and title --- src/components/Message.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/Message.js b/src/components/Message.js index 4650f99a..508d769a 100644 --- a/src/components/Message.js +++ b/src/components/Message.js @@ -35,6 +35,7 @@ const BACKGROUNDS = [ const DEFAULT_PROPS = { bg: "grey.t10", + contentColor: null, hasBreakpointWidth: false, }; @@ -61,15 +62,10 @@ function Message(props) { role, children, testId, + contentColor, } = mergedProps; const theme = useTheme(); - const textAndIconColor = [ - "highlight.pink.t100", - "highlight.purple.t100", - "primary.blue.t100", - ].includes(bg) - ? "white" - : "black"; + const textAndIconColor = contentColor || ([ "highlight.pink.t100", "highlight.purple.t100", "primary.blue.t100", ].includes(bg) ? "white" : "black"); const switchLayoutAt = "md"; const iconSize = 32; const distanceFromIcon = 8;