1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-28 04:08:47 +02:00

[CL-167] Replace title slot with title-suffix for web header (#7571)

This commit is contained in:
Oscar Hinton 2024-01-18 11:45:48 +01:00 committed by GitHub
parent b84e12135b
commit 03c6037a9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -9,11 +9,7 @@
<div class="tw-flex">
<div class="tw-flex tw-min-w-0 tw-flex-1 tw-flex-col tw-gap-2">
<ng-content select="[slot=breadcrumbs]"></ng-content>
<div #titleContainer [ngClass]="{ 'tw-hidden': titleContainer.childElementCount === 0 }">
<ng-content select="[slot=title]"></ng-content>
</div>
<h1
*ngIf="titleContainer.childElementCount === 0"
bitTypography="h1"
noMargin
class="tw-m-0 tw-mr-2 tw-truncate tw-leading-10"
@ -21,6 +17,7 @@
>
<i *ngIf="icon" class="bwi {{ icon }}" aria-hidden="true"></i>
{{ title || (routeData.titleId | i18n) }}
<ng-content select="[slot=title-suffix]"></ng-content>
</h1>
</div>
<div class="tw-ml-auto tw-flex tw-flex-col tw-gap-4">

View File

@ -209,11 +209,11 @@ export const WithTabs: Story = (args) => ({
`,
});
export const WithCustomTitleComponent: Story = (args) => ({
export const WithTitleSuffixComponent: Story = (args) => ({
props: args,
template: `
<app-header title="Foobar" icon="bwi-bug" class="tw-text-main">
<h1 slot="title" class="tw-text-3xl tw-font-semibold" style="font-family: 'Comic Sans MS'">Bitwarden</h1>
<ng-container slot="title-suffix"><i class="bwi bwi-spinner bwi-spin"></i></ng-container>
</app-header>
`,
});