-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ps/pm 2910/browser header component (#6641)
* Collate browser header concerns into component Header component has a slots field with a left, center, right, and a right-most location for a current account, which will link to an account switcher. * Use feature flag if OK for production eventually * Make sure centered content centered * Allow for disabling header theming for login page visual gitches exist for links and buttons, due to specifications futher down in the header, but those items shouldn't use the `no-theme` option. For now, it's just for the login screen * Select sr-only headers * Fix vault-filter center header component * Correct hover for header buttons/links * Ensure no visual difference when flag is off
- Loading branch information
Showing
10 changed files
with
75 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
config/local.json | ||
|
||
# Safari | ||
dist-safari | ||
!src/safari/safari/app/popup/index.html | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<header [ngClass]="{ 'no-theme': noTheme }"> | ||
<div class="header-content"> | ||
<ng-content select=".sr-only"></ng-content> | ||
<ng-content select=".left"></ng-content> | ||
<ng-content select=".center"></ng-content> | ||
<div class="right"> | ||
<ng-content select=".right"></ng-content> | ||
<ng-container *ngIf="authedAccounts$ | async"> | ||
TODO: Current Account | ||
<!-- <app-current-account></app-current-account> --> | ||
</ng-container> | ||
</div> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Component, Input } from "@angular/core"; | ||
import { Observable, map } from "rxjs"; | ||
|
||
import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; | ||
import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authentication-status"; | ||
|
||
import { flagEnabled } from "../flags"; | ||
|
||
@Component({ | ||
selector: "app-header", | ||
templateUrl: "header.component.html", | ||
}) | ||
export class HeaderComponent { | ||
@Input() noTheme = false; | ||
authedAccounts$: Observable<boolean>; | ||
constructor(accountService: AccountService) { | ||
this.authedAccounts$ = accountService.accounts$.pipe( | ||
map((accounts) => { | ||
if (!flagEnabled("accountSwitching")) { | ||
return false; | ||
} | ||
|
||
return Object.values(accounts).some((a) => a.status !== AuthenticationStatus.LoggedOut); | ||
}) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters