mirror of
https://github.com/meowarex/TidaLuna-Plugins.git
synced 2026-06-18 03:43:10 +10:00
Remembers Hidden Elements + Use Hover based Highlights + Very Precise Selectors
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { ReactiveStore } from "@luna/core";
|
||||
import { LunaSettings } from "@luna/ui";
|
||||
import React from "react";
|
||||
|
||||
export const settings = await ReactiveStore.getPluginStorage("ElementHider", {
|
||||
hiddenElements: [] as Array<{
|
||||
selector: string;
|
||||
tagName: string;
|
||||
className: string;
|
||||
textContent: string;
|
||||
timestamp: number;
|
||||
}>
|
||||
});
|
||||
|
||||
export const Settings = () => {
|
||||
const [hiddenElementsCount, setHiddenElementsCount] = React.useState(settings.hiddenElements.length);
|
||||
|
||||
// Update count when settings change
|
||||
React.useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
setHiddenElementsCount(settings.hiddenElements.length);
|
||||
}, 1000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user