Added options with blacklist and theme. Created a function for changing the extension icon color.
This commit is contained in:
@@ -7,11 +7,22 @@ class MainList extends React.Component
|
||||
|
||||
}
|
||||
|
||||
_openOptionsPage()
|
||||
{
|
||||
if (chrome.runtime.openOptionsPage) {
|
||||
// New way to open options pages, if supported (Chrome 42+).
|
||||
chrome.runtime.openOptionsPage();
|
||||
} else {
|
||||
// Reasonable fallback.
|
||||
window.open(chrome.runtime.getURL('options.html'));
|
||||
}
|
||||
}
|
||||
|
||||
render()
|
||||
{
|
||||
return(
|
||||
<div className="list-group">
|
||||
<a href="#" className="list-group-item">
|
||||
<a href="#" className="list-group-item" onClick={this._openOptionsPage}>
|
||||
Options
|
||||
</a>
|
||||
<a href="#" className="list-group-item">
|
||||
|
||||
@@ -3,11 +3,22 @@ var React = require("react");
|
||||
var NavBar = require('./NavBar.react');
|
||||
var MainList = require('./MainList.react');
|
||||
|
||||
var changeExtensionIcon = require('../helpers/changeExtensionIcon');
|
||||
|
||||
class WakaTime extends React.Component
|
||||
{
|
||||
componentDidMount()
|
||||
{
|
||||
|
||||
chrome.storage.sync.get({
|
||||
theme: 'light'
|
||||
}, function(items) {
|
||||
if(items.theme == 'light') {
|
||||
changeExtensionIcon();
|
||||
}
|
||||
else {
|
||||
changeExtensionIcon('white');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render()
|
||||
|
||||
Reference in New Issue
Block a user