From 33a25a3e9d7f8a29129432b338acabea7d8444ad Mon Sep 17 00:00:00 2001 From: Arkadiusz Wieczorek Date: Wed, 19 Jan 2022 14:12:52 +0100 Subject: [PATCH] Update --- sidebar/sidebar.scss | 7 + sidebar/sidebar.tsx | 33 +++- sidebar/stolen-data-cluster.tsx | 292 +++++++++++++++++--------------- sidebar/stolen-data.tsx | 8 +- 4 files changed, 195 insertions(+), 145 deletions(-) diff --git a/sidebar/sidebar.scss b/sidebar/sidebar.scss index 0426511..aaceca3 100644 --- a/sidebar/sidebar.scss +++ b/sidebar/sidebar.scss @@ -63,6 +63,13 @@ nav { } } + &:disabled { + color: $light-grey; + svg path { + fill: $light-grey; + } + } + span { padding-left: 0.5rem; font-size: 0.875rem; diff --git a/sidebar/sidebar.tsx b/sidebar/sidebar.tsx index 319dee7..f4420fc 100644 --- a/sidebar/sidebar.tsx +++ b/sidebar/sidebar.tsx @@ -4,7 +4,6 @@ import Options from '../options'; import { StolenData } from './stolen-data'; import { getshorthost, useEmitter } from '../util'; import { getMemory } from '../memory'; -import { RequestCluster } from '../request-cluster'; import InfoCircleIcon from '../assets/icons/info_circle_outline.svg'; import SettingsIcon from '../assets/icons/settings.svg'; import TrashIcon from '../assets/icons/trash_full.svg'; @@ -30,6 +29,7 @@ const Sidebar = () => { const [cookiesOrOriginOnly, setCookiesOrOriginOnly] = useState(false); const [counter, setCounter] = useEmitter(getMemory()); + const [marksOccurrence, setMarksOccurrence] = useState(false); useEffect(() => { const listener = async (data: any) => { @@ -47,6 +47,18 @@ const Sidebar = () => { }; }); + useEffect(() => { + for (const cluster of Object.values( + getMemory().getClustersForOrigin(origin) + )) { + if (cluster.hasMarks()) { + return setMarksOccurrence(true); + } + } + return setMarksOccurrence(false); + }, [counter]); + + return ( {/*
@@ -93,15 +105,28 @@ const Sidebar = () => { origin, getshorthost(new URL(origin).host) ); + setMarksOccurrence(false); }} > {/* {stolenDataView ? 'Options' : 'Data'} */} - Wyczyść ciasteczka tej domeny + Wyczyść ciasteczka first-party + */} @@ -81,6 +82,7 @@ export function StolenData({ origin={origin} shorthost={cluster.id} key={cluster.id + origin} + refresh={refresh} refreshToken={refreshToken} minValueLength={minValueLength} cookiesOnly={cookiesOnly}