mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-27 11:14:33 +01:00
- fix navbar height - remove input shadow - change donateCard options style - add 2px borders to cards - remove search from nav on sections other than products - implement useMediaQuery
67 lines
2.4 KiB
TypeScript
67 lines
2.4 KiB
TypeScript
import React, { Suspense, useEffect } from "react";
|
|
import Navbar from "src/Components/Navbar/Navbar";
|
|
import ModalsContainer from "src/Components/Modals/ModalsContainer/ModalsContainer";
|
|
import { useAppSelector } from './utils/hooks';
|
|
import { Wallet_Service } from "./services";
|
|
import { Navigate, Route, Routes } from "react-router-dom";
|
|
import { useWrapperSetup } from "./utils/Wrapper";
|
|
import LoadingPage from "./Components/LoadingPage/LoadingPage";
|
|
|
|
// Pages
|
|
const FeedPage = React.lazy(() => import("./features/Posts/pages/FeedPage/FeedPage"))
|
|
const HackathonsPage = React.lazy(() => import("./features/Hackathons/pages/HackathonsPage/HackathonsPage"))
|
|
const HottestPage = React.lazy(() => import("src/features/Projects/pages/HottestPage/HottestPage"))
|
|
const PostDetailsPage = React.lazy(() => import("./features/Posts/pages/PostDetailsPage/PostDetailsPage"))
|
|
const CategoryPage = React.lazy(() => import("src/features/Projects/pages/CategoryPage/CategoryPage"))
|
|
const ExplorePage = React.lazy(() => import("src/features/Projects/pages/ExplorePage"))
|
|
const DonatePage = React.lazy(() => import("./features/Donations/pages/DonatePage/DonatePage"))
|
|
|
|
function App() {
|
|
const { isWalletConnected } = useAppSelector(state => ({
|
|
isWalletConnected: state.wallet.isConnected,
|
|
}));
|
|
|
|
useWrapperSetup()
|
|
|
|
|
|
useEffect(() => {
|
|
// if (typeof window.webln != "undefined") {
|
|
// alert('hi')
|
|
// window.webln.enable().then((res: any) => {
|
|
// dispatch(connectWallet(window.webln));
|
|
// console.log("called:webln.enable()", res);
|
|
// }).catch((err: any) => {
|
|
// console.log("error:webln.enable()", err);
|
|
// });
|
|
// }
|
|
setTimeout(() => {
|
|
Wallet_Service.init();
|
|
}, 2000)
|
|
}, []);
|
|
|
|
|
|
|
|
return <div id="app" className='w-full'>
|
|
<Navbar />
|
|
<Suspense fallback={<LoadingPage />}>
|
|
<Routes>
|
|
<Route path="/products/hottest" element={<HottestPage />} />
|
|
<Route path="/products/category/:id" element={<CategoryPage />} />
|
|
<Route path="/products" element={<ExplorePage />} />
|
|
|
|
<Route path="/blog/post/:type/:id" element={<PostDetailsPage />} />
|
|
<Route path="/blog" element={<FeedPage />} />
|
|
|
|
<Route path="/hackathons" element={<HackathonsPage />} />
|
|
|
|
<Route path="/donate" element={<DonatePage />} />
|
|
|
|
<Route path="/" element={<Navigate to="/products" />} />
|
|
</Routes>
|
|
</Suspense>
|
|
<ModalsContainer />
|
|
</div>;
|
|
}
|
|
|
|
export default App;
|