-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #356 from Ansh101112/themeui
admin new functionality added
- Loading branch information
Showing
1 changed file
with
33 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react"; | |
import axios from "axios"; | ||
import { toast, ToastContainer } from "react-toastify"; | ||
import { useNavigate } from "react-router-dom"; | ||
import Footer from "../components/Footer"; | ||
import { | ||
Chart as ChartJS, | ||
CategoryScale, | ||
|
@@ -43,6 +44,18 @@ const AdminD = () => { | |
toast.error("Error doing logout. Try again."); | ||
} | ||
}; | ||
|
||
const handleSetting = () => { | ||
navigate("/user/settings"); | ||
}; | ||
|
||
const handleManageDatabase = () => { | ||
window.open( | ||
"mongodb+srv://usha15322:SmartSaver%[email protected]/", | ||
"_blank" | ||
); | ||
}; | ||
|
||
const [barData, setBarData] = useState({ | ||
labels: [], | ||
datasets: [ | ||
|
@@ -232,13 +245,27 @@ const AdminD = () => { | |
</tbody> | ||
</table> | ||
</div> | ||
<button | ||
className="rounded-lg bg-blue-500 px-4 m-2 justify-center align-item-center py-2 text-white hover:bg-blue-600" | ||
onClick={handleLogout} | ||
> | ||
Logout | ||
</button> | ||
|
||
<div className="px-3 py-4 m-3 shadow-md rounded-lg"> | ||
<h3>Manage Database</h3> | ||
<button | ||
className="rounded-lg bg-blue-500 px-4 m-2 justify-center align-item-center py-2 text-white hover:bg-blue-600" | ||
onClick={handleManageDatabase} | ||
> | ||
Open MongoDB Atlas | ||
</button> | ||
</div> | ||
<div className="px-3 py-4 m-3 shadow-md rounded-lg"> | ||
<h3>Other Settings</h3> | ||
<button | ||
className="rounded-lg bg-black px-4 m-2 justify-center align-item-center py-2 text-white hover:bg-blue-600" | ||
onClick={handleSetting} | ||
> | ||
Settings | ||
</button> | ||
</div> | ||
</div> | ||
<Footer></Footer> | ||
</> | ||
); | ||
}; | ||
|