discourse/plugins/chat/assets/stylesheets/common/chat-drawer.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

103 lines
2.1 KiB
SCSS

body.composer-open .chat-drawer-outlet-container {
bottom: 11px; // prevent height of grippie from obscuring ...is typing indicator
}
.chat-drawer-resizer {
position: absolute;
top: -5px;
width: 15px;
height: 15px;
z-index: z("composer", "content");
}
html:not(.rtl) {
.chat-drawer-resizer {
cursor: nwse-resize;
left: -5px;
}
}
html.rtl {
.chat-drawer-resizer {
cursor: nesw-resize;
right: -5px;
}
}
.chat-drawer-outlet-container {
// higher than timeline, lower than composer, lower than user card (bump up below)
z-index: z("usercard");
position: fixed;
right: var(--composer-right, 20px);
left: 0;
max-height: calc(100% - var(--header-offset) - 15px);
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
pointer-events: none !important;
bottom: 0;
box-sizing: border-box;
padding-bottom: var(--composer-height, 0);
transition: all 100ms ease-in;
transition-property: bottom, padding-bottom;
.rtl & {
left: var(--composer-right, 20px);
right: 0;
}
> * {
pointer-events: auto;
}
}
.chat-drawer {
align-self: flex-end;
width: 400px;
min-width: 250px !important; // important to override inline styles
max-width: calc(100% - var(--composer-right));
min-height: 300px !important; // important to override inline styles
.chat-drawer-container {
background: var(--secondary);
border: 1px solid var(--primary-low);
border-bottom: 0;
border-top-left-radius: var(--d-border-radius-large);
border-top-right-radius: var(--d-border-radius-large);
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.125);
box-sizing: border-box;
display: flex;
flex-direction: column;
position: relative;
overflow: hidden;
}
&.is-expanded {
.chat-drawer-container {
height: 100%;
}
}
&:not(.is-expanded) {
min-height: 0 !important;
height: auto !important;
}
.chat-channel,
.chat-thread,
.chat-thread-list {
height: 100%;
}
}
.chat-drawer-content {
@include chat-scrollbar();
box-sizing: border-box;
height: 100%;
min-height: 1px;
position: relative;
overflow-y: auto;
overscroll-behavior: contain;
}