From cc0ed548f828bc02130f4691f00016a94de43ee7 Mon Sep 17 00:00:00 2001
From: rimmon1234 <42698980+rimmon1234@users.noreply.github.com>
Date: Fri, 4 Oct 2024 20:07:59 +0530
Subject: [PATCH] Updated DashboardPage.js
---
src/pages/DashboardPage.js | 36 +++++++++++++-----------------------
1 file changed, 13 insertions(+), 23 deletions(-)
diff --git a/src/pages/DashboardPage.js b/src/pages/DashboardPage.js
index 5b55fdc..abbea85 100644
--- a/src/pages/DashboardPage.js
+++ b/src/pages/DashboardPage.js
@@ -1,4 +1,4 @@
-import React, { useContext, useState } from "react";
+import React, { useContext } from "react";
import { Link, useNavigate } from "react-router-dom";
import {
FaQrcode,
@@ -21,7 +21,8 @@ export default function DashboardPage() {
const { darkMode } = useContext(ThemeContext);
const { logout } = useAuth();
const navigate = useNavigate();
- const dasHBoardCards = [
+
+ const dashboardCards = [
{
to: "/qr-code",
icon: ,
@@ -69,7 +70,7 @@ export default function DashboardPage() {
description: "Convert PDFs to QR codes.",
color: "text-white",
bgColor: "bg-red-600",
- }, // New PDF to QR Section
+ },
{
to: "/profile",
icon: ,
@@ -105,7 +106,6 @@ export default function DashboardPage() {
];
const handleLogout = async () => {
- // Show a confirmation toast
const confirmation = toast(
(t) => (
@@ -140,11 +140,11 @@ export default function DashboardPage() {
),
{
duration: 0, // Keep the toast open until dismissed
- position: 'top-center', // Adjust position if needed
+ position: 'top-center',
}
- )
+ );
};
-
+
return (
- {dasHBoardCards.map(
+ {dashboardCards.map(
({ to, icon, title, description, color, bgColor }, index) => (
-
+
{icon}
@@ -192,16 +188,10 @@ export default function DashboardPage() {
boxShadow: "0px 15px 30px rgba(0, 0, 0, 0.2)",
}}
whileTap={{ scale: 0.98 }}
- className={`p-6 ${
- darkMode ? `bg-gray-600 filter brightness-100 ` : `bg-gray-600`
- } rounded-2xl shadow-lg transition-transform duration-300 cursor-pointer`}
+ className="p-6 bg-gray-600 rounded-2xl shadow-lg transition-transform duration-300 cursor-pointer"
>
-