-
-
Save Daltonic/1ccdce85dbc23ee5ed3c7771619b0d02 to your computer and use it in GitHub Desktop.
Dapp Breeds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Routes, Route } from 'react-router-dom' | |
import Navbar from './components/Navbar' | |
import Footer from './components/Footer' | |
import Home from './pages/Home' | |
import Details from './pages/Details' | |
import Collections from './pages/Collections' | |
import Lab from './pages/Lab' | |
import { isWalletConnected, loadData } from './services/blockchain' | |
import { useEffect } from 'react' | |
import { ToastContainer } from 'react-toastify' | |
import ChatButton from './components/ChatButton' | |
import { checkAuthState } from './services/chat' | |
import ChatList from './components/ChatList' | |
import Spacer from './components/Spacer' | |
import Chat from './pages/Chat' | |
import { useGlobalState } from './store' | |
const App = () => { | |
const [connectedAccount] = useGlobalState('connectedAccount') | |
useEffect(() => { | |
isWalletConnected() | |
const fetchData = async () => { | |
await loadData() | |
await checkAuthState() | |
} | |
fetchData() | |
}, []) | |
return ( | |
<div className="min-h-screen relative"> | |
<Navbar /> | |
<Spacer spaces={2} /> | |
<Routes> | |
<Route path="/" element={<Home />} /> | |
<Route path="/nft/:id" element={<Details />} /> | |
<Route path="/collections" element={<Collections />} /> | |
<Route path="/lab" element={<Lab />} /> | |
<Route path="/chats/:id" element={<Chat />} /> | |
</Routes> | |
<Spacer spaces={7} /> | |
<Footer /> | |
{connectedAccount && <ChatButton />} | |
<ChatList /> | |
<ToastContainer | |
position="bottom-center" | |
autoClose={5000} | |
hideProgressBar={false} | |
newestOnTop={false} | |
closeOnClick | |
rtl={false} | |
pauseOnFocusLoss | |
draggable | |
pauseOnHover | |
theme="dark" | |
/> | |
</div> | |
) | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment