Skip to content

Commit

Permalink
adding initial code to reveal avatars and names
Browse files Browse the repository at this point in the history
  • Loading branch information
OvidijusParsiunas committed Sep 7, 2024
1 parent e217c97 commit 7898ff5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions component/src/views/chat/messages/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export class Avatar {
(innerContainer.getElementsByClassName(Avatar.CONTAINER_CLASS)[0] as HTMLElement).style.visibility ||= 'hidden';
}

public static reveal(innerContainer: HTMLElement) {
(innerContainer.getElementsByClassName(Avatar.CONTAINER_CLASS)[0] as HTMLElement).style.visibility = '';
}

private static applyCustomStylesToElements(container: HTMLElement, avatar: HTMLElement, style: AvatarStyles) {
Object.assign(container.style, style.container);
Object.assign(avatar.style, style.avatar);
Expand Down
4 changes: 4 additions & 0 deletions component/src/views/chat/messages/name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export class Name {
(innerContainer.getElementsByClassName(Name.NAME_CLASS)[0] as HTMLElement).style.visibility ||= 'hidden';
}

public static reveal(innerContainer: HTMLElement) {
(innerContainer.getElementsByClassName(Name.NAME_CLASS)[0] as HTMLElement).style.visibility = '';
}

private static getPosition(role: string, names: CustomNames) {
let position: NameT['position'] | undefined = names?.[role]?.position;
if (role !== MessageUtils.USER_ROLE) position ??= names?.ai?.position;
Expand Down

0 comments on commit 7898ff5

Please sign in to comment.