Change teams list to table view for consistency with projects table

This commit is contained in:
Mondo Diaz
2026-01-28 15:48:45 +00:00
parent 018e352820
commit aece9e0b9f
2 changed files with 116 additions and 123 deletions

View File

@@ -181,98 +181,84 @@
color: var(--color-text-muted); color: var(--color-text-muted);
} }
/* Grid */ /* Table */
.teams-grid { .teams-table-container {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1rem;
}
/* Team Card */
.team-card {
background: var(--color-bg); background: var(--color-bg);
border: 1px solid var(--color-border); border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
padding: 1.25rem;
cursor: pointer;
transition: all 0.15s ease;
}
.team-card:hover {
border-color: var(--color-primary);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.team-card__header {
display: flex;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 0.75rem;
}
.team-card__avatar {
width: 40px;
height: 40px;
border-radius: var(--radius-md); border-radius: var(--radius-md);
background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover, #2563eb)); overflow: hidden;
color: white; }
.teams-table {
width: 100%;
border-collapse: collapse;
}
.teams-table th {
text-align: left;
padding: 0.75rem 1rem;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--color-text-muted);
background: var(--color-bg-secondary);
border-bottom: 1px solid var(--color-border);
}
.teams-table td {
padding: 0.75rem 1rem;
font-size: 0.875rem;
border-bottom: 1px solid var(--color-border);
vertical-align: middle;
}
.teams-table tbody tr:last-child td {
border-bottom: none;
}
.team-row {
cursor: pointer;
transition: background 0.1s ease;
}
.team-row:hover {
background: var(--color-bg-secondary);
}
.team-name-cell {
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: center; gap: 0.125rem;
font-weight: 600;
font-size: 1.125rem;
flex-shrink: 0;
} }
.team-card__title { .team-name-link {
flex: 1; font-weight: 500;
min-width: 0;
}
.team-card__title h3 {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: var(--color-text); color: var(--color-text);
white-space: nowrap; text-decoration: none;
}
.team-name-link:hover {
color: var(--color-primary);
}
.team-slug {
font-size: 0.8125rem;
color: var(--color-text-muted);
}
.team-description-cell {
color: var(--color-text-secondary);
max-width: 300px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap;
} }
.team-card__slug { .text-muted {
font-size: 0.8125rem;
color: var(--color-text-muted); color: var(--color-text-muted);
} }
.team-card__description {
font-size: 0.875rem;
color: var(--color-text-secondary);
margin: 0 0 1rem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.team-card__footer {
display: flex;
gap: 1rem;
padding-top: 0.75rem;
border-top: 1px solid var(--color-border);
}
.team-card__stat {
display: flex;
align-items: center;
gap: 0.375rem;
font-size: 0.8125rem;
color: var(--color-text-muted);
}
.team-card__stat svg {
opacity: 0.7;
}
/* Modal */ /* Modal */
.modal-overlay { .modal-overlay {
position: fixed; position: fixed;
@@ -455,7 +441,11 @@
justify-content: space-around; justify-content: space-around;
} }
.teams-grid { .teams-table-container {
grid-template-columns: 1fr; overflow-x: auto;
}
.teams-table {
min-width: 600px;
} }
} }

View File

@@ -277,49 +277,52 @@ function TeamsPage() {
)} )}
</div> </div>
) : ( ) : (
<div className="teams-grid"> <div className="teams-table-container">
<table className="teams-table">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Role</th>
<th>Members</th>
<th>Projects</th>
</tr>
</thead>
<tbody>
{filteredTeams.map(team => ( {filteredTeams.map(team => (
<div <tr
key={team.id} key={team.id}
className="team-card" className="team-row"
onClick={() => navigate(`/teams/${team.slug}`)} onClick={() => navigate(`/teams/${team.slug}`)}
> >
<div className="team-card__header"> <td>
<div className="team-card__avatar"> <div className="team-name-cell">
{team.name.charAt(0).toUpperCase()} <Link
</div> to={`/teams/${team.slug}`}
<div className="team-card__title"> className="team-name-link"
<h3>{team.name}</h3> onClick={(e) => e.stopPropagation()}
<span className="team-card__slug">@{team.slug}</span> >
{team.name}
</Link>
<span className="team-slug">@{team.slug}</span>
</div> </div>
</td>
<td className="team-description-cell">
{team.description || <span className="text-muted"></span>}
</td>
<td>
{team.user_role && ( {team.user_role && (
<Badge variant={roleConfig[team.user_role]?.variant || 'default'}> <Badge variant={roleConfig[team.user_role]?.variant || 'default'}>
{roleConfig[team.user_role]?.label || team.user_role} {roleConfig[team.user_role]?.label || team.user_role}
</Badge> </Badge>
)} )}
</div> </td>
<td className="text-muted">{team.member_count}</td>
{team.description && ( <td className="text-muted">{team.project_count}</td>
<p className="team-card__description">{team.description}</p> </tr>
)}
<div className="team-card__footer">
<div className="team-card__stat">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
<circle cx="9" cy="7" r="4"/>
</svg>
<span>{team.member_count} member{team.member_count !== 1 ? 's' : ''}</span>
</div>
<div className="team-card__stat">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>
</svg>
<span>{team.project_count} project{team.project_count !== 1 ? 's' : ''}</span>
</div>
</div>
</div>
))} ))}
</tbody>
</table>
</div> </div>
)} )}
</div> </div>