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

Update classes #49

Merged
merged 1 commit into from
Mar 31, 2021
Merged
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
10 changes: 5 additions & 5 deletions source/github-issue-link-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const __DEV__ = false;
const endpoint = location.hostname === 'github.com' ? 'https://api.github.com/graphql' : `${location.origin}/api/graphql`;
const issueUrlRegex = /^[/]([^/]+[/][^/]+)[/](issues|pull)[/](\d+)([/]|$)/;
const stateColorMap = {
open: 'text-green',
closed: 'text-red',
merged: 'text-purple'
open: ['text-green', 'color-text-success'],
closed: ['text-red', 'color-text-danger'],
merged: ['text-purple', 'color-purple-5']
};

const stateDependentIcons = [
Expand Down Expand Up @@ -122,9 +122,9 @@ async function apply() {
const type = item.__typename.toLowerCase();
const state = item.state.toLowerCase();

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

if (stateDependentIcons.includes(state + type)) {
Expand Down