import React, { ComponentType, useEffect, useState } from "https://esm.sh/react@17.0.2"; import { StoreProvider } from "https://esm.sh/easy-peasy"; import store, { useStoreActions } from "./state/index.ts"; import config from "./back/config/config.ts"; const forkName = config.fork.name; const twitterHandle = config.frontend.twitterHandle; function StoreStarter({ Page, pageProps }: { Page: ComponentType; pageProps: any }) { const [gotBlocks, setGotBlocks] = useState(false); const getBlocks = useStoreActions((store) => store.getBlocks); const autoRefresh = useStoreActions((store) => store.autoRefresh); useEffect(() => { (async () => { await getBlocks(); autoRefresh(); setGotBlocks(true); })(); }, []); if (!gotBlocks) { return null; } return ; } export default function App({ Page, pageProps }: { Page: ComponentType; pageProps: any }) { return (
{twitterHandle && ( <> )}
); }