1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-07 12:13:45 +00:00

finish migrating toast module

This commit is contained in:
Vicki League
2025-06-25 09:50:12 -04:00
parent d4aa1c494b
commit 94d7f33718
3 changed files with 7 additions and 7 deletions

View File

@@ -8,7 +8,7 @@
<i aria-hidden="true" class="bwi tw-text-xl tw-py-1.5 tw-px-2.5 {{ iconClass }}"></i>
<div>
<span class="tw-sr-only">{{ variant() | i18n }}</span>
@if (title) {
@if (title(); as title) {
<p data-testid="toast-title" class="tw-font-semibold tw-mb-0">{{ title }}</p>
}
@for (m of messageArray; track m) {

View File

@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, Output, input } from "@angular/core";
import { Component, EventEmitter, Output, input } from "@angular/core";
import { IconButtonModule } from "../icon-button";
import { SharedModule } from "../shared";
@@ -41,10 +41,7 @@ export class ToastComponent {
readonly message = input.required<string | string[]>();
/** An optional title to display over the message. */
// TODO: Skipped for migration because:
// This input is used in a control flow expression (e.g. `@if` or `*ngIf`)
// and migrating would break narrowing currently.
@Input() title?: string;
title = input<string>();
/**
* The percent width of the progress bar, from 0-100

View File

@@ -11,7 +11,10 @@ export type ToastOptions = {
* The duration the toast will persist in milliseconds
**/
timeout?: number;
} & Pick<ToastComponent, "message" | "variant" | "title">;
message: ReturnType<ToastComponent["message"]>;
variant?: ReturnType<ToastComponent["variant"]>;
title?: ReturnType<ToastComponent["title"]>;
};
/**
* Presents toast notifications