Skip to content

Commit

Permalink
Update colors
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Dec 9, 2023
1 parent 1213f10 commit 0f528fb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/github-issue-link-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const endpoint = location.hostname === 'github.com'
const issueUrlRegex = /^[/]([^/]+[/][^/]+)[/](issues|pull)[/](\d+)([/]|$)/;
const stateColorMap = {
pullrequest: {
open: ['text-green', 'color-text-success', 'color-fg-success'],
closed: ['text-red', 'color-text-danger', 'color-fg-danger'],
merged: ['text-purple', 'color-purple-5', 'color-fg-done'],
open: 'color-fg-success',
closed: 'color-fg-danger',
merged: 'color-fg-done',
},
issue: {
open: ['text-green', 'color-text-success', 'color-fg-success'],
closed: ['text-purple', 'color-purple-5', 'color-fg-done'],
open: 'color-fg-success',
closed: 'color-fg-done',
},
};

Expand All @@ -27,7 +27,7 @@ function getIcon(state, type, isDraft = false) {
}

if (iconName === 'draftpullrequest') {
return icons.draftpullrequest.replace('<svg', '<svg class="octicon color-text-tertiary"');
return icons.draftpullrequest.replace('<svg', '<svg class="octicon color-fg-muted"');
}

return icons[iconName].replace('<svg', '<svg class="octicon"');
Expand Down Expand Up @@ -134,7 +134,7 @@ async function apply() {
const type = item.__typename.toLowerCase();
const state = item.state.toLowerCase();

link.classList.add(...stateColorMap[type][state]);
link.classList.add(stateColorMap[type][state]);

link.querySelector('svg').outerHTML = getIcon(state, type, item.isDraft);
} catch {/* Probably a redirect */}
Expand Down

0 comments on commit 0f528fb

Please sign in to comment.