fix(frontend): ensure consistent width across all matches tabs
- Add w-full to MatchCard for consistent card width - Use Layout noPadding to avoid padding conflicts - Add explicit padding and width control to main container - Ensure All, Pending, and Active tabs have identical width
This commit is contained in:
@@ -12,7 +12,7 @@ const MatchCard = ({ match, onAccept, onReject, onOpenChat, processing }) => {
|
|||||||
const isAccepted = match.status === MATCH_STATUS.ACCEPTED;
|
const isAccepted = match.status === MATCH_STATUS.ACCEPTED;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-white rounded-lg shadow-sm border border-gray-200 p-4 hover:shadow-md transition-shadow">
|
<div className="w-full bg-white rounded-lg shadow-sm border border-gray-200 p-4 hover:shadow-md transition-shadow">
|
||||||
<div className="flex items-start justify-between">
|
<div className="flex items-start justify-between">
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<div className="flex items-center gap-3 mb-2">
|
<div className="flex items-center gap-3 mb-2">
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ const MatchesPage = () => {
|
|||||||
const otherMatches = filteredMatches.filter(m => !(m.status === MATCH_STATUS.PENDING && !m.isInitiator));
|
const otherMatches = filteredMatches.filter(m => !(m.status === MATCH_STATUS.PENDING && !m.isInitiator));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout noPadding>
|
||||||
<div className="max-w-4xl mx-auto">
|
<div className="w-full max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<h1 className="text-3xl font-bold text-gray-900">Match Requests</h1>
|
<h1 className="text-3xl font-bold text-gray-900">Match Requests</h1>
|
||||||
<p className="text-gray-600 mt-2">
|
<p className="text-gray-600 mt-2">
|
||||||
@@ -135,7 +135,7 @@ const MatchesPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Filter Tabs */}
|
{/* Filter Tabs */}
|
||||||
<div className="bg-white rounded-lg shadow-sm p-1 mb-6 flex gap-1">
|
<div className="w-full bg-white rounded-lg shadow-sm p-1 mb-6 flex gap-1">
|
||||||
<button
|
<button
|
||||||
onClick={() => setFilter(MATCH_FILTER.ALL)}
|
onClick={() => setFilter(MATCH_FILTER.ALL)}
|
||||||
className={`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
className={`flex-1 px-4 py-2 rounded-md text-sm font-medium transition-colors ${
|
||||||
@@ -172,8 +172,20 @@ const MatchesPage = () => {
|
|||||||
<div className="flex justify-center items-center py-12">
|
<div className="flex justify-center items-center py-12">
|
||||||
<Loader2 className="w-8 h-8 animate-spin text-primary-600" />
|
<Loader2 className="w-8 h-8 animate-spin text-primary-600" />
|
||||||
</div>
|
</div>
|
||||||
|
) : filteredMatches.length === 0 ? (
|
||||||
|
<div className="w-full text-center py-12">
|
||||||
|
<Users className="w-16 h-16 text-gray-300 mx-auto mb-4" />
|
||||||
|
<h3 className="text-lg font-medium text-gray-900 mb-2">
|
||||||
|
No matches found
|
||||||
|
</h3>
|
||||||
|
<p className="text-gray-600">
|
||||||
|
{filter === 'all'
|
||||||
|
? 'You have no match requests yet. Connect with other dancers at events!'
|
||||||
|
: `You have no ${filter} matches.`}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<div className="w-full">
|
||||||
{/* Pending Incoming Requests Section */}
|
{/* Pending Incoming Requests Section */}
|
||||||
{pendingIncoming.length > 0 && (
|
{pendingIncoming.length > 0 && (
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
@@ -198,7 +210,7 @@ const MatchesPage = () => {
|
|||||||
|
|
||||||
{/* Other Matches */}
|
{/* Other Matches */}
|
||||||
{otherMatches.length > 0 && (
|
{otherMatches.length > 0 && (
|
||||||
<div>
|
<div className="mb-6">
|
||||||
<h2 className="text-lg font-semibold text-gray-900 mb-3">
|
<h2 className="text-lg font-semibold text-gray-900 mb-3">
|
||||||
{pendingIncoming.length > 0 ? 'Other Matches' : 'Your Matches'}
|
{pendingIncoming.length > 0 ? 'Other Matches' : 'Your Matches'}
|
||||||
</h2>
|
</h2>
|
||||||
@@ -216,22 +228,7 @@ const MatchesPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
{/* Empty State */}
|
|
||||||
{filteredMatches.length === 0 && (
|
|
||||||
<div className="text-center py-12">
|
|
||||||
<Users className="w-16 h-16 text-gray-300 mx-auto mb-4" />
|
|
||||||
<h3 className="text-lg font-medium text-gray-900 mb-2">
|
|
||||||
No matches found
|
|
||||||
</h3>
|
|
||||||
<p className="text-gray-600">
|
|
||||||
{filter === 'all'
|
|
||||||
? 'You have no match requests yet. Connect with other dancers at events!'
|
|
||||||
: `You have no ${filter} matches.`}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Layout>
|
</Layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user