-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathApp.jsx
More file actions
41 lines (37 loc) · 1.09 KB
/
App.jsx
File metadata and controls
41 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react';
import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom';
import Layout from './components/Layout';
import SocialFeed from './components/SocialFeed';
import RaiseIssue from './components/RaiseIssue';
import CampaignDetail from './components/CampaignDetail';
import UserProfile from './components/UserProfile';
import Login from './components/Login';
import './App.css';
const AppContent = () => {
const location = useLocation();
const noLayoutRoutes = ['/login'];
return (
noLayoutRoutes.includes(location.pathname) ? (
<Routes>
<Route path="/login" element={<Login />} />
</Routes>
) : (
<Layout>
<Routes>
<Route path="/" element={<SocialFeed />} />
<Route path="/raise-issue" element={<RaiseIssue />} />
<Route path="/campaign" element={<CampaignDetail />} />
<Route path="/profile" element={<UserProfile />} />
</Routes>
</Layout>
)
);
};
function App() {
return (
<Router>
<AppContent />
</Router>
);
}
export default App;