Skip to content
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

Ensure social category badges are rendered with social style and logo; affects [gitlab keybase lemmy modrinth thunderstore twitch] gist github reddit #9859

Merged
merged 2 commits into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:/${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:/${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:/${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:/${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 @@ -42,6 +42,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 @@ -42,6 +42,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
Loading