Skip to content

Commit

Permalink
Use new icons (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 8, 2021
1 parent c8004b0 commit f8bd171
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
12 changes: 3 additions & 9 deletions source/github-issue-link-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ const stateColorMap = {
merged: ['text-purple', 'color-purple-5']
};

const stateDependentIcons = [
'closedissue',
'mergedpullrequest'
];

function anySelector(selector) {
const prefix = document.head.style.MozOrient === '' ? 'moz' : 'webkit';
return selector.replace(/:any\(/g, `:-${prefix}-any(`);
Expand Down Expand Up @@ -125,11 +120,10 @@ async function apply() {
const state = item.state.toLowerCase();

link.classList.add(...stateColorMap[state]);
if (item.isDraft) {
link.querySelector('svg').classList.add('text-gray', 'color-text-secondary');
}

if (stateDependentIcons.includes(state + type)) {
if (item.isDraft && state === 'open') {
link.querySelector('svg').outerHTML = icons['draft' + type];
} else {
link.querySelector('svg').outerHTML = icons[state + type];
}
} catch {/* Probably a redirect */}
Expand Down
14 changes: 9 additions & 5 deletions source/icons.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f8bd171

Please sign in to comment.