From d97492c9bb88a402e2ec07b3bbf8895956d2144a Mon Sep 17 00:00:00 2001 From: Aniket Date: Wed, 5 Nov 2025 23:48:58 +0530 Subject: [PATCH] Improved View Profile modal layout to full-screen with click-outside close behavior --- .../collaboration-hub/ViewProfileModal.tsx | 152 ++++++++++++++---- 1 file changed, 119 insertions(+), 33 deletions(-) diff --git a/Frontend/src/components/collaboration-hub/ViewProfileModal.tsx b/Frontend/src/components/collaboration-hub/ViewProfileModal.tsx index 138b242..ec3f2a3 100644 --- a/Frontend/src/components/collaboration-hub/ViewProfileModal.tsx +++ b/Frontend/src/components/collaboration-hub/ViewProfileModal.tsx @@ -3,6 +3,7 @@ import { mockProfileDetails, mockWhyMatch } from "./mockProfileData"; import { Button } from "../ui/button"; import { Avatar, AvatarFallback, AvatarImage } from "../ui/avatar"; import { Badge } from "../ui/badge"; +import { X } from "lucide-react"; interface WhyMatchReason { point: string; @@ -19,66 +20,151 @@ interface ViewProfileModalProps { whyMatch?: WhyMatchReason[]; } -const ViewProfileModal: React.FC = ({ open, onClose, onConnect, matchPercentage = defaultMatch, whyMatch = mockWhyMatch }) => { +const ViewProfileModal: React.FC = ({ + open, + onClose, + onConnect, + matchPercentage = defaultMatch, + whyMatch = mockWhyMatch, +}) => { if (!open) return null; const profile = mockProfileDetails; + + const handleOverlayClick = (e: React.MouseEvent) => { + if (e.target === e.currentTarget) onClose(); + }; + return ( -
-
- -
- +
+ {/* Modal container */} +
+ + {/* Close button */} + + + + {/* Header Section */} +
+ {matchPercentage}% Match - + - {profile.name.slice(0,2).toUpperCase()} + + {profile.name.slice(0, 2).toUpperCase()} + -

{profile.name}

-
{profile.contentType} • {profile.location}
+

+ {profile.name} +

+

+ {profile.contentType} • {profile.location} +

-
{profile.bio}
-
+ + {/* Bio */} +

+ {profile.bio} +

+ + {/* Social Links */} + -
-
Followers
{profile.followers}
-
Engagement
{profile.engagement}
-
Content
{profile.content}
-
Collabs
{profile.collabs} completed
+ + {/* Stats */} +
+
+
{profile.followers}
+
Followers
+
+
+
{profile.engagement}
+
Engagement
+
+
+
{profile.content}
+
Content
+
+
+
{profile.collabs}
+
Collabs
+
-
-
Why you match
-
    + + {/* Why Match Section */} +
    +

    + Why You Match +

    +
      {whyMatch.map((reason, idx) => (
    • -
      {reason.point}
      -
      {reason.description}
      +

      + {reason.point} +

      +

      + {reason.description} +

    • ))}
    - + + {/* Connect Button */} +
    + +
); }; -export default ViewProfileModal; \ No newline at end of file +export default ViewProfileModal;