You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
move name coloring out of sender profile
so we can reuse it in room preview bar
This commit is contained in:
@@ -58,3 +58,8 @@ export function hashCode(str) {
|
||||
}
|
||||
return Math.abs(hash);
|
||||
}
|
||||
|
||||
export function getUserNameColorClass(userId) {
|
||||
const colorNumber = (hashCode(userId) % 8) + 1;
|
||||
return `mx_Username_color${colorNumber}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user