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": { "sidebar_action": {
"default_title": "Rentgen", "default_title": "Rentgen",
"default_panel": "sidebar/sidebar.html", "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, "browser_style": true,
"open_at_install": true "open_at_install": true
}, },
"icons": { "icons": {
"48": "icons/logo-black-square.svg" "16": "assets/logo.svg",
"32": "assets/logo.svg",
"64": "assets/logo.svg"
}, },
"permissions": [ "permissions": [
"proxy", "proxy",

View File

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

View File

@ -13,7 +13,8 @@
"type": "git", "type": "git",
"url": "https://git.internet-czas-dzialac.pl/icd/rentgen.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", "license": "GPL-3.0-or-later",
"dependencies": { "dependencies": {
"@iabtcf/core": "^1.3.1", "@iabtcf/core": "^1.3.1",

View File

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