Make user vote more clear

This commit is contained in:
blankhex committed 2026-10-24 19:17:31 +03:00
1 parent f5f389f5d3
commit 2fa0b67943
2 files changed
+48 -17

No files matched your search

+25 -17
View File
@@ -107,8 +107,18 @@ function MeetingCard({ meeting, user, onChanged }) {
return ( return (
<div className="meeting-card"> <div className="meeting-card">
<div className="meeting-head"> <div className="meeting-head">
<h3>{meeting.title}</h3> {/* Title and badges are grouped so the badges stay right next to the
{isAuthor && <span className="badge">your meeting</span>} 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> </div>
{meeting.intent && <p className="meeting-intent">{meeting.intent}</p>} {meeting.intent && <p className="meeting-intent">{meeting.intent}</p>}
@@ -135,7 +145,7 @@ function MeetingCard({ meeting, user, onChanged }) {
className={`pill decline ${showVoters === 'decline' ? 'open' : ''}`} className={`pill decline ${showVoters === 'decline' ? 'open' : ''}`}
onClick={() => setShowVoters((v) => (v === 'decline' ? null : 'decline'))} onClick={() => setShowVoters((v) => (v === 'decline' ? null : 'decline'))}
> >
{meeting.declineCount} not joining {meeting.declineCount} skipping
</button> </button>
</div> </div>
@@ -159,20 +169,18 @@ function MeetingCard({ meeting, user, onChanged }) {
Join room Join room
</button> </button>
)} )}
<button {/* The vote buttons are replaced by a confirmation note (above) once a
className={`btn-ghost ${meeting.myVote === 'join' ? 'active' : ''}`} vote is cast. Retracting brings the buttons back. */}
onClick={() => vote('join')} {!meeting.myVote && (
disabled={busy} <>
> <button className="btn-ghost" onClick={() => vote('join')} disabled={busy}>
I'll join Join
</button> </button>
<button <button className="btn-ghost" onClick={() => vote('decline')} disabled={busy}>
className={`btn-ghost ${meeting.myVote === 'decline' ? 'active' : ''}`} Skip
onClick={() => vote('decline')} </button>
disabled={busy} </>
> )}
Can't join
</button>
{meeting.myVote && ( {meeting.myVote && (
<button className="btn-ghost" onClick={retract} disabled={busy}> <button className="btn-ghost" onClick={retract} disabled={busy}>
Retract vote Retract vote
+23
View File
@@ -367,6 +367,15 @@ label.checkbox {
letter-spacing: 0.03em; 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 { .muted {
color: var(--muted); color: var(--muted);
} }
@@ -568,6 +577,19 @@ textarea:focus {
gap: 8px; 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 { .meeting-head h3 {
margin: 0; margin: 0;
font-size: 1rem; font-size: 1rem;
@@ -640,6 +662,7 @@ textarea:focus {
color: var(--accent); color: var(--accent);
} }
/* "Your meetings" section appended below the rooms grid. */ /* "Your meetings" section appended below the rooms grid. */
.meetings-on-rooms { .meetings-on-rooms {
margin-top: 20px; margin-top: 20px;