DEV: adds chat-drawer-before-content plugin outlet (#28284)

This outlet is rendered before the content of the drawer. The `currentRouteName` is accessible in `outletArgs`.

Example:

```gjs
export default class Test extends Component {
  <template>
    {{#if (eq @outletArgs.currentRouteName "chat.browse")}}
      the browse page
    {{/if}}
  </template>
}
```
This commit is contained in:
Joffrey JAFFEUX 2024-08-08 22:46:55 +02:00 committed by GitHub
parent aeaae9babc
commit f87c2e7aa7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -11,6 +11,14 @@
>
<div class="chat-drawer-container">
<div class="chat-drawer-resizer"></div>
<PluginOutlet
@name="chat-drawer-before-content"
@outletArgs={{hash
currentRouteName=this.chatDrawerRouter.currentRouteName
}}
/>
<this.chatDrawerRouter.component
@params={{this.chatDrawerRouter.params}}
@openURL={{this.openURL}}

View File

@ -160,6 +160,7 @@ export default class ChatDrawerRouter extends Service {
@tracked component = null;
@tracked drawerRoute = null;
@tracked params = null;
@tracked currentRouteName = null;
routeNames = Object.keys(ROUTES);