refactor(frontend): simplify event chat UI
- Replace "Edit heats" button with icon-only version - Remove connection status indicator (show "Disconnected" warning only when offline) - Remove event location from header - Hide Participants tab on desktop (sidebar already visible) - Remove "Participants" header from sidebar on desktop
This commit is contained in:
@@ -37,7 +37,8 @@ const ParticipantsSidebar = ({
|
||||
onHideMyHeatsChange,
|
||||
onMatchWith,
|
||||
className = '',
|
||||
fullWidth = false
|
||||
fullWidth = false,
|
||||
showHeader = true
|
||||
}) => {
|
||||
const participantCount = users.length;
|
||||
const onlineCount = activeUsers.length;
|
||||
@@ -45,6 +46,7 @@ const ParticipantsSidebar = ({
|
||||
return (
|
||||
<div className={`${fullWidth ? 'w-full' : 'w-64 border-r'} bg-gray-50 p-4 overflow-y-auto ${className}`}>
|
||||
{/* Header */}
|
||||
{showHeader && (
|
||||
<div className="mb-4">
|
||||
<h3 className="font-semibold text-gray-900 mb-2">
|
||||
Participants ({participantCount})
|
||||
@@ -52,9 +54,12 @@ const ParticipantsSidebar = ({
|
||||
<p className="text-xs text-gray-500 mb-3">
|
||||
{onlineCount} online
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Filter Checkbox */}
|
||||
{myHeats.length > 0 && (
|
||||
<div className="mb-4">
|
||||
<label className="flex items-center gap-2 text-sm text-gray-700 cursor-pointer hover:text-gray-900">
|
||||
<input
|
||||
type="checkbox"
|
||||
@@ -65,8 +70,8 @@ const ParticipantsSidebar = ({
|
||||
<Filter className="w-3 h-3" />
|
||||
<span>Hide users from my heats</span>
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Empty State */}
|
||||
{participantCount === 0 && (
|
||||
|
||||
@@ -359,12 +359,7 @@ const EventChatPage = () => {
|
||||
<div className="flex items-start justify-between">
|
||||
<div className="flex-1">
|
||||
<h2 className="text-2xl font-bold">{event.name}</h2>
|
||||
<p className="text-primary-100 text-sm">{event.location}</p>
|
||||
<div className="mt-2 flex items-center gap-3">
|
||||
<span className={`text-xs px-2 py-1 rounded ${isConnected ? 'bg-green-500' : 'bg-red-500'}`}>
|
||||
{isConnected ? '● Connected' : '● Disconnected'}
|
||||
</span>
|
||||
|
||||
{/* My Heats Display */}
|
||||
{myHeats.length > 0 && (
|
||||
<div className="flex items-center gap-2">
|
||||
@@ -382,15 +377,15 @@ const EventChatPage = () => {
|
||||
{myHeats.length > 0 && (
|
||||
<button
|
||||
onClick={() => setShowHeatsModal(true)}
|
||||
className="flex items-center gap-2 px-3 py-2 bg-primary-700 hover:bg-primary-800 rounded-md transition-colors text-sm"
|
||||
className="p-2 bg-primary-700 hover:bg-primary-800 rounded-md transition-colors"
|
||||
title="Edit heats"
|
||||
>
|
||||
<Edit2 className="w-4 h-4" />
|
||||
Edit Heats
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
onClick={() => setShowLeaveModal(true)}
|
||||
className="flex items-center gap-2 px-3 py-2 bg-red-600 hover:bg-red-700 rounded-md transition-colors text-sm"
|
||||
className="p-2 bg-red-600 hover:bg-red-700 rounded-md transition-colors"
|
||||
title="Leave Event"
|
||||
>
|
||||
<LogOut size={16} />
|
||||
@@ -399,6 +394,14 @@ const EventChatPage = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Disconnected Warning - show only when disconnected */}
|
||||
{!isConnected && (
|
||||
<div className="bg-red-600 text-white px-4 py-2 text-sm flex items-center gap-2">
|
||||
<AlertTriangle className="w-4 h-4" />
|
||||
<span>Disconnected</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Heats Banner */}
|
||||
{showHeatsBanner && (
|
||||
<HeatsBanner
|
||||
@@ -425,7 +428,7 @@ const EventChatPage = () => {
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setActiveTab('participants')}
|
||||
className={`flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors ${
|
||||
className={`lg:hidden flex items-center gap-2 px-4 py-3 text-sm font-medium border-b-2 transition-colors ${
|
||||
activeTab === 'participants'
|
||||
? 'border-primary-600 text-primary-600 bg-white'
|
||||
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
|
||||
@@ -467,6 +470,7 @@ const EventChatPage = () => {
|
||||
hideMyHeats={hideMyHeats}
|
||||
onHideMyHeatsChange={setHideMyHeats}
|
||||
onMatchWith={handleMatchWith}
|
||||
showHeader={false}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user