diff --git a/package-lock.json b/package-lock.json
index af52879..a210cea 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17,6 +17,7 @@
"@testing-library/user-event": "^13.5.0",
"axios": "^1.2.1",
"emoji-picker-react": "^4.4.7",
+ "focus-trap-react": "^10.2.3",
"form-data": "^4.0.0",
"immer": "^9.0.16",
"react": "^18.2.0",
@@ -8397,6 +8398,28 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
},
+ "node_modules/focus-trap": {
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.4.tgz",
+ "integrity": "sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==",
+ "dependencies": {
+ "tabbable": "^6.2.0"
+ }
+ },
+ "node_modules/focus-trap-react": {
+ "version": "10.2.3",
+ "resolved": "https://registry.npmjs.org/focus-trap-react/-/focus-trap-react-10.2.3.tgz",
+ "integrity": "sha512-YXBpFu/hIeSu6NnmV2xlXzOYxuWkoOtar9jzgp3lOmjWLWY59C/b8DtDHEAV4SPU07Nd/t+nS/SBNGkhUBFmEw==",
+ "dependencies": {
+ "focus-trap": "^7.5.4",
+ "tabbable": "^6.2.0"
+ },
+ "peerDependencies": {
+ "prop-types": "^15.8.1",
+ "react": ">=16.3.0",
+ "react-dom": ">=16.3.0"
+ }
+ },
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
@@ -16399,6 +16422,11 @@
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
},
+ "node_modules/tabbable": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz",
+ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
+ },
"node_modules/tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
@@ -23871,6 +23899,23 @@
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz",
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ=="
},
+ "focus-trap": {
+ "version": "7.5.4",
+ "resolved": "https://registry.npmjs.org/focus-trap/-/focus-trap-7.5.4.tgz",
+ "integrity": "sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==",
+ "requires": {
+ "tabbable": "^6.2.0"
+ }
+ },
+ "focus-trap-react": {
+ "version": "10.2.3",
+ "resolved": "https://registry.npmjs.org/focus-trap-react/-/focus-trap-react-10.2.3.tgz",
+ "integrity": "sha512-YXBpFu/hIeSu6NnmV2xlXzOYxuWkoOtar9jzgp3lOmjWLWY59C/b8DtDHEAV4SPU07Nd/t+nS/SBNGkhUBFmEw==",
+ "requires": {
+ "focus-trap": "^7.5.4",
+ "tabbable": "^6.2.0"
+ }
+ },
"follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
@@ -29457,6 +29502,11 @@
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
},
+ "tabbable": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz",
+ "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
+ },
"tailwindcss": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.2.4.tgz",
diff --git a/package.json b/package.json
index 647edbd..82a47bd 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"@testing-library/user-event": "^13.5.0",
"axios": "^1.2.1",
"emoji-picker-react": "^4.4.7",
+ "focus-trap-react": "^10.2.3",
"form-data": "^4.0.0",
"immer": "^9.0.16",
"react": "^18.2.0",
diff --git a/src/component/Sidebar/SideBar.jsx b/src/component/Sidebar/SideBar.jsx
index c5a8460..b409803 100644
--- a/src/component/Sidebar/SideBar.jsx
+++ b/src/component/Sidebar/SideBar.jsx
@@ -33,7 +33,7 @@ import NoChats from "../Messages/NoChats";
import { ViewNotifyAction } from "../../react-redux/actions/Notifications";
function Sidebar() {
-
+ const [isLogoutModalOpen, setIsLogoutModalOpen] = useState();
const auth = useSelector((s) => s.AuthReducer)
const { user, toFgtPwd } = auth;
const nameInApi = user?.user_name
@@ -183,9 +183,9 @@ function Sidebar() {
document.getElementById("CTReplyDiv").style.display = "none"
setOPacity()
}
- function handleLogout() {
- document.getElementsByClassName("logoutDiv")[0].style.display = "flex";
- setOPacity()
+
+ function openLogoutModal() {
+ setIsLogoutModalOpen(true);
}
const pro = useSelector((p) => p.ProfileNameReducer)
@@ -266,7 +266,7 @@ else{
navigate("/phonesearch")
}} />
-
+
Log Out?
-Are you sure you want to log out?
- - -Log Out?
+Are you sure you want to log out?
+ + +