Relay operations refactored with NDK for publishing events (+ more. Wrapped up refactoring), pagination scroll up on click, body scroll disable/enable when popups appear/disappear, nsfw tag shown on mod cards if mod post is nsfw #92

Merged
freakoverse merged 19 commits from staging into master 2024-10-21 14:17:02 +00:00
Showing only changes of commit e3b6aecfe8 - Show all commits

View File

@ -28,6 +28,18 @@ export const Header = () => {
const { findMetadata } = useNDKContext() const { findMetadata } = useNDKContext()
const userState = useAppSelector((state) => state.user) const userState = useAppSelector((state) => state.user)
// Track nostr-login extension modal open state
const [isOpen, setIsOpen] = useState(false)
const handleOpen = () => setIsOpen(true)
const handleClose = () => setIsOpen(false)
useEffect(() => {
window.addEventListener('nlCloseModal', handleClose)
return () => {
window.removeEventListener('nlCloseModal', handleClose)
}
}, [])
useBodyScrollDisable(isOpen)
useEffect(() => { useEffect(() => {
initNostrLogin({ initNostrLogin({
darkMode: true, darkMode: true,
@ -67,6 +79,7 @@ export const Header = () => {
}, [dispatch, findMetadata]) }, [dispatch, findMetadata])
const handleLogin = () => { const handleLogin = () => {
handleOpen()
launchNostrLoginDialog() launchNostrLoginDialog()
} }