Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit c07082f

Browse files
committed
Bug 1670916 - Add placeholder icon for sponsored top sites. r=mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D93333
1 parent 72c025a commit c07082f

7 files changed

Lines changed: 37 additions & 6 deletions

File tree

browser/components/newtab/content-src/components/TopSites/TopSite.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,15 @@ export class TopSiteLink extends React.PureComponent {
261261
/>
262262
)}
263263
</div>
264-
<div className={`title ${link.isPinned ? "pinned" : ""}`}>
264+
<div
265+
className={`title${
266+
link.isPinned || link.sponsored_position ? " has-icon" : ""
267+
}${link.isPinned ? " pinned" : ""}`}
268+
>
265269
{link.isPinned && <div className="icon icon-pin-small" />}
270+
{link.sponsored_position && (
271+
<div className="icon icon-sponsored-small" />
272+
)}
266273
<span dir="auto">{title}</span>
267274
</div>
268275
{link.type === SPOC_TYPE ? (

browser/components/newtab/content-src/components/TopSites/_TopSites.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ $hover-transition-duration: 150ms;
263263
white-space: nowrap;
264264
}
265265

266-
&.pinned {
266+
&.has-icon {
267267
span {
268268
padding: 0 13px;
269269
}

browser/components/newtab/content-src/styles/_icons.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@
138138
width: $smaller-icon-size;
139139
}
140140

141+
&.icon-sponsored-small {
142+
background-image: url('chrome://activity-stream/content/data/content/assets/glyph-highlights-16.svg');
143+
background-size: $smaller-icon-size;
144+
height: $smaller-icon-size;
145+
width: $smaller-icon-size;
146+
}
147+
141148
&.icon-check {
142149
background-image: url('chrome://global/skin/icons/check.svg');
143150
}

browser/components/newtab/css/activity-stream-linux.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ body {
220220
width: 12px; }
221221
.icon.icon-pin-small:dir(rtl) {
222222
transform: scaleX(-1); }
223+
.icon.icon-sponsored-small {
224+
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-highlights-16.svg");
225+
background-size: 12px;
226+
height: 12px;
227+
width: 12px; }
223228
.icon.icon-check {
224229
background-image: url("chrome://global/skin/icons/check.svg"); }
225230
.icon.icon-download {
@@ -676,7 +681,7 @@ main {
676681
overflow: hidden;
677682
text-overflow: ellipsis;
678683
white-space: nowrap; }
679-
.top-site-outer .title.pinned span {
684+
.top-site-outer .title.has-icon span {
680685
padding: 0 13px; }
681686
.top-site-outer .edit-button {
682687
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-edit-16.svg"); }

browser/components/newtab/css/activity-stream-mac.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ body {
223223
width: 12px; }
224224
.icon.icon-pin-small:dir(rtl) {
225225
transform: scaleX(-1); }
226+
.icon.icon-sponsored-small {
227+
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-highlights-16.svg");
228+
background-size: 12px;
229+
height: 12px;
230+
width: 12px; }
226231
.icon.icon-check {
227232
background-image: url("chrome://global/skin/icons/check.svg"); }
228233
.icon.icon-download {
@@ -679,7 +684,7 @@ main {
679684
overflow: hidden;
680685
text-overflow: ellipsis;
681686
white-space: nowrap; }
682-
.top-site-outer .title.pinned span {
687+
.top-site-outer .title.has-icon span {
683688
padding: 0 13px; }
684689
.top-site-outer .edit-button {
685690
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-edit-16.svg"); }

browser/components/newtab/css/activity-stream-windows.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ body {
220220
width: 12px; }
221221
.icon.icon-pin-small:dir(rtl) {
222222
transform: scaleX(-1); }
223+
.icon.icon-sponsored-small {
224+
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-highlights-16.svg");
225+
background-size: 12px;
226+
height: 12px;
227+
width: 12px; }
223228
.icon.icon-check {
224229
background-image: url("chrome://global/skin/icons/check.svg"); }
225230
.icon.icon-download {
@@ -676,7 +681,7 @@ main {
676681
overflow: hidden;
677682
text-overflow: ellipsis;
678683
white-space: nowrap; }
679-
.top-site-outer .title.pinned span {
684+
.top-site-outer .title.has-icon span {
680685
padding: 0 13px; }
681686
.top-site-outer .edit-button {
682687
background-image: url("chrome://activity-stream/content/data/content/assets/glyph-edit-16.svg"); }

browser/components/newtab/data/content/activity-stream.bundle.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9592,9 +9592,11 @@ class TopSiteLink extends react__WEBPACK_IMPORTED_MODULE_4___default.a.PureCompo
95929592
"data-fallback": smallFaviconFallback && letterFallback,
95939593
style: smallFaviconStyle
95949594
})), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
9595-
className: `title ${link.isPinned ? "pinned" : ""}`
9595+
className: `title${link.isPinned || link.sponsored_position ? " has-icon" : ""}${link.isPinned ? " pinned" : ""}`
95969596
}, link.isPinned && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
95979597
className: "icon icon-pin-small"
9598+
}), link.sponsored_position && react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("div", {
9599+
className: "icon icon-sponsored-small"
95989600
}), react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {
95999601
dir: "auto"
96009602
}, title)), link.type === SPOC_TYPE ? react__WEBPACK_IMPORTED_MODULE_4___default.a.createElement("span", {

0 commit comments

Comments
 (0)