Skip to content

Commit

Permalink
feat(Message): support custom color for icon and title
Browse files Browse the repository at this point in the history
  • Loading branch information
ivawzh committed Oct 2, 2023
1 parent 64b37e3 commit c6dc366
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const BACKGROUNDS = [

const DEFAULT_PROPS = {
bg: "grey.t10",
contentColor: null,
hasBreakpointWidth: false,
};

Expand All @@ -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;
Expand Down

0 comments on commit c6dc366

Please sign in to comment.