-
Hello @{userName}
+
Hello @{user?.userName}
{
>
- {userType === "individual" ? "Your Profile" : "Dashboard"}
-
⇧⌘{userType === "club" ? "D" : "P"}
+ {user?.userType === "individual" ? "Your Profile" : "Dashboard"}
- {userType === "club" ? (
-
- Your Events
⌘E
-
+ {user?.userType === "club" ? (
+
Your Events
) : null}
-
- Settings
⌘S
-
+
Settings
-
{
handleLogout();
diff --git a/src/components/shared/navbar/Navbar.scss b/src/components/shared/navbar/Navbar.scss
index 93dc73bf..574b2816 100644
--- a/src/components/shared/navbar/Navbar.scss
+++ b/src/components/shared/navbar/Navbar.scss
@@ -5,6 +5,7 @@
align-items: center;
justify-content: space-between;
z-index: 100;
+ position: relative;
@media screen and (max-width: 430px) {
padding: 0.8rem 1.5rem;
@@ -31,8 +32,8 @@
.navbar_link {
color: #8c321b;
- font-weight: 600;
- font-family: "Poppins", sans-serif;
+ font-weight: 500;
+ font-family: var(--outfit);
text-decoration: none;
font-size: 17px;
line-height: 1;
@@ -127,6 +128,7 @@
justify-content: center;
position: absolute;
top: 20%;
+ align-items: center;
padding-top: 2rem;
.navbar_mobile_link {
@@ -136,6 +138,11 @@
text-decoration: none;
font-size: 17px;
line-height: 1;
+ margin: 0;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ cursor: pointer;
}
.navbar_mobile_cta {
@@ -145,6 +152,8 @@
gap: 5px;
padding: 0.5rem 1rem;
width: auto;
+ display: flex;
+ align-items: center;
}
.navbar_mobile_close {
@@ -178,7 +187,6 @@
display: flex;
flex-direction: column;
justify-content: center;
- color: var(--secondary);
.name {
font-family: var(--outfit);
@@ -194,11 +202,11 @@
.myaccount_separator {
width: 100%;
height: 1px;
- background-color: #e2e5e871;
+ background-color: #e2e5e883;
}
a {
- color: var(--secondary);
+ color: var(--Brand-brand-900, #6b2615);
font-weight: 400;
font-family: var(--outfit);
text-decoration: none;
diff --git a/src/components/shared/profileCompletion/ProfileCompletion.jsx b/src/components/shared/profileCompletion/ProfileCompletion.jsx
index be287fca..52e1e2c3 100644
--- a/src/components/shared/profileCompletion/ProfileCompletion.jsx
+++ b/src/components/shared/profileCompletion/ProfileCompletion.jsx
@@ -1,18 +1,18 @@
/* eslint-disable no-unused-vars */
-import { useState } from "react";
-import { useDispatch, useSelector } from "react-redux";
-
-import { selectUser, updateUserData } from "@redux/slice/userSlice";
+import { selectUser } from "@redux/slice/userSlice";
import { UpdateUser } from "@service/MilanApi";
import { useMutation } from "@tanstack/react-query";
+import getProfileFields from "@utils/getProfileFields";
import { showErrorToast, showSuccessToast } from "@utils/Toasts";
import _ from "lodash";
+import { useState } from "react";
+import { useDispatch, useSelector } from "react-redux";
import { Button } from "..";
-import getProfileFields from "../../../utils/getProfileFields";
import "./ProfileCompletion.scss";
const ProfileCompletion = () => {
const [credentials, setCredentials] = useState({});
+ const [errors, setErrors] = useState({});
const user = useSelector(selectUser);
const fields = getProfileFields(user);
const dispatch = useDispatch();
@@ -24,10 +24,9 @@ const ProfileCompletion = () => {
});
};
- const { mutate: handleUpdateDetails } = useMutation({
+ const { mutate: mutate_UpdateDetails } = useMutation({
mutationFn: UpdateUser,
onSuccess: (data) => {
- dispatch(updateUserData(credentials));
showSuccessToast(data?.message);
},
onError: (error) => {
@@ -35,6 +34,35 @@ const ProfileCompletion = () => {
},
});
+ const handleUpdateDetails = () => {
+ const newErrors = {};
+
+ if (
+ credentials?.tagLine?.length < 20 ||
+ credentials?.tagLine?.length > 100
+ ) {
+ newErrors.tagLine = "Tagline must be between 20 and 100 characters";
+ }
+
+ if (
+ credentials?.description?.length < 100 ||
+ credentials?.description?.length > 500
+ ) {
+ newErrors.description =
+ "Description must be between 100 and 500 characters";
+ }
+
+ if (Object.keys(newErrors).length > 0) {
+ setErrors(newErrors);
+ } else {
+ // Clear errors if there are none
+ setErrors({});
+ mutate_UpdateDetails({
+ credentials: credentials,
+ });
+ }
+ };
+
return (
@@ -74,6 +102,9 @@ const ProfileCompletion = () => {
placeholder={`Enter your ${field}`}
/>
)}
+ {errors[field] && (
+ {errors[field]}
+ )}
))}
diff --git a/src/components/shared/profileCompletion/ProfileCompletion.scss b/src/components/shared/profileCompletion/ProfileCompletion.scss
index 027ec9ac..5e82ec93 100644
--- a/src/components/shared/profileCompletion/ProfileCompletion.scss
+++ b/src/components/shared/profileCompletion/ProfileCompletion.scss
@@ -8,7 +8,7 @@
bottom: 0;
background-color: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(6px);
- z-index: 20;
+ z-index: 101;
display: flex;
justify-content: center;
align-items: center;
@@ -123,6 +123,12 @@
font-size: 10px !important;
}
}
+
+ .profilecompletion_error {
+ color: red;
+ font-size: 15px;
+ margin-top: 5px;
+ }
}
}
diff --git a/src/hooks/useAuth.js b/src/hooks/useAuth.js
index ba6d1ea4..acd3dd50 100644
--- a/src/hooks/useAuth.js
+++ b/src/hooks/useAuth.js
@@ -47,7 +47,13 @@ export function useAuth(authType) {
if (response?.status === 201 || response?.status === 200) {
showSuccessToast(response?.data?.message);
- dispatch(updateUserData({ ...response.data.user, isLoggedIn: true }));
+ dispatch(
+ updateUserData({
+ isLoggedIn: true,
+ email: response.data.user.email,
+ userName: response.data.user.userName,
+ }),
+ );
setTimeout(() => {
navigate("/");
diff --git a/src/pages/auth/SignIn.jsx b/src/pages/auth/SignIn.jsx
index 3e1935f4..4701d1c4 100644
--- a/src/pages/auth/SignIn.jsx
+++ b/src/pages/auth/SignIn.jsx
@@ -5,7 +5,7 @@ import { FaEyeSlash } from "react-icons/fa6";
import { FcGoogle } from "react-icons/fc";
import { Link } from "react-router-dom";
import rightabstract from "../../assets/pictures/authpages/authbanner.png";
-import { Button } from "../../components/shared";
+import { Button, Navbar } from "../../components/shared";
import { useAuth } from "../../hooks/useAuth";
import { GoogleAuth } from "../../service/MilanApi";
import "./index.scss";
@@ -36,6 +36,7 @@ const SignIn = () => {
/>
+
diff --git a/src/pages/auth/SignUp.jsx b/src/pages/auth/SignUp.jsx
index 1d075260..9430839e 100644
--- a/src/pages/auth/SignUp.jsx
+++ b/src/pages/auth/SignUp.jsx
@@ -8,7 +8,7 @@ import { FcGoogle } from "react-icons/fc";
import { Link } from "react-router-dom";
import Select from "react-select";
import rightabstract from "../../assets/pictures/authpages/authbanner.png";
-import { Button } from "../../components/shared";
+import { Button, Navbar } from "../../components/shared";
import { useAuth } from "../../hooks/useAuth";
import { GoogleAuth } from "../../service/MilanApi";
import "./index.scss";
@@ -43,6 +43,8 @@ const SignUp = () => {
+
+
diff --git a/src/pages/auth/index.scss b/src/pages/auth/index.scss
index 0335ef9e..69c1d100 100644
--- a/src/pages/auth/index.scss
+++ b/src/pages/auth/index.scss
@@ -309,7 +309,7 @@
gap: 1rem;
padding: 2rem 1.5rem;
overflow-y: scroll;
- height: 100vh;
+ height: 90vh;
background-color: white;
}
diff --git a/src/pages/dashboard/Dashboard.jsx b/src/pages/dashboard/Dashboard.jsx
index 2763ec4d..98437486 100644
--- a/src/pages/dashboard/Dashboard.jsx
+++ b/src/pages/dashboard/Dashboard.jsx
@@ -9,13 +9,9 @@ import "swiper/css";
import "swiper/css/autoplay";
import "swiper/css/navigation";
import "swiper/css/pagination";
-import useSWR from "swr";
-import EventsMarqueeCards from "../../components/private/events/marquee/EventsMarqueeCards";
import { Button, Navbar, ProfileCompletion } from "../../components/shared";
-import { eventEndpoints } from "../../integrations/ApiEndpoints";
import { fetchDashboard } from "../../service/MilanApi";
import { defaults } from "../../static/Constants";
-import fetcher from "../../utils/Fetcher";
import convertToBase64 from "../../utils/convertToBase64";
import "./Dashboard.scss";
@@ -24,11 +20,13 @@ const Dashboard = () => {
const [coverImage, setCoverImage] = useState("");
const [logo, setLogo] = useState("");
const user = useSelector(selectUser);
- const { data } = useQuery({
- queryKey: ["dashboardData"],
+
+ const { data: dashboardData } = useQuery({
+ queryKey: ["dashboard"],
queryFn: fetchDashboard,
- refetchOnMount: false,
- retry: 2,
+ refetchOnMount: true,
+ refetchOnWindowFocus: false,
+ retry: 0,
});
const toggleExpand = () => {
@@ -48,7 +46,7 @@ const Dashboard = () => {
}
};
- const { data: events } = useSWR(eventEndpoints.all, fetcher);
+ // const { data: events } = useSWR(eventEndpoints.all, fetcher);
const handleUpdateProfile = () => {
console.log("Update Profile");
@@ -112,18 +110,11 @@ const Dashboard = () => {
- {data?.name}{" "}
+ {dashboardData?.name}{" "}
- {data?.tagline ? (
- {data?.tagline}
- ) : (
-
- {" "}
- Lorem ipsum dolor sit amet consectetur adipisicing elit.
- Impedit cum laudantium
+ {dashboardData?.tagline && (
+
+ {dashboardData?.tagline}
)}
@@ -150,14 +141,10 @@ const Dashboard = () => {
-
{data?.name}
- {data?.tagline ? (
- {data?.tagline}
- ) : (
-
- {" "}
- Lorem ipsum dolor sit amet consectetur adipisicing elit.
- Impedit cum laudantium
+ {dashboardData?.name}
+ {dashboardData?.tagline && (
+
+ {dashboardData?.tagline}
)}
@@ -172,7 +159,7 @@ const Dashboard = () => {
- {data?.description && (
+ {dashboardData?.description && (
About Us
@@ -181,7 +168,7 @@ const Dashboard = () => {
isExpanded ? "expanded" : ""
}`}
>
- {data?.description}
+ {dashboardData?.description}
{!isExpanded && (
@@ -197,7 +184,7 @@ const Dashboard = () => {
)}
- {data?.events && (
+ {/* {data?.events && (
Events Hosted
@@ -207,7 +194,7 @@ const Dashboard = () => {
))}
- )}
+ )} */}