diff --git a/.prettierrc.cjs b/.prettierrc.cjs index debc713..1e8b40e 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -5,7 +5,7 @@ module.exports = { printWidth: 80, tabWidth: 2, useTabs: false, - semi: false, + semi: true, singleQuote: false, trailingComma: "none", bracketSpacing: true, diff --git a/popup.tsx b/popup.tsx index 701cd00..05ba5ed 100644 --- a/popup.tsx +++ b/popup.tsx @@ -1,18 +1,71 @@ -import { useState } from "react" +import { useEffect, useState } from "react"; + +const useLocalStorage = (key: string, defaultValue: any) => { + const [value, setValue] = useState(() => { + let currentValue: any; + + try { + currentValue = JSON.parse( + localStorage.getItem(key) || String(defaultValue) + ); + } catch (error) { + currentValue = defaultValue; + } + + return currentValue; + }); + + useEffect(() => { + localStorage.setItem(key, JSON.stringify(value)); + }, [value, key]); + + return [value, setValue]; +}; function IndexPopup() { - const [data, setData] = useState("") + // const storage = new Storage({}); + + useEffect(() => { + document.querySelector("html").style.width = "500px"; + (async () => { + // await storage.set("copyAssignee", false); + })(); + }, []); return ( -
+ {" "} + Click on the{" "} + + content_copy + {" "} + button to copy the tasks{" "} +
+ +