From f8bd171bb78121272dbd318670775896844c9672 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Wed, 9 Jun 2021 00:56:07 +0700 Subject: [PATCH] Use new icons (#58) --- source/github-issue-link-status.js | 12 +++--------- source/icons.js | 14 +++++++++----- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/source/github-issue-link-status.js b/source/github-issue-link-status.js index bef9c76..ae8973e 100644 --- a/source/github-issue-link-status.js +++ b/source/github-issue-link-status.js @@ -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(`); @@ -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 */} diff --git a/source/icons.js b/source/icons.js index 9bc5393..bcf3058 100644 --- a/source/icons.js +++ b/source/icons.js @@ -1,9 +1,13 @@ -export const openissue = ''; +export const openissue = ''; -export const closedissue = ''; +export const closedissue = ''; -export const openpullrequest = ''; +export const draftissue = ''; -export const mergedpullrequest = ''; +export const openpullrequest = ''; -export const closedpullRequest = openpullrequest; // Same icon, different color +export const mergedpullrequest = ''; + +export const closedpullrequest = ''; + +export const draftpullrequest = '';