feat: implement signup dialog for event registration

Added a new signup dialog component that opens when users click on signup links. The dialog fetches and displays the signup form dynamically, enhancing user experience. Updated styles for the dialog and integrated it into the public schedule page. Adjusted asset loading rules to accommodate the new functionality.
This commit is contained in:
blake committed 2026-10-28 10:54:22 -05:00
1 parent df3165f6a8
commit 1f451dc830
5 files changed
+401 -8

No files matched your search

+19 -2
View File
@@ -543,10 +543,27 @@ function PublicSchedule(props: {
) : (
<WednesdayBoard config={props.config} event={props.event} now={props.now} />
)}
<SignupDialog config={props.config} />
</div>
);
}
function SignupDialog(props: { config: AppConfig }) {
return (
<>
<dialog id="signup-dialog" class="event-dialog" aria-labelledby="signup-dialog-label">
<div class="event-dialog-card signup-dialog-card">
<button type="button" class="event-dialog-close signup-dialog-close" data-signup-close aria-label="Close">
<img src={asset(props.config, '/img/icons/close.svg')} alt="" />
</button>
<div id="signup-dialog-body"></div>
</div>
</dialog>
<script src={asset(props.config, '/js/signup-dialog.js')} defer />
</>
);
}
type WednesdayGroup = {
date: string;
heading: string;
@@ -622,7 +639,7 @@ function ShiftPane(props: { config: AppConfig; shift: PublicShift }) {
<span>Not accepting more signups</span>
</p>
) : (
<a class="btn-card" href={appPath(props.config, `/s/${shift.id}`)}>
<a class="btn-card" href={appPath(props.config, `/s/${shift.id}`)} data-signup={closed ? undefined : ''}>
{action}
<img src={asset(props.config, '/img/icons/right-arrow.svg')} alt="" />
</a>
@@ -794,7 +811,7 @@ function CalendarShift(props: { config: AppConfig; shift: PublicShift }) {
const closed = shift.full || shift.cancelled || shift.ended;
const action = closed ? 'View shift' : 'Sign up';
return (
<a class="cal-shift" href={appPath(props.config, `/s/${shift.id}`)}>
<a class="cal-shift" href={appPath(props.config, `/s/${shift.id}`)} data-signup={closed ? undefined : ''}>
<span class="cal-line">
{shift.when.startLabel} {shift.role}
</span>