-
Notifications
You must be signed in to change notification settings - Fork 30
Add PaidForContent TopMeta to Article Body in AMP #513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
PRbuilds results: LightHouse Reporting --automated message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this is good. I've left a few comments. But otherwise, it might be worth merging this and then working on the rest? This will make it easier to review later PRs as they'll be smaller and you are less likely to have a merge conflict later. But equally, if you think stuff is still in flux keeping it all in a single PR makes sense!
); | ||
}; | ||
|
||
export type Tone = 'isOpinion' | 'isPaidContent' | 'isDefault'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my fault for using Opinion everywhere 🤦♂️ but perhaps we should use the actual tone values here (i.e. exactly what the tags contain) - 'comment', 'advertisement-features', '...' ? The benefit is that developers will find it easier to understand the connection between DCR and CAPI/Frontend modelling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The is
prefix is probably also worth dropping as types tend to be nouns rather than predicates if that makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this to match CAPI
@@ -9,6 +9,7 @@ import { AdConsent } from '@frontend/amp/components/AdConsent'; | |||
import { css } from 'emotion'; | |||
import { Sidebar } from '@frontend/amp/components/Sidebar'; | |||
import { Analytics, AnalyticsModel } from '@frontend/amp/components/Analytics'; | |||
import { filterForTagsOfType } from '../lib/tag-utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor, but we tend to use absolute import paths - @frontend/...
We should probably find a way to lint this though! As I think everyone does this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Will change all as way easier to read as a dev too! Perhaps there is a linter plugin already written?
Looks like there is a TSlint rule that already exists for no-relative-imports
that I'll look into: microsoft/tslint-microsoft-contrib#435
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks - sounds great! :)
c19ee9a
to
5a8ef13
Compare
f62fe03
to
c6daf8e
Compare
* Remove tagsOfType from Article * Add getToneTags with tests
c6daf8e
to
544492a
Compare
* Add TopMetaPaidContent component to Body * Add PaidForBand component to AMP * Refactor TopMeta by tone in amp Body
544492a
to
8ae8d6b
Compare
What does this change?
Adds PaidForTopMeta Component with teal header band and sponser logo to AMP Article Body.
Also extracts tone tag helper functions into
tag-utils
inlib
Why?
⚡️ AMP completion
Implementation notes:
<amp-img>
tags as valid inner image tags for anchors and was throwing an error. I have disabled this locally.Screenshots