discourse/plugins/chat/assets/stylesheets/common/chat-navbar.scss
Joffrey JAFFEUX 53b96638c5
DEV: implements <Chat::Navbar /> (#24917)
This new navbar component is used for every navbar in chat, full page or drawer, and any screen.

This commit also uses this opportunity to correctly decouple drawer-routes from full page routes. This will avoid having this kind of properties in components: `@includeHeader={{false}}`. The header is now defined in the parent template using a navbar. Each route has now its own template wrapped in a div of the name of the route, eg: `<div class="c-routes-threads">..</div>`.

The navbar API:

```gjs
<Navbar as |navbar|>
 <navbar.BackButton />
 <navbar.Title @title="Foo" />
 <navbar.ChannelTitle @channel={{@channel}} />
 <navbar.Actions as |action|>
   <action.CloseThreadButton />
 </navbar.Actions>
</navbar>
```

The full list of components is listed in `plugins/chat/assets/javascripts/discourse/components/navbar/index.gjs` and `plugins/chat/assets/javascripts/discourse/components/navbar/actions.gjs`.

Visually the header is not changing much, only in drawer mode the background has been removed.

This commit also introduces a `<List />` component to facilitate rendering lists in chat plugin.
2023-12-18 17:49:58 +01:00

59 lines
1.0 KiB
SCSS

.c-navbar {
display: flex;
align-items: center;
width: 100%;
gap: 0.25rem;
&-container {
padding-inline: 0.5rem;
border-bottom: 1px solid var(--primary-low);
background: var(--secondary);
height: var(--chat-header-offset);
min-height: var(--chat-header-offset);
box-sizing: border-box;
display: flex;
z-index: z("composer", "content") - 1;
&.-clickable {
cursor: pointer;
}
}
.single-select-header {
padding: 0.3675rem 0.584rem;
}
.c-navbar__channel-title {
@include ellipsis();
font-weight: 700;
}
.c-navbar__title {
@include ellipsis();
font-weight: 700;
}
.c-navbar__sub-title {
line-height: var(--line-height-small);
font-size: var(--font-down-1-rem);
font-weight: normal;
}
.c-navbar__threads-list-button {
gap: 0.25rem;
&.has-unreads {
.d-icon-discourse-threads {
color: var(--tertiary);
}
}
}
}
.c-navbar__actions {
list-style: none;
margin-left: auto;
display: flex;
align-items: center;
}