Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^13.5.0",
"firebase": "^12.7.0",
"gapi-script": "^1.2.0",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"react-router-dom": "^7.12.0",
Expand Down Expand Up @@ -48,4 +49,4 @@
"postcss": "^8.4.35",
"tailwindcss": "^3.4.10"
}
}
}
23 changes: 19 additions & 4 deletions dashboard/src/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react";
import { auth, logout } from "./firebase";
import { auth } from "./firebase";
import { onAuthStateChanged } from "firebase/auth";

import { gapi } from "gapi-script";
import Navbar from "./components/Navbar";
import SignIn from "./components/SignIn";

Expand All @@ -17,6 +17,18 @@ function App() {
const [loading, setLoading] = useState(true);
const [activeTab, setActiveTab] = useState("tasks");


useEffect(() => {
const initClient = () => {
gapi.client.init({
discoveryDocs: ["https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest"],
scope: "https://www.googleapis.com/auth/calendar.events",
});
};
gapi.load("client:auth2", initClient);
}, []);


useEffect(() => {
const unsubscribe = onAuthStateChanged(auth, (currentUser) => {
console.log("Auth state changed:", currentUser);
Expand Down Expand Up @@ -50,7 +62,10 @@ function App() {
if (loading) {
return (
<div className="h-screen flex items-center justify-center">
Loading...
<div className="flex flex-col items-center gap-2">
<div className="w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"></div>
<span className="text-gray-600 font-medium">Loading Workflow...</span>
</div>
</div>
);
}
Expand All @@ -75,4 +90,4 @@ function App() {
);
}

export default App;
export default App;
Loading