Use a numbered pre-named set of user colors instead of random. Closes #1974

This commit is contained in:
Gabe Kangas
2022-06-28 18:55:21 -07:00
parent c9938cf414
commit aec65af87d
9 changed files with 121 additions and 10 deletions

View File

@@ -22,8 +22,9 @@ export default function ChatUserMessage({
}: Props) {
const { body, user, timestamp } = message;
const { displayName, displayColor } = user;
const color = `hsl(${displayColor}, 100%, 65%)`;
const bgColor = `hsl(${displayColor}, 20%, 25%)`;
const color = `var(--theme-user-colors-${displayColor})`;
// TODO: Need to convert the above color to a background color.
const bgColor = `hsl(100, 20%, 25%)`;
const formattedTimestamp = `Sent at ${formatTimestamp(timestamp)}`;
const [formattedMessage, setFormattedMessage] = useState<string>(body);