{"id":26544898,"url":"https://github.com/pyctam-ac/over_close_popup","last_synced_at":"2025-07-11T00:04:51.497Z","repository":{"id":197281651,"uuid":"698325962","full_name":"Pyctam-AC/over_close_popup","owner":"Pyctam-AC","description":"Кастомный хук - \"Закрытие попап по нажатию на esc или overlay\"","archived":false,"fork":false,"pushed_at":"2023-12-09T22:35:23.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T04:14:37.801Z","etag":null,"topics":["javascript","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Pyctam-AC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-09-29T16:55:57.000Z","updated_at":"2023-12-09T22:36:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ab4a992-28b5-4061-a8d8-0a463bf006df","html_url":"https://github.com/Pyctam-AC/over_close_popup","commit_stats":null,"previous_names":["pyctam-ac/over_close_popup"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pyctam-AC/over_close_popup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pyctam-AC%2Fover_close_popup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pyctam-AC%2Fover_close_popup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pyctam-AC%2Fover_close_popup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pyctam-AC%2Fover_close_popup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pyctam-AC","download_url":"https://codeload.github.com/Pyctam-AC/over_close_popup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pyctam-AC%2Fover_close_popup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264696169,"owners_count":23650933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","react","typescript"],"created_at":"2025-03-22T04:14:41.288Z","updated_at":"2025-07-11T00:04:51.480Z","avatar_url":"https://github.com/Pyctam-AC.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# over close popup\n\n#### usePopupClose\n\nХук для закрытия попап по нажатию на **esc** или **overlay**.\n\nХук разработан для написания кода на React.js.\n\nДанный хук сохраняется в проекте и импортируется в тот файл проекта, в котором обеспечивается функциональность открыттия и закрытия попап (например в файл App.js)\n\n\nВ хук передаётся три параметра: \n\n1. стейт видимости попап.\nДанный стейт созадётся с помощью _useState()_ из React.\n\u003cbr\u003e\n\n2. нименивание класса CSS, который отвечает за закрытие попап _closeAllPopups_\n\n      - **пример написания класса в CSS**\n\n```css\n.popup_opened {\n  visibility: visible;\n}\n```\n\u003cbr\u003e\n\n3. функция закрывающая попап\n\u003cbr\u003e\n\n\n---\n\n**Пример кода в App.js**\n\n```js\n// импорт хука\nimport usePopupClose from \"../../hooks/usePopupClose\";\n\n...\n// стейт видимости попап\n  const [isPopupVisible, popupVisible] = useState(false);\n\n// функция закрывающая попап\n  const closeAllPopups = () =\u003e {\n    popupVisible(false);\n  };\n\n// хук закрытия попапов\n  usePopupClose (\n    isPopupVisible,\n    \"popup_opened\",\n    closeAllPopups\n  );\n  ...\n  ```\n\nДанный хук предназначен для свободного применения.\n\nХук можно скачать из данного репозитория по ссылке\nhttps://github.com/Pyctam-AC/over_close_popup.git\n\n\nАвтор хука - Рустам Султангалиев \n[Pyctam-AC](https://github.com/Pyctam-AC)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyctam-ac%2Fover_close_popup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyctam-ac%2Fover_close_popup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyctam-ac%2Fover_close_popup/lists"}