Skip to content

Commit 61243c6

Browse files
PM-21057 (#14631)
1 parent b56cfba commit 61243c6

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed

apps/browser/src/autofill/content/components/cipher/cipher-info.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ export function CipherInfo({ cipher, theme }: CipherInfoProps) {
2929
</span>
3030
3131
${login?.username
32-
? html`<span class=${cipherInfoSecondaryTextStyles(theme)}>${login.username}</span>`
32+
? html`<span title=${login.username} class=${cipherInfoSecondaryTextStyles(theme)}
33+
>${login.username}</span
34+
>`
3335
: null}
3436
</div>
3537
`;

apps/browser/src/autofill/content/components/notification/confirmation/body.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { html, nothing } from "lit";
33

44
import { Theme } from "@bitwarden/common/platform/enums";
55

6-
import { themes } from "../../constants/styles";
6+
import { spacing, themes } from "../../constants/styles";
77
import { Celebrate, Keyhole, Warning } from "../../illustrations";
88

99
import { NotificationConfirmationMessage } from "./message";
@@ -66,7 +66,7 @@ const iconContainerStyles = (error?: string) => css`
6666
}
6767
`;
6868
const notificationConfirmationBodyStyles = ({ theme }: { theme: Theme }) => css`
69-
gap: 16px;
69+
gap: ${spacing[4]};
7070
display: flex;
7171
align-items: center;
7272
justify-content: flex-start;

apps/browser/src/autofill/content/components/notification/confirmation/container.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function NotificationConfirmationContainer({
4343
type,
4444
}: NotificationConfirmationContainerProps) {
4545
const headerMessage = getHeaderMessage(i18n, type, error);
46-
const confirmationMessage = getConfirmationMessage(i18n, itemName, type, error);
46+
const confirmationMessage = getConfirmationMessage(i18n, type, error);
4747
const buttonText = error ? i18n.newItem : i18n.view;
4848
const buttonAria = chrome.i18n.getMessage("notificationViewAria", [itemName]);
4949

@@ -109,19 +109,13 @@ const notificationContainerStyles = (theme: Theme) => css`
109109
}
110110
`;
111111

112-
function getConfirmationMessage(
113-
i18n: I18n,
114-
itemName: string,
115-
type?: NotificationType,
116-
error?: string,
117-
) {
118-
const loginSaveConfirmation = chrome.i18n.getMessage("loginSaveConfirmation", [itemName]);
119-
const loginUpdatedConfirmation = chrome.i18n.getMessage("loginUpdatedConfirmation", [itemName]);
120-
112+
function getConfirmationMessage(i18n: I18n, type?: NotificationType, error?: string) {
121113
if (error) {
122114
return i18n.saveFailureDetails;
123115
}
124-
return type === NotificationTypes.Add ? loginSaveConfirmation : loginUpdatedConfirmation;
116+
return type === NotificationTypes.Add
117+
? i18n.loginSaveConfirmation
118+
: i18n.loginUpdatedConfirmation;
125119
}
126120

127121
function getHeaderMessage(i18n: I18n, type?: NotificationType, error?: string) {

apps/browser/src/autofill/content/components/notification/confirmation/message.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { html, nothing } from "lit";
33

44
import { Theme } from "@bitwarden/common/platform/enums";
55

6-
import { themes, typography } from "../../constants/styles";
6+
import { spacing, themes, typography } from "../../constants/styles";
77

88
export type NotificationConfirmationMessageProps = {
99
buttonAria?: string;
@@ -18,15 +18,17 @@ export type NotificationConfirmationMessageProps = {
1818
export function NotificationConfirmationMessage({
1919
buttonAria,
2020
buttonText,
21+
itemName,
2122
message,
2223
messageDetails,
2324
handleClick,
2425
theme,
2526
}: NotificationConfirmationMessageProps) {
2627
return html`
27-
<div>
28+
<div class=${containerStyles}>
2829
${message || buttonText
2930
? html`
31+
<span class=${itemNameStyles(theme)} title=${itemName}> ${itemName} </span>
3032
<span
3133
title=${message || buttonText}
3234
class=${notificationConfirmationMessageStyles(theme)}
@@ -57,8 +59,15 @@ export function NotificationConfirmationMessage({
5759
`;
5860
}
5961

62+
const containerStyles = css`
63+
display: flex;
64+
flex-wrap: wrap;
65+
align-items: center;
66+
gap: ${spacing[1]};
67+
width: 100%;
68+
`;
69+
6070
const baseTextStyles = css`
61-
flex-grow: 1;
6271
overflow-x: hidden;
6372
text-align: left;
6473
text-overflow: ellipsis;
@@ -74,6 +83,15 @@ const notificationConfirmationMessageStyles = (theme: Theme) => css`
7483
font-weight: 400;
7584
`;
7685

86+
const itemNameStyles = (theme: Theme) => css`
87+
${baseTextStyles}
88+
89+
color: ${themes[theme].text.main};
90+
font-weight: 400;
91+
white-space: nowrap;
92+
max-width: 300px;
93+
`;
94+
7795
const notificationConfirmationButtonTextStyles = (theme: Theme) => css`
7896
${baseTextStyles}
7997

apps/browser/src/autofill/content/components/notification/header.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { html } from "lit";
44
import { Theme, ThemeTypes } from "@bitwarden/common/platform/enums";
55

66
import { CloseButton } from "../buttons/close-button";
7-
import { themes } from "../constants/styles";
7+
import { spacing, themes } from "../constants/styles";
88
import { BrandIconContainer } from "../icons/brand-icon-container";
99

1010
import { NotificationHeaderMessage } from "./header-message";
@@ -47,7 +47,7 @@ const notificationHeaderStyles = ({
4747
standalone: boolean;
4848
theme: Theme;
4949
}) => css`
50-
gap: 8px;
50+
gap: ${spacing[2]};
5151
display: flex;
5252
align-items: center;
5353
justify-content: flex-start;

apps/browser/src/autofill/content/components/rows/button-row.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function ButtonRow({ theme, primaryButton, selectButtons }: ButtonRowProp
5151
}
5252

5353
const buttonRowStyles = css`
54-
gap: 16px;
54+
gap: ${spacing[4]};
5555
display: flex;
5656
align-items: center;
5757
justify-content: space-between;

0 commit comments

Comments
 (0)