Skip to content

Commit c5f00c5

Browse files
committed
feat(chat): expose header slots & remove header component
1 parent e175353 commit c5f00c5

4 files changed

Lines changed: 71 additions & 131 deletions

File tree

src/components/chat/chat-header.ts

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/chat/chat.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { LitElement, html } from 'lit';
22
import { property } from 'lit/decorators.js';
3+
import IgcButtonComponent from '../button/button.js';
34
import { registerComponent } from '../common/definitions/register.js';
45
import type { Constructor } from '../common/mixins/constructor.js';
56
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
6-
import IgcChatHeaderComponent from './chat-header.js';
77
import IgcChatInputComponent from './chat-input.js';
88
import IgcChatMessageListComponent from './chat-message-list.js';
99
import { styles } from './themes/chat.base.css.js';
@@ -37,9 +37,9 @@ export default class IgcChatComponent extends EventEmitterMixin<
3737
public static register() {
3838
registerComponent(
3939
IgcChatComponent,
40-
IgcChatHeaderComponent,
4140
IgcChatInputComponent,
42-
IgcChatMessageListComponent
41+
IgcChatMessageListComponent,
42+
IgcButtonComponent
4343
);
4444
}
4545

@@ -186,7 +186,15 @@ export default class IgcChatComponent extends EventEmitterMixin<
186186
protected override render() {
187187
return html`
188188
<div class="chat-container">
189-
<igc-chat-header .text=${this.headerText}></igc-chat-header>
189+
<div class="header" part="header">
190+
<div class="info">
191+
<slot name="prefix" part="prefix"></slot>
192+
<slot name="title" part="title">${this.headerText}</slot>
193+
</div>
194+
<slot name="actions" class="actions">
195+
<igc-button variant="flat"></igcbutton>
196+
</slot>
197+
</div>
190198
<igc-chat-message-list
191199
.messages=${this.messages}
192200
.user=${this.user}

src/components/chat/themes/chat.base.scss

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,63 @@
1515
display: flex;
1616
flex-direction: column;
1717
height: 100%;
18+
}
19+
20+
.header {
21+
display: flex;
22+
align-items: center;
23+
justify-content: space-between;
24+
padding: 10px;
25+
}
26+
27+
.info {
28+
display: flex;
29+
align-items: center;
30+
gap: 12px;
31+
}
32+
33+
.avatar {
34+
width: 40px;
35+
height: 40px;
36+
border-radius: 50%;
37+
object-fit: cover;
38+
}
39+
40+
.avatar-container {
41+
position: relative;
42+
}
43+
44+
.status-indicator {
45+
position: absolute;
46+
bottom: 0;
47+
right: 0;
48+
width: 12px;
49+
height: 12px;
50+
border-radius: 50%;
51+
background-color: #30D158;
52+
border: 2px solid white;
53+
}
54+
55+
.actions {
56+
display: flex;
57+
gap: 16px;
58+
}
59+
60+
.action-button {
61+
background: none;
62+
border: none;
63+
color: #0A84FF;
64+
cursor: pointer;
65+
font-size: 1.2rem;
66+
display: flex;
67+
align-items: center;
68+
justify-content: center;
69+
width: 40px;
70+
height: 40px;
71+
border-radius: 50%;
72+
transition: white 0.2s;
73+
}
74+
75+
.action-button:hover {
76+
background-color: #E5E5EA;
1877
}

src/components/chat/themes/header.base.scss

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)