Skip to content

Commit

Permalink
MInor UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sikehish committed Sep 30, 2024
1 parent 3446acf commit 7bc9b9a
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 45 deletions.
3 changes: 2 additions & 1 deletion AI-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 1,4 @@
.venv
reports/
__pycache__/
__pycache__/
venv
6 changes: 6 additions & 0 deletions AI-backend/package-lock.json

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

10 changes: 10 additions & 0 deletions blabber-frontend/package-lock.json

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

1 change: 1 addition & 0 deletions blabber-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 14,7 @@
"@heroicons/react": "^2.1.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-modal": "^3.16.1",
"react-router-dom": "^6.26.2",
"react-toastify": "^10.0.5"
Expand Down
4 changes: 2 additions & 2 deletions blabber-frontend/src/components/Footer.jsx
Original file line number Diff line number Diff line change
@@ -1,9 1,9 @@
function Footer() {
return (
<footer className="footer-bottom w-full py-3 bg-gray-100 text-center">
<footer className="footer-bottom fixed bottom-0 w-full py-3 bg-gray-100 text-center">
&copy; {new Date().getFullYear()} Blabber. All rights reserved.
</footer>
);
}

export default Footer;
export default Footer;
94 changes: 52 additions & 42 deletions blabber-frontend/src/pages/Dashboard.jsx
Original file line number Diff line number Diff line change
@@ -1,5 1,6 @@
import { useEffect, useState } from 'react';
import MeetCard from '../components/MeetCard';
import { FaExclamationCircle, FaSpinner, FaCalendarTimes } from 'react-icons/fa';

const Dashboard = () => {
const [meets, setMeets] = useState([]);
Expand Down Expand Up @@ -30,7 31,6 @@ const Dashboard = () => {
};

const fetchAutoEnabled = async () => {
// Fetch the auto-enabled state for the user from the server
try {
const response = await fetch('/api/auto-enabled', {
method: 'GET',
Expand All @@ -48,9 48,8 @@ const Dashboard = () => {
}, []);

const handleToggleChange = async () => {
setAutoEnabled(!autoEnabled); // Toggle the state
setAutoEnabled(!autoEnabled);

// Send updated autoEnabled state to the server
try {
await fetch('/api/auto-enabled', {
method: 'POST',
Expand All @@ -66,48 65,59 @@ const Dashboard = () => {
};

return (
<div className="relative">
<div className="flex flex-col items-center p-6">
<div className="flex justify-between w-full items-center mb-4">
<h1 className="text-2xl font-bold">Meet Dashboard</h1>

<div className="flex items-center">
<span className="mr-2 text-gray-700">Get email report after every meet</span>
<button
className={`relative inline-flex items-center h-6 rounded-full w-11 focus:outline-none ${autoEnabled ? 'bg-blue-500' : 'bg-gray-300'}`}
onClick={handleToggleChange}
>
<span
className={`inline-block w-5 h-5 transform bg-white rounded-full transition-transform ${
autoEnabled ? 'translate-x-5' : 'translate-x-1'
}`}
/>
</button>
</div>
</div>
<div className="relative min-h-screen flex flex-col items-center p-6">
<div className="flex justify-between w-full items-center mb-6">
<h1 className="text-3xl font-bold text-gray-900">Meet Dashboard</h1>

{loading && (
<div className="text-lg text-gray-500">Loading meets...</div>
)}

{error && (
<div className="text-red-500 mb-4">{error}</div>
)}

<div className="flex flex-wrap justify-center">
{!error && meets.length === 0 && !loading && (
<div className="text-lg text-gray-500">No meets available.</div>
)}

{meets.map(meet => (
<MeetCard
key={meet._id}
meet={meet}
isModalOpen={isModalOpen}
setIsModalOpen={setIsModalOpen}
<div className="flex items-center">
<span className="mr-2 text-gray-700">Get email report after every meet</span>
<button
className={`relative inline-flex items-center h-6 rounded-full w-11 focus:outline-none ${autoEnabled ? 'bg-blue-500' : 'bg-gray-300'}`}
onClick={handleToggleChange}
>
<span
className={`inline-block w-5 h-5 transform bg-white rounded-full transition-transform ${
autoEnabled ? 'translate-x-5' : 'translate-x-1'
}`}
/>
))}
</button>
</div>
</div>

{/* Loading State */}
{loading && (
<div className="flex flex-col items-center justify-center mt-10">
<FaSpinner className="animate-spin text-blue-500 text-4xl mb-2" />
<span className="text-xl font-semibold text-blue-500">Loading meets...</span>
</div>
)}

{/* Error State */}
{error && (
<div className="flex flex-col items-center justify-center mt-10">
<FaExclamationCircle className="text-red-500 text-4xl mb-2" />
<span className="text-xl font-semibold text-red-500">{error}</span>
</div>
)}

{/* No Meets Available State */}
{!loading && !error && meets.length === 0 && (
<div className="flex flex-col items-center justify-center mt-10">
<FaCalendarTimes className="text-gray-500 text-4xl mb-2" />
<span className="text-xl font-semibold text-gray-500">No meets available.</span>
</div>
)}

{/* Meet Cards */}
<div className="flex flex-wrap justify-center mt-6">
{meets.map(meet => (
<MeetCard
key={meet._id}
meet={meet}
isModalOpen={isModalOpen}
setIsModalOpen={setIsModalOpen}
/>
))}
</div>

{/* Dim background when modal is open */}
Expand Down

0 comments on commit 7bc9b9a

Please sign in to comment.