Skip to content

Commit

Permalink
Merge pull request #356 from Ansh101112/themeui
Browse files Browse the repository at this point in the history
admin new functionality added
  • Loading branch information
usha-madithati authored Jun 30, 2024
2 parents b02b928 + ef97b7a commit 4d01f42
Showing 1 changed file with 33 additions and 6 deletions.
39 changes: 33 additions & 6 deletions src/Dashboards/AdminD.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: [
Expand Down Expand Up @@ -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>
</>
);
};
Expand Down

0 comments on commit 4d01f42

Please sign in to comment.