1
0
forked from Kieran/snort

chore: purge js

This commit is contained in:
Kieran 2023-01-18 23:39:50 +00:00
parent c185f3f6e9
commit b35608c17d
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
3 changed files with 7 additions and 34 deletions

View File

@ -33,7 +33,7 @@ export default function Note(props: NoteProps) {
const pubKeys = useMemo(() => ev.Thread?.PubKeys || [], [ev]); const pubKeys = useMemo(() => ev.Thread?.PubKeys || [], [ev]);
const users = useProfile(pubKeys); const users = useProfile(pubKeys);
const deletions = useMemo(() => getReactions(related, ev.Id, EventKind.Deletion), [related]); const deletions = useMemo(() => getReactions(related, ev.Id, EventKind.Deletion), [related]);
const { ref, inView } = useInView({triggerOnce: true}); const { ref, inView } = useInView({ triggerOnce: true });
const options = { const options = {
showHeader: true, showHeader: true,

View File

@ -1,15 +1,14 @@
import './index.css'; import './index.css';
import React from 'react'; import { StrictMode } from 'react';
import { QueryClient, QueryClientProvider } from 'react-query'; import { QueryClient, QueryClientProvider } from 'react-query';
import ReactDOM from 'react-dom/client'; import * as ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux' import { Provider } from 'react-redux'
import { import {
createBrowserRouter, createBrowserRouter,
RouterProvider, RouterProvider,
} from "react-router-dom"; } from "react-router-dom";
import { NostrSystem } from './nostr/System';
import EventPage from './pages/EventPage'; import EventPage from './pages/EventPage';
import Layout from './pages/Layout'; import Layout from './pages/Layout';
import LoginPage from './pages/Login'; import LoginPage from './pages/Login';
@ -78,13 +77,13 @@ const router = createBrowserRouter([
} }
]); ]);
const root = ReactDOM.createRoot(document.getElementById('root')); const root = ReactDOM.createRoot(document.getElementById('root')!);
root.render( root.render(
<React.StrictMode> <StrictMode>
<Provider store={Store}> <Provider store={Store}>
<QueryClientProvider client={HTTP}> <QueryClientProvider client={HTTP}>
<RouterProvider router={router} /> <RouterProvider router={router} />
</QueryClientProvider> </QueryClientProvider>
</Provider> </Provider>
</React.StrictMode> </StrictMode>
); );

View File

@ -1,26 +0,0 @@
import { useEffect, useState } from "react";
export default function useScroll() {
const [eop, setEop] = useState(false);
function handleScroll(e) {
let target = e.path[1];
let y = target.scrollY + target.innerHeight;
let h = e.target.scrollingElement.offsetHeight;
let padding = 10;
let atEnd = y + padding >= h;
setEop((s) => {
if (s !== atEnd) {
return atEnd;
}
return s;
});
}
useEffect(() => {
window.addEventListener("scroll", handleScroll, { passive: true });
return () => window.removeEventListener("scroll", handleScroll);
}, []);
return [eop];
}