Update icons, add minValueLength to LocalStorage

This commit is contained in:
Arkadiusz Wieczorek 2022-01-29 01:13:02 +01:00
parent 0c3e2ab9fc
commit 42488a339a
5 changed files with 4773 additions and 11 deletions

4748
assets/logo.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 353 KiB

View File

@ -10,12 +10,18 @@
"sidebar_action": {
"default_title": "Rentgen",
"default_panel": "sidebar/sidebar.html",
"default_icon": "icons/logo-black-square.svg",
"default_icon": {
"16": "assets/logo.svg",
"32": "assets/logo.svg",
"64": "assets/logo.svg"
},
"browser_style": true,
"open_at_install": true
},
"icons": {
"48": "icons/logo-black-square.svg"
"16": "assets/logo.svg",
"32": "assets/logo.svg",
"64": "assets/logo.svg"
},
"permissions": [
"proxy",

View File

@ -76,9 +76,13 @@ export default function Options({
type="number"
id="minValueLength"
value={minValueLength}
onChange={(e) =>
setMinValueLength(parseInt(e.target.value))
}
onChange={(e) => {
setMinValueLength(parseInt(e.target.value));
localStorage.setItem(
'minValueLength',
e.target.value
);
}}
/>
</div>
<div className="input-container">

View File

@ -13,7 +13,8 @@
"type": "git",
"url": "https://git.internet-czas-dzialac.pl/icd/rentgen.git"
},
"author": "Kuba Orlik, Arkadiusz Wieczorek (internet-czas-dzialac.pl)",
"homepage": "https://git.internet-czas-dzialac.pl/icd/rentgen",
"author": "Kuba Orlik, Arkadiusz Wieczorek",
"license": "GPL-3.0-or-later",
"dependencies": {
"@iabtcf/core": "^1.3.1",

View File

@ -25,7 +25,12 @@ import './sidebar.scss';
const Sidebar = () => {
const [origin, setOrigin] = useState<string | null>(null);
const [minValueLength, setMinValueLength] = useState<number | null>(7);
// const [minValueLength, setMinValueLength] = useState<number | null>(7);
const [minValueLength, setMinValueLength] = useState<number | null>(
localStorage.getItem('minValueLength') === null
? 7
: (localStorage.getItem('minValueLength') as unknown as number)
);
const [cookiesOnly, setCookiesOnly] = useState<boolean>(false);
const [stolenDataView, setStolenDataView] = useState<boolean>(true);
const [cookiesOrOriginOnly, setCookiesOrOriginOnly] =
@ -41,7 +46,7 @@ const Sidebar = () => {
);
const [logoVisibility, setLogoVisibility] = useState<boolean>(
localStorage.getItem('logoVisibility') === null
? true
? false
: localStorage.getItem('logoVisibility') == 'true'
? true
: false
@ -166,9 +171,7 @@ const Sidebar = () => {
}}
>
<MailIcon width={20} height={20} />
<span>
Utwórz wiadomość dla administratora witryny
</span>
<span>Utwórz wiadomość dla administratora witryny</span>
</button>
</nav>
) : null}