Make user vote more clear
This commit is contained in:
1 parent
f5f389f5d3
commit
2fa0b67943
2 files changed
+48
-17
No files matched your search
@@ -107,8 +107,18 @@ function MeetingCard({ meeting, user, onChanged }) {
|
||||
return (
|
||||
<div className="meeting-card">
|
||||
<div className="meeting-head">
|
||||
<h3>{meeting.title}</h3>
|
||||
{isAuthor && <span className="badge">your meeting</span>}
|
||||
{/* Title and badges are grouped so the badges stay right next to the
|
||||
title instead of being pushed to the far edge. */}
|
||||
<div className="meeting-title">
|
||||
<h3>{meeting.title}</h3>
|
||||
{isAuthor && <span className="badge">your meeting</span>}
|
||||
{/* Brief, colour-coded reminder of the viewer's own vote. */}
|
||||
{meeting.myVote && (
|
||||
<span className={`badge ${meeting.myVote}`}>
|
||||
{meeting.myVote === 'join' ? 'will join' : 'will skip'}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{meeting.intent && <p className="meeting-intent">{meeting.intent}</p>}
|
||||
@@ -135,7 +145,7 @@ function MeetingCard({ meeting, user, onChanged }) {
|
||||
className={`pill decline ${showVoters === 'decline' ? 'open' : ''}`}
|
||||
onClick={() => setShowVoters((v) => (v === 'decline' ? null : 'decline'))}
|
||||
>
|
||||
{meeting.declineCount} not joining
|
||||
{meeting.declineCount} skipping
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -159,20 +169,18 @@ function MeetingCard({ meeting, user, onChanged }) {
|
||||
Join room
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
className={`btn-ghost ${meeting.myVote === 'join' ? 'active' : ''}`}
|
||||
onClick={() => vote('join')}
|
||||
disabled={busy}
|
||||
>
|
||||
I'll join
|
||||
</button>
|
||||
<button
|
||||
className={`btn-ghost ${meeting.myVote === 'decline' ? 'active' : ''}`}
|
||||
onClick={() => vote('decline')}
|
||||
disabled={busy}
|
||||
>
|
||||
Can't join
|
||||
</button>
|
||||
{/* The vote buttons are replaced by a confirmation note (above) once a
|
||||
vote is cast. Retracting brings the buttons back. */}
|
||||
{!meeting.myVote && (
|
||||
<>
|
||||
<button className="btn-ghost" onClick={() => vote('join')} disabled={busy}>
|
||||
Join
|
||||
</button>
|
||||
<button className="btn-ghost" onClick={() => vote('decline')} disabled={busy}>
|
||||
Skip
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{meeting.myVote && (
|
||||
<button className="btn-ghost" onClick={retract} disabled={busy}>
|
||||
Retract vote
|
||||
|
||||
@@ -367,6 +367,15 @@ label.checkbox {
|
||||
letter-spacing: 0.03em;
|
||||
}
|
||||
|
||||
/* Vote badges in the meeting title, coloured like the join / decline tallies. */
|
||||
.badge.join {
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.badge.decline {
|
||||
color: var(--danger);
|
||||
}
|
||||
|
||||
.muted {
|
||||
color: var(--muted);
|
||||
}
|
||||
@@ -568,6 +577,19 @@ textarea:focus {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* Keeps the title and its badges together on the left of the head row. */
|
||||
.meeting-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
/* The wrapping gap already spaces the badges, so drop their own margin. */
|
||||
.meeting-title .badge {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.meeting-head h3 {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
@@ -640,6 +662,7 @@ textarea:focus {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
|
||||
/* "Your meetings" section appended below the rooms grid. */
|
||||
.meetings-on-rooms {
|
||||
margin-top: 20px;
|
||||
|
||||
Reference in new issue
Block a user