Skip to content

Commit bf0f1a3

Browse files
committed
fix(placards): improve placard sizing/shapes
1 parent 8dae44c commit bf0f1a3

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

clients/web/src/connectors/placards/placards.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ export function Placard({ placement, position, shouldDisplay }) {
5555
}
5656

5757
return shouldDisplay ? (
58-
<div className={`${style.wrapper} ${style[format]}`} ref={elementRef}>
59-
<a href={url} onClick={handleClick}>
60-
<img src={image_url} alt={alt_text} />
61-
</a>
62-
<p className="label">{alt_text}</p>
58+
<div>
59+
<div className={`${style.wrapper} ${style[format]}`} ref={elementRef}>
60+
<a href={url} onClick={handleClick}>
61+
<img src={image_url} alt={alt_text} />
62+
</a>
63+
<p className={style.label}>{alt_text}</p>
64+
</div>
6365
</div>
6466
) : null
6567
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.wrapper {
2+
position: relative;
3+
display: flex;
4+
justify-content: center;
5+
align-items: center;
6+
width: 100%;
7+
margin: 1rem 0;
8+
}
9+
.label {
10+
position: absolute;
11+
top: 50%;
12+
left: 50%;
13+
z-index: -1;
14+
font-size: 0.5rem;
15+
}
16+
.skyscraper {
17+
position: sticky;
18+
top: 6rem;
19+
margin: 0 0 4rem;
20+
margin-top: -22px;
21+
}

clients/web/src/containers/syndicated-article/syndicated-article.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ export function SyndicatedArticle({ queryParams = validParams, locale }) {
9999
{
100100
placement: 'pocket_billboard',
101101
count: 2
102+
},
103+
{
104+
placement: 'pocket_skyscraper',
105+
count: 2
102106
}
103107
])
104108
)
@@ -258,13 +262,21 @@ export function SyndicatedArticle({ queryParams = validParams, locale }) {
258262
{showCTA ? (
259263
<CallOutSyndicated onVisible={onCTAVisible} handleSignup={onCTASignup} />
260264
) : null}
261-
<AdRailTop allowAds={allowAds} targeting={targeting} />
265+
{showPlacards ? (
266+
<Placard shouldDisplay={showPlacards} placement="pocket_skyscraper" position={0} />
267+
) : (
268+
<AdRailTop allowAds={allowAds} targeting={targeting} />
269+
)}
262270
<PublisherRecs
263271
itemId={originalItemId}
264272
publisher={publisher}
265273
legacyId={originalItemId}
266274
/>
267-
<AdRailBottom allowAds={allowAds} targeting={targeting} />
275+
{showPlacards ? (
276+
<Placard shouldDisplay={showPlacards} placement="pocket_skyscraper" position={1} />
277+
) : (
278+
<AdRailBottom allowAds={allowAds} targeting={targeting} />
279+
)}
268280
</aside>
269281

270282
<div className="content-body">

clients/web/src/pages/api/placards.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
3333
try {
3434
const payload = await req.body
3535
const body = JSON.stringify(payload)
36-
const adResponse = await fetch('https://ads.allizom.org/v1/ads', {
36+
const adResponse = await fetch('https://ads.mozilla.org/v1/ads', {
3737
method: 'POST',
3838
headers: { 'Content-Type': 'application/json' },
3939
body

0 commit comments

Comments
 (0)