Skip to content

Commit

Permalink
Bug 1787521 - Adjust button for newtab save to pocket action r=thecou…
Browse files Browse the repository at this point in the history
…nt,fluent-reviewers,flod

Differential Revision: https://phabricator.services.mozilla.com/D155995
  • Loading branch information
gvn committed Sep 9, 2022
1 parent 817aa44 commit 8e0b6c3
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,12 @@ export class _DSCard extends React.PureComponent {
{this.props.context_type === "pocket" ? (
<>
<span className="story-badge-icon icon icon-pocket" />
<span data-l10n-id="newtab-pocket-saved-to-pocket" />
<span data-l10n-id="newtab-pocket-saved" />
</>
) : (
<>
<span className="story-badge-icon icon icon-pocket-save" />
<span data-l10n-id="newtab-pocket-save-to-pocket" />
<span data-l10n-id="newtab-pocket-save" />
</>
)}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ $ds-card-image-gradient-solid: rgba(0, 0, 0, 1);

.card-stp-button-position-wrapper {
position: absolute;
margin-top: -16px;
left: 0;
right: 0;
top: 50%;
inset-inline-end: 10px;
top: 10px;
display: flex;
justify-content: center;
justify-content: end;
align-items: center;
}

Expand All @@ -53,15 +51,13 @@ $ds-card-image-gradient-solid: rgba(0, 0, 0, 1);
height: 15px;
width: 15px;
background-size: 15px;
}

.icon-pocket {
fill: $pocket-icon-fill;
fill: $white;
}

.context-menu-button {
position: static;
transition: none;
border-radius: 3px;
}

.context-menu-position-container {
Expand All @@ -77,21 +73,16 @@ $ds-card-image-gradient-solid: rgba(0, 0, 0, 1);

.card-stp-button {
display: flex;
margin-inline-end: 12px;
margin-inline-end: 7px;
font-weight: 400;
font-size: 13px;
line-height: 16px;
background-color: var(--newtab-background-color-secondary);
background-color: $pocket-icon-fill;
border: 0;
border-radius: 4px;
padding: 8px;
padding: 6px;
white-space: nowrap;

&:hover {
.icon-pocket-save {
fill: $pocket-icon-fill;
}
}
color: $white;
}

button,
Expand Down
3 changes: 2 additions & 1 deletion browser/components/newtab/content-src/styles/_icons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
}

&.icon-pocket-save {
background-image: url('chrome://global/skin/icons/pocket-outline.svg');
background-image: url('chrome://global/skin/icons/pocket.svg');
fill: $white;
}

&.icon-pocket-delete {
Expand Down
26 changes: 11 additions & 15 deletions browser/components/newtab/css/activity-stream-linux.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ body[lwt-newtab-brighttext] {
background-image: url("chrome://global/skin/icons/pocket.svg");
}
.icon.icon-pocket-save {
background-image: url("chrome://global/skin/icons/pocket-outline.svg");
background-image: url("chrome://global/skin/icons/pocket.svg");
fill: #FFF;
}
.icon.icon-pocket-delete {
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-pocket-delete-16.svg");
Expand Down Expand Up @@ -3292,12 +3293,10 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button-position-wrapper {
position: absolute;
margin-top: -16px;
left: 0;
right: 0;
top: 50%;
inset-inline-end: 10px;
top: 10px;
display: flex;
justify-content: center;
justify-content: end;
align-items: center;
}
.ds-card .card-stp-button-hover-background .icon-pocket-save,
Expand All @@ -3306,13 +3305,12 @@ main.has-snippet {
height: 15px;
width: 15px;
background-size: 15px;
}
.ds-card .card-stp-button-hover-background .icon-pocket {
fill: #EF4056;
fill: #FFF;
}
.ds-card .card-stp-button-hover-background .context-menu-button {
position: static;
transition: none;
border-radius: 3px;
}
.ds-card .card-stp-button-hover-background .context-menu-position-container {
position: relative;
Expand All @@ -3325,18 +3323,16 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button {
display: flex;
margin-inline-end: 12px;
margin-inline-end: 7px;
font-weight: 400;
font-size: 13px;
line-height: 16px;
background-color: var(--newtab-background-color-secondary);
background-color: #EF4056;
border: 0;
border-radius: 4px;
padding: 8px;
padding: 6px;
white-space: nowrap;
}
.ds-card .card-stp-button-hover-background .card-stp-button:hover .icon-pocket-save {
fill: #EF4056;
color: #FFF;
}
.ds-card .card-stp-button-hover-background button,
.ds-card .card-stp-button-hover-background .context-menu {
Expand Down
26 changes: 11 additions & 15 deletions browser/components/newtab/css/activity-stream-mac.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ body[lwt-newtab-brighttext] {
background-image: url("chrome://global/skin/icons/pocket.svg");
}
.icon.icon-pocket-save {
background-image: url("chrome://global/skin/icons/pocket-outline.svg");
background-image: url("chrome://global/skin/icons/pocket.svg");
fill: #FFF;
}
.icon.icon-pocket-delete {
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-pocket-delete-16.svg");
Expand Down Expand Up @@ -3296,12 +3297,10 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button-position-wrapper {
position: absolute;
margin-top: -16px;
left: 0;
right: 0;
top: 50%;
inset-inline-end: 10px;
top: 10px;
display: flex;
justify-content: center;
justify-content: end;
align-items: center;
}
.ds-card .card-stp-button-hover-background .icon-pocket-save,
Expand All @@ -3310,13 +3309,12 @@ main.has-snippet {
height: 15px;
width: 15px;
background-size: 15px;
}
.ds-card .card-stp-button-hover-background .icon-pocket {
fill: #EF4056;
fill: #FFF;
}
.ds-card .card-stp-button-hover-background .context-menu-button {
position: static;
transition: none;
border-radius: 3px;
}
.ds-card .card-stp-button-hover-background .context-menu-position-container {
position: relative;
Expand All @@ -3329,18 +3327,16 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button {
display: flex;
margin-inline-end: 12px;
margin-inline-end: 7px;
font-weight: 400;
font-size: 13px;
line-height: 16px;
background-color: var(--newtab-background-color-secondary);
background-color: #EF4056;
border: 0;
border-radius: 4px;
padding: 8px;
padding: 6px;
white-space: nowrap;
}
.ds-card .card-stp-button-hover-background .card-stp-button:hover .icon-pocket-save {
fill: #EF4056;
color: #FFF;
}
.ds-card .card-stp-button-hover-background button,
.ds-card .card-stp-button-hover-background .context-menu {
Expand Down
26 changes: 11 additions & 15 deletions browser/components/newtab/css/activity-stream-windows.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ body[lwt-newtab-brighttext] {
background-image: url("chrome://global/skin/icons/pocket.svg");
}
.icon.icon-pocket-save {
background-image: url("chrome://global/skin/icons/pocket-outline.svg");
background-image: url("chrome://global/skin/icons/pocket.svg");
fill: #FFF;
}
.icon.icon-pocket-delete {
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-pocket-delete-16.svg");
Expand Down Expand Up @@ -3292,12 +3293,10 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button-position-wrapper {
position: absolute;
margin-top: -16px;
left: 0;
right: 0;
top: 50%;
inset-inline-end: 10px;
top: 10px;
display: flex;
justify-content: center;
justify-content: end;
align-items: center;
}
.ds-card .card-stp-button-hover-background .icon-pocket-save,
Expand All @@ -3306,13 +3305,12 @@ main.has-snippet {
height: 15px;
width: 15px;
background-size: 15px;
}
.ds-card .card-stp-button-hover-background .icon-pocket {
fill: #EF4056;
fill: #FFF;
}
.ds-card .card-stp-button-hover-background .context-menu-button {
position: static;
transition: none;
border-radius: 3px;
}
.ds-card .card-stp-button-hover-background .context-menu-position-container {
position: relative;
Expand All @@ -3325,18 +3323,16 @@ main.has-snippet {
}
.ds-card .card-stp-button-hover-background .card-stp-button {
display: flex;
margin-inline-end: 12px;
margin-inline-end: 7px;
font-weight: 400;
font-size: 13px;
line-height: 16px;
background-color: var(--newtab-background-color-secondary);
background-color: #EF4056;
border: 0;
border-radius: 4px;
padding: 8px;
padding: 6px;
white-space: nowrap;
}
.ds-card .card-stp-button-hover-background .card-stp-button:hover .icon-pocket-save {
fill: #EF4056;
color: #FFF;
}
.ds-card .card-stp-button-hover-background button,
.ds-card .card-stp-button-hover-background .context-menu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7761,11 +7761,11 @@ class _DSCard extends (external_React_default()).PureComponent {
}, this.props.context_type === "pocket" ? /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement("span", {
className: "story-badge-icon icon icon-pocket"
}), /*#__PURE__*/external_React_default().createElement("span", {
"data-l10n-id": "newtab-pocket-saved-to-pocket"
"data-l10n-id": "newtab-pocket-saved"
})) : /*#__PURE__*/external_React_default().createElement((external_React_default()).Fragment, null, /*#__PURE__*/external_React_default().createElement("span", {
className: "story-badge-icon icon icon-pocket-save"
}), /*#__PURE__*/external_React_default().createElement("span", {
"data-l10n-id": "newtab-pocket-save-to-pocket"
"data-l10n-id": "newtab-pocket-save"
}))), /*#__PURE__*/external_React_default().createElement(DSLinkMenu, {
id: this.props.id,
index: this.props.pos,
Expand Down
4 changes: 2 additions & 2 deletions browser/locales/en-US/browser/newtab/newtab.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ newtab-pocket-cta-text = Save the stories you love in { -pocket-brand-name }, an
newtab-pocket-pocket-firefox-family = { -pocket-brand-name } is part of the { -brand-product-name } family
# A save to Pocket button that shows over the card thumbnail on hover.
newtab-pocket-save-to-pocket = Save to { -pocket-brand-name }
newtab-pocket-saved-to-pocket = Saved to { -pocket-brand-name }
newtab-pocket-save = Save
newtab-pocket-saved = Saved
## Error Fallback Content.
## This message and suggested action link are shown in each section of UI that fails to render.
Expand Down

0 comments on commit 8e0b6c3

Please sign in to comment.