Skip to content

Commit

Permalink
Added New Theme Options
Browse files Browse the repository at this point in the history
  • Loading branch information
Reez committed Apr 13, 2021
1 parent 7067030 commit 72ab97b
Show file tree
Hide file tree
Showing 20 changed files with 7,656 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ build/*
.vscode
dist
dist/*
.DS_Store
.DS_Store
2 changes: 1 addition & 1 deletion app/Containers/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const AppContainer = () => {
const [jsonPath, setJsonPath] = React.useState('');
const path = useDebounce(jsonPath, 500);

const handleJSONPathInput = e => {
const handleJSONPathInput = (e) => {
setJsonPath(e.target.value);
};

Expand Down
16 changes: 14 additions & 2 deletions app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,28 @@ window.onload = () => {
document.body.appendChild(snackbar);

if (chrome.runtime) {
const stylesURL = chrome.runtime.getURL('/styles.css');
const stylesURL = chrome.runtime.getURL('styles.css');

const style = document.createElement('link');
style.setAttribute('rel', 'stylesheet');
style.setAttribute('href', stylesURL);
document.head.append(style);

chrome.storage.sync.get(['pallet'], ({ pallet: theme }) => {
if (!theme || !theme.pallet) {
return;
}

Object.keys(theme.pallet).forEach((name) => {
const color = theme.pallet[name];
document.documentElement.style.setProperty(`--${name}`, color);
});
});
}

ReactDOM.render(<AppContainer />, document.getElementById('root'));
// tslint:disable-next-line: no-empty
} catch (_) {
console.log(_);
// console.log(_);
}
};
Binary file removed dist/assets/icon-128.png
Binary file not shown.
Binary file removed dist/assets/icon-16.png
Binary file not shown.
Binary file removed dist/assets/icon-48.png
Binary file not shown.
Binary file removed dist/assets/icon-512.png
Binary file not shown.
25 changes: 0 additions & 25 deletions dist/manifest.json

This file was deleted.

1 change: 0 additions & 1 deletion dist/styles.css

This file was deleted.

13 changes: 11 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Seven JSON Viewer",
"description": "Minimal JSON Viewer with JSON Path",
"short_name": "JSON Viewer",
"version": "2.1",
"version": "3.0",
"offline_enabled": true,
"manifest_version": 2,
"content_scripts": [
Expand All @@ -14,12 +14,21 @@
}
],
"content_security_policy": "sandbox allow-scripts; script-src 'self'; object-src 'none';",
"permissions": ["tabs", "activeTab"],
"permissions": ["tabs", "activeTab", "storage"],
"web_accessible_resources": ["styles.css", "app.js"],
"icons": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
"128": "assets/icon-128.png",
"512": "assets/icon-512.png"
},
"browser_action": {
"default_popup": "index.html",
"default_icon": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
"128": "assets/icon-128.png",
"512": "assets/icon-512.png"
}
}
}
Loading

0 comments on commit 72ab97b

Please sign in to comment.