feat: add settings modal

This commit is contained in:
Sonny
2023-11-25 22:05:14 +01:00
parent 6e3b2263b0
commit 20a0f86118
7 changed files with 52 additions and 16 deletions

View File

@@ -0,0 +1,32 @@
import { AnimatePresence } from "framer-motion";
import useModal from "hooks/useModal";
import Modal from "../Modal/Modal";
import * as Keys from "constants/keys";
import { useHotkeys } from "react-hotkeys-hook";
import { IoSettingsOutline } from "react-icons/io5";
import LangSelector from "../LangSelector";
export default function SettingsModal() {
const modal = useModal();
useHotkeys(Keys.CLOSE_SEARCH_KEY, modal.close, {
enabled: modal.isShowing,
enableOnFormTags: ["INPUT"],
});
return (
<>
<button onClick={modal.open} className="reset" title="Settings">
<IoSettingsOutline size={24} />
</button>
<AnimatePresence>
{modal.isShowing && (
<Modal title="Settings" close={modal.close}>
<LangSelector />
<p>about tab with all links related to MyLinks</p>
<button>disconnect</button>
</Modal>
)}
</AnimatePresence>
</>
);
}