Skip to content

Commit

Permalink
feat(chat-list): self property and gap and spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Dec 28, 2022
1 parent 0b1043a commit 9d9edca
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions ui/ui-kit/src/chat/chat-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class AlwatrChatList extends AlwatrDummyElement {
:host {
display: flex;
flex-direction: column;
padding: var(--md-sys-spacing-track-2) var(--md-sys-spacing-track-1) var(--md-sys-spacing-track-1);
gap: var(--md-sys-spacing-track-1);
padding: var(--md-sys-spacing-track-3) var(--md-sys-spacing-track-2) var(--md-sys-spacing-track-2);
gap: var(--md-sys-spacing-track-2);
color: var(--md-sys-color-on-surface-variant);
background-color: var(--md-sys-color-surface-variant);
}
Expand All @@ -49,19 +49,15 @@ export class AlwatrChatList extends AlwatrDummyElement {
@property({type: Object, attribute: false})
currentUser?: string;

@property({type: Boolean, attribute: 'end-side', reflect: true})
endSide = false;

override render(): unknown {
super.render();
if (this.storage == null) return nothing;
return html`${map(
this.storage.data,
(message) => html`
<alwatr-chat-message
dir="rtl"
.message=${message}
?end-side=${message.from !== this.currentUser}
?self=${message.from === this.currentUser}
></alwatr-chat-message>
`,
)}`;
Expand Down

0 comments on commit 9d9edca

Please sign in to comment.