From 396d68649f8c150a8613415bdd9ff9fc8ed57f46 Mon Sep 17 00:00:00 2001 From: pradeepkumar Date: Sat, 18 Apr 2026 11:32:45 +0530 Subject: [PATCH] feat: replace mobile agent card slider with horizontal swipe carousel and improve messaging header responsiveness --- .../network/component/ConnectionCard.tsx | 67 +++++++++---------- src/components/home/FeaturesSection.tsx | 24 +++++-- src/components/message/MessageInput.tsx | 5 +- src/components/message/MessagingPage.tsx | 8 +-- src/components/profiles/FilterModal.tsx | 2 +- src/components/settings/NotificationsForm.tsx | 6 +- 6 files changed, 60 insertions(+), 52 deletions(-) diff --git a/src/app/(agent)/agent/network/component/ConnectionCard.tsx b/src/app/(agent)/agent/network/component/ConnectionCard.tsx index 6b780c2..e01b8f4 100644 --- a/src/app/(agent)/agent/network/component/ConnectionCard.tsx +++ b/src/app/(agent)/agent/network/component/ConnectionCard.tsx @@ -33,14 +33,14 @@ export function ConnectionCard({ const isPlaceholder = !avatar || avatar === placeholder; return ( -
+
{/* Avatar */}
-
+
{/* Shimmer while loading, initials only on error */} {avatarError || isPlaceholder ? (
- {name?.[0]?.toUpperCase() || '?'} + {name?.[0]?.toUpperCase() || '?'}
) : !avatarLoaded ? (
@@ -58,40 +58,37 @@ export function ConnectionCard({
- {/* Content */} -
- {/* Name */} -

- {name} -

- - {/* Email */} -

- {email} -

- - {/* Connected date */} - {connectedAt && ( -

- Connected on {formatDate(connectedAt)} + {/* Content + Message button (stacks on mobile, inline on desktop) */} +

+
+

+ {name} +

+

+ {email}

- )} -
+ {connectedAt && ( +

+ Connected on {formatDate(connectedAt)} +

+ )} +
- {/* Action Buttons */} -
- + {/* Action Button */} +
+ +
); diff --git a/src/components/home/FeaturesSection.tsx b/src/components/home/FeaturesSection.tsx index f6cf5b0..bffa99f 100644 --- a/src/components/home/FeaturesSection.tsx +++ b/src/components/home/FeaturesSection.tsx @@ -106,18 +106,30 @@ export function FeaturesSection({ content }: { content?: FeaturesContent }) {
)} - {/* Mobile Agent Cards - Tab style with dots */} + {/* Mobile Agent Cards - Horizontal swipe carousel */} {agents.length > 0 && (
-
- +
{ + const el = e.currentTarget; + const cardWidth = el.children[0]?.clientWidth || 254; + const gap = 16; + const idx = Math.round(el.scrollLeft / (cardWidth + gap)); + if (idx !== activeCard) setActiveCard(idx); + }} + > + {agents.map((agent, index) => ( +
+ +
+ ))}
- {/* Dot indicators */} + {/* Dot indicators (visual only — swipe to change) */}
{agents.map((_, index) => ( - {expandedSections[field.slug] && ( -
6 ? 'grid-cols-3' : 'grid-cols-3'} gap-x-6 gap-y-3`}> +
{field.options.map((option) => (