mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-11 16:53:05 +00:00
feat: add settings modal
This commit is contained in:
32
src/components/Settings/SettingsModal.tsx
Normal file
32
src/components/Settings/SettingsModal.tsx
Normal 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>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user