Social badge support for static previews (#2871)
The static previews don't support the social badges. Adding that lets us remove support for `exampleUrl`. Close #2479. This includes `style` and `namedLogo` in the service-definition export and updates the frontend to use it. To accomplish this, it passes `namedLogo` through `coalesceBadge`. After logo resolution is moved to `makeBadge` this duplication can be removed, as `logo` will no longer be needed in the result of `coalesceBadge`.
This commit is contained in:
@@ -30,22 +30,26 @@ module.exports = class GithubFollowers extends LegacyService {
|
||||
return [
|
||||
{
|
||||
title: 'GitHub followers',
|
||||
previewUrl: 'espadrine',
|
||||
// https://github.com/badges/shields/issues/2479
|
||||
// namedParams: {
|
||||
// user: 'espadrine',
|
||||
// },
|
||||
// staticPreview: {
|
||||
// label: 'Follow',
|
||||
// message: '150',
|
||||
// style: 'social',
|
||||
// },
|
||||
queryParams: { style: 'social', label: 'Follow' },
|
||||
namedParams: {
|
||||
user: 'espadrine',
|
||||
},
|
||||
staticPreview: {
|
||||
label: 'Follow',
|
||||
message: '150',
|
||||
style: 'social',
|
||||
},
|
||||
queryParams: { label: 'Follow' },
|
||||
documentation,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
static get defaultBadgeData() {
|
||||
return {
|
||||
namedLogo: 'github',
|
||||
}
|
||||
}
|
||||
|
||||
static registerLegacyRouteHandler({ camp, cache, githubApiProvider }) {
|
||||
camp.route(
|
||||
/^\/github\/followers\/([^/]+)\.(svg|png|gif|jpg|json)$/,
|
||||
|
||||
Reference in New Issue
Block a user