Skip to content

Commit

Permalink
Ensure social category badges are rendered with social style and logo…
Browse files Browse the repository at this point in the history
…; affects [gitlab keybase lemmy modrinth thunderstore twitch] gist github reddit (#9859)

* Ensure social category badges are rendered with social style and logo

* Fix Twitch auth test
  • Loading branch information
PyvesB committed Dec 31, 2023
1 parent 17d04f7 commit 04254e5
Show file tree
Hide file tree
Showing 19 changed files with 29 additions and 3 deletions.
6 changes: 5 additions & 1 deletion services/github/gist/github-gist-stars.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ export default class GistStars extends GithubAuthV4Service {
}

static render({ stargazerCount, url, stargazers }) {
return { message: metric(stargazerCount), link: [url, stargazers] }
return {
message: metric(stargazerCount),
style: 'social',
link: [url, stargazers],
}
}

async fetch({ gistId }) {
Expand Down
1 change: 1 addition & 0 deletions services/github/github-followers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default class GithubFollowers extends GithubAuthV3Service {
static render({ followers }) {
return {
message: metric(followers),
style: 'social',
color: 'blue',
}
}
Expand Down
1 change: 1 addition & 0 deletions services/github/github-forks.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default class GithubForks extends GithubAuthV4Service {
static render({ user, repo, forkCount }) {
return {
message: metric(forkCount),
style: 'social',
color: 'blue',
link: [
`https://github.com/${user}/${repo}/fork`,
Expand Down
1 change: 1 addition & 0 deletions services/github/github-stars.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default class GithubStars extends GithubAuthV3Service {
const slug = `${encodeURIComponent(user)}/${encodeURIComponent(repo)}`
return {
message: metric(stars),
style: 'social',
color: 'blue',
link: [
`https://github.com/${slug}`,
Expand Down
1 change: 1 addition & 0 deletions services/github/github-total-star.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export default class GithubTotalStarService extends GithubAuthV4Service {
static render({ totalStars, user }) {
return {
message: metric(totalStars),
style: 'social',
color: 'blue',
link: [`https://github.com/${user}`],
}
Expand Down
1 change: 1 addition & 0 deletions services/github/github-watchers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class GithubWatchers extends GithubAuthV3Service {
static render({ watchers, user, repo }) {
return {
message: metric(watchers),
style: 'social',
color: 'blue',
link: [
`https://github.com/${user}/${repo}`,
Expand Down
1 change: 1 addition & 0 deletions services/gitlab/gitlab-forks.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class GitlabForks extends GitLabBase {
static render({ baseUrl, project, forkCount }) {
return {
message: metric(forkCount),
style: 'social',
color: 'blue',
link: [
`${baseUrl}/${project}/-/forks/new`,
Expand Down
1 change: 1 addition & 0 deletions services/gitlab/gitlab-stars.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default class GitlabStars extends GitLabBase {
static render({ baseUrl, project, starCount }) {
return {
message: metric(starCount),
style: 'social',
color: 'blue',
link: [`${baseUrl}/${project}`, `${baseUrl}/${project}/-/starrers`],
}
Expand Down
2 changes: 2 additions & 0 deletions services/keybase/keybase-btc.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ export default class KeybaseBTC extends KeybaseProfile {
static defaultBadgeData = {
label: 'btc',
color: 'informational',
namedLogo: 'keybase',
}

static render({ address }) {
return {
message: address,
style: 'social',
}
}

Expand Down
2 changes: 2 additions & 0 deletions services/keybase/keybase-pgp.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ export default class KeybasePGP extends KeybaseProfile {
static defaultBadgeData = {
label: 'pgp',
color: 'informational',
namedLogo: 'keybase',
}

static render({ fingerprint }) {
return {
message: fingerprint.slice(-16).toUpperCase(),
style: 'social',
}
}

Expand Down
2 changes: 2 additions & 0 deletions services/keybase/keybase-xlm.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ export default class KeybaseXLM extends KeybaseProfile {
static defaultBadgeData = {
label: 'xlm',
color: 'informational',
namedLogo: 'keybase',
}

static render({ address }) {
return {
message: address,
style: 'social',
}
}

Expand Down
2 changes: 2 additions & 0 deletions services/keybase/keybase-zec.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ export default class KeybaseZEC extends KeybaseProfile {
static defaultBadgeData = {
label: 'zec',
color: 'informational',
namedLogo: 'keybase',
}

static render({ address }) {
return {
message: address,
style: 'social',
}
}

Expand Down
3 changes: 2 additions & 1 deletion services/lemmy/lemmy.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ export default class Lemmy extends BaseJsonService {
},
}

static defaultBadgeData = { label: 'community' }
static defaultBadgeData = { label: 'community', namedLogo: 'lemmy' }

static render({ community, members }) {
return {
label: `subscribe to ${community}`,
message: metric(members),
style: 'social',
color: 'brightgreen',
}
}
Expand Down
3 changes: 2 additions & 1 deletion services/modrinth/modrinth-followers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ export default class ModrinthFollowers extends BaseModrinthService {
},
}

static defaultBadgeData = { label: 'followers' }
static defaultBadgeData = { label: 'followers', namedLogo: 'modrinth' }

static render({ followers }) {
return {
message: metric(followers),
style: 'social',
color: 'blue',
}
}
Expand Down
1 change: 1 addition & 0 deletions services/reddit/subreddit-subscribers.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class RedditSubredditSubscribers extends BaseJsonService {
return {
label: `follow r/${subreddit}`,
message: metric(subscribers),
style: 'social',
color: 'red',
link: [`https://www.reddit.com/r/${subreddit}`],
}
Expand Down
1 change: 1 addition & 0 deletions services/reddit/user-karma.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default class RedditUserKarma extends BaseJsonService {
return {
label,
message: metric(karma),
style: 'social',
color: karma > 0 ? 'brightgreen' : karma === 0 ? 'orange' : 'red',
link: [`https://www.reddit.com/u/${user}`],
}
Expand Down
1 change: 1 addition & 0 deletions services/thunderstore/thunderstore-likes.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default class ThunderstoreLikes extends BaseThunderstoreService {
static render({ likes }) {
return {
message: metric(likes),
style: 'social',
color: `#${this.thunderstoreGreen}`,
}
}
Expand Down
1 change: 1 addition & 0 deletions services/twitch/twitch.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default class TwitchStatus extends TwitchBase {
static render({ user, isLive }) {
return {
message: isLive ? 'live' : 'offline',
style: 'social',
color: isLive ? 'red' : 'lightgrey',
link: `https://www.twitch.tv/${user}`,
}
Expand Down
1 change: 1 addition & 0 deletions services/twitch/twitch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ describe('TwitchStatus', function () {
}),
).to.deep.equal({
message: 'offline',
style: 'social',
link: 'https://www.twitch.tv/undefined',
color: 'lightgrey',
})
Expand Down

0 comments on commit 04254e5

Please sign in to comment.