add mxid color toggle

This commit is contained in:
Ajay Bura
2024-09-20 11:20:46 +05:30
parent 21164a9b61
commit c69236ff79
9 changed files with 115 additions and 54 deletions

View File

@@ -48,6 +48,7 @@ export const ThreadIndicator = as<'div'>(({ ...props }, ref) => (
type ReplyProps = {
mx: MatrixClient;
room: Room;
mxidColor?: boolean;
timelineSet?: EventTimelineSet | undefined;
replyEventId: string;
threadRootId?: string | undefined;
@@ -55,7 +56,7 @@ type ReplyProps = {
};
export const Reply = as<'div', ReplyProps>((_, ref) => {
const { mx, room, timelineSet, replyEventId, threadRootId, onClick, ...props } = _;
const { mx, room, mxidColor, timelineSet, replyEventId, threadRootId, onClick, ...props } = _;
const [replyEvent, setReplyEvent] = useState<MatrixEvent | null | undefined>(
timelineSet?.findEventById(replyEventId)
);
@@ -101,7 +102,7 @@ export const Reply = as<'div', ReplyProps>((_, ref) => {
)}
<ReplyLayout
as="button"
userColor={sender ? colorMXID(sender) : undefined}
userColor={sender && mxidColor ? colorMXID(sender) : undefined}
username={
sender && (
<Text size="T300" truncate>