forked from ayesha1209/taskChamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
143 lines (98 loc) · 3.44 KB
/
App.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import React, { useEffect ,useState} from "react";
import {BrowserRouter,Router ,Route, Routes} from "react-router-dom";
import logo from "./logo.svg";
import "./App.css";
// import "./Components/chatComponents/styles.scss"
// import "./Components/stylescommunity.css"
import Chat from "./Components/Chat"
// import Home from "./Components/chatComponents/Home"
import StreakCalendar from "./Components/StreakCalendar";
import MyActivity from "./Components/MyActivity";
import Footer from "./Components/Footer";
import UserProfile from "./Components/UserProfile";
import LeaderBoard from "./Components/LeaderBoard";
import Registration from "./Components/Registration";
import Login from "./Components/Login";
// import { UserList } from './Components/UserList';
//import { createOrGetChat } from './Components/ChatUtils';
function App() {
// return (
// <div className="App">
// <header className="App-header">
// <img src={logo} className="App-logo" alt="logo" />
// <p>
// Edit <code>src/App.js</code> and save to reload.
// </p>
// <a
// className="App-link"
// href="https://reactjs.org"
// target="_blank"
// rel="noopener noreferrer"
// >
// Learn React
// </a>
// </header>
// </div>
// );
// return (
// <div>
// <MyComponent></MyComponent>
// </div>
// );
const userId = "user_1729172812032"; // Example user ID, replace as needed
const mockUser = { id: userId, username: 'aashi' }; // Replace with actual user data
// const [chatId, setChatId] = useState(null); // For storing the active chat ID
// const [selectedUser, setSelectedUser] = useState(null); // For storing the selected user
// const currentUser = { id: userId, username: "ExampleUser" }; // Mock current user
// // Function to handle user selection and create/get a chat session
// const handleUserSelect = (user) => {
// createOrGetChat(currentUser.id, user.id).then((chatId) => {
// setChatId(chatId); // Set the chat ID for the session
// setSelectedUser(user); // Set the selected user
// });
// };
// return (
// <div>
// <MyActivity userId={userId}></MyActivity>
// </div>
// );
//return (
//<div>
//<UserProfile userId={userId}></UserProfile>
// return (
// <div>
// <LeaderBoard />
// </div>
// );
// return (
// <div>
// <Registration></Registration>
// <Login userId={userId}></Login>
// </div>
// );
return (
<div>
{/* Uncomment and modify these returns based on your need */}
{/* <MyActivity userId={userId}></MyActivity> */}
{/* <UserProfile userId={userId}></UserProfile> */}
{/* Render UserList if no chatId is selected, else show the Chat component */}
{/* {!chatId ? (
<UserList onUserSelect={handleUserSelect} />
) : (
<Chat chatId={chatId} currentUser={currentUser} />
)} */}
{/* <Home/> */}
{/* <Chat></Chat> */}
{/* <Login></Login> */}
<BrowserRouter>
<Routes>
<Route path="/Login" element={<Login/>}></Route>
<Route path="/Registration" element={<Registration userId={ userId}/>}></Route>
<Route path="/MyActivity" element={<MyActivity userId={userId} />} />
<Route path="/Chat" element={<Chat userId={userId} />} />
</Routes>
</BrowserRouter>
</div>
);
}
export default App;