Skip to content
This repository has been archived by the owner on Nov 25, 2023. It is now read-only.

Commit

Permalink
added hiding of sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamkrishnar committed Aug 25, 2021
1 parent 80df6a1 commit c0c295a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
11 changes: 11 additions & 0 deletions app/pages/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@
</label>
</div>
</div>
<div class="row">
<div class="label-wrapper">
<label for="sponsors" class="status">Sponsors:</label>
</div>
<div class="toggle-wrapper">
<label class="switch">
<input type="checkbox" id="sponsors">
<span class="slider round"></span>
</label>
</div>
</div>
</div>
<script src="../scripts/popup.js"></script>
</body>
Expand Down
19 changes: 14 additions & 5 deletions app/scripts/shared.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
/*
Shared file with utilities and constants
*/
/**
* Builds and sends css required to hide the element
* @param id {string}
* @return {string}
*/
const getCSSStyle = (id) => {
return `#dashboard .${id} { display: none; }`;
}

// CSS Styles required to hide various feed items
// Key names should match the checkbox id in the popup.html
export const CSSStyles = {
releases: `#dashboard .release { display: none; }`,
stars: `#dashboard .watch_started { display: none; }`,
follows: `#dashboard .follow { display: none; }`,
forks: `#dashboard .fork { display: none; }`,
push: `#dashboard .push { display: none; }`,
releases: getCSSStyle('release'),
stars: getCSSStyle('watch_started'),
follows: getCSSStyle('follow'),
forks: getCSSStyle('fork'),
push: getCSSStyle('push'),
sponsors: getCSSStyle('sponsor')
};

export const STORAGE_KEY = 'refinedGithubData';
Expand Down

0 comments on commit c0c295a

Please sign in to comment.