Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Show guests the hobby invite flow instead of an account prompt (#3485)

Luke Velladec8ef25a80e
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index eefaaed61..39923cd2c 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -222,7 +222,6 @@
"copyEditLink": "Copy edit link",
"copyLink": "Copy link",
"create": "Create",
- "createAnAccount": "Create an account",
"createApiKey": "Create API key",
"createApiKeyDescription": "Create a new API key for programmatic access to your space",
"createdTime": "Created {relativeTime}",
@@ -1006,7 +1005,6 @@
"shareDialogCopyPersonalLink": "Copy personal link",
"shareDialogDailyLimit": "You've reached today's limit of 100 invites",
"shareDialogDescription": "Share the invite link, or invite people by email.",
- "shareDialogGuestPrompt": "Create an account to invite people by email. Your invites and their responses stay attached to your account instead of this browser.",
"shareDialogInvalidEmail": "Enter a single valid email address",
"shareDialogInvitedCount": "{count, plural, one {# invited} other {# invited}}",
"shareDialogInviteRemoved": "Invite for {email} removed",
diff --git a/apps/web/src/features/poll/components/invite-by-email.tsx b/apps/web/src/features/poll/components/invite-by-email.tsx
index c8eef0c36..daa352d02 100644
--- a/apps/web/src/features/poll/components/invite-by-email.tsx
+++ b/apps/web/src/features/poll/components/invite-by-email.tsx
@@ -22,8 +22,6 @@ import {
EmptyStateIcon,
EmptyStateTitle,
} from "@/components/empty-state";
-import { LoginLink } from "@/components/login-link";
-import { RegisterLink } from "@/components/register-link";
import { Spinner } from "@/components/spinner";
import { showPayWall, useIsFree } from "@/features/billing/client";
import { ProBadge } from "@/features/billing/components/pro-badge";
@@ -215,158 +213,133 @@ export function InviteByEmail({
return (
<div className="min-w-0">
- {isGuest ? (
- <div className="space-y-2 rounded-lg bg-muted p-3 text-sm">
- <p className="text-muted-foreground">
- <Trans
- i18nKey="shareDialogGuestPrompt"
- defaults="Create an account to invite people by email. Your invites and their responses stay attached to your account instead of this browser."
- />
- </p>
- <div className="flex gap-2">
- <RegisterLink className="underline hover:text-foreground">
- <Trans i18nKey="createAnAccount" defaults="Create an account" />
- </RegisterLink>
- <LoginLink className="underline hover:text-foreground">
- <Trans i18nKey="login" defaults="Login" />
- </LoginLink>
- </div>
- </div>
- ) : (
- <>
- <form
- onSubmit={form.handleSubmit(onValid, onInvalid)}
- className="flex min-w-0 gap-2"
- noValidate
- >
- <label htmlFor="share-dialog-email" className="sr-only">
- <Trans i18nKey="emailAddress" defaults="Email address" />
- </label>
- <InputGroup className="min-w-0 flex-1">
- <InputGroupAddon>
- <MailIcon />
- </InputGroupAddon>
- <InputGroupInput
- {...form.register("email")}
- id="share-dialog-email"
- type="email"
- inputMode="email"
- autoComplete="off"
- {...passwordManagerIgnoreProps}
- placeholder="[email protected]"
- disabled={!isOpen}
- aria-invalid={form.formState.errors.email ? true : undefined}
- aria-describedby={
- isOpen ? undefined : "share-dialog-closed-reason"
- }
- />
- </InputGroup>
- <Button
- type="submit"
- variant="primary"
- disabled={!isOpen}
- aria-describedby={
- isOpen ? undefined : "share-dialog-closed-reason"
- }
- >
- <Trans i18nKey="shareDialogSendInvite" defaults="Send invite" />
- {isFree ? (
- <ProBadge className="ml-1.5 bg-primary-foreground/20 text-primary-foreground" />
- ) : null}
- </Button>
- </form>
- {!isOpen ? (
- <p
- id="share-dialog-closed-reason"
- className="mt-3 text-muted-foreground text-sm"
- >
- <Trans
- i18nKey="shareDialogPollClosed"
- defaults="Reopen the poll to send invites"
- />
- </p>
+ <form
+ onSubmit={form.handleSubmit(onValid, onInvalid)}
+ className="flex min-w-0 gap-2"
+ noValidate
+ >
+ <label htmlFor="share-dialog-email" className="sr-only">
+ <Trans i18nKey="emailAddress" defaults="Email address" />
+ </label>
+ <InputGroup className="min-w-0 flex-1">
+ <InputGroupAddon>
+ <MailIcon />
+ </InputGroupAddon>
+ <InputGroupInput
+ {...form.register("email")}
+ id="share-dialog-email"
+ type="email"
+ inputMode="email"
+ autoComplete="off"
+ {...passwordManagerIgnoreProps}
+ placeholder="[email protected]"
+ disabled={!isOpen}
+ aria-invalid={form.formState.errors.email ? true : undefined}
+ aria-describedby={isOpen ? undefined : "share-dialog-closed-reason"}
+ />
+ </InputGroup>
+ <Button
+ type="submit"
+ variant="primary"
+ disabled={!isOpen}
+ aria-describedby={isOpen ? undefined : "share-dialog-closed-reason"}
+ >
+ <Trans i18nKey="shareDialogSendInvite" defaults="Send invite" />
+ {isFree ? (
+ <ProBadge className="ml-1.5 bg-primary-foreground/20 text-primary-foreground" />
) : null}
+ </Button>
+ </form>
+ {!isOpen ? (
+ <p
+ id="share-dialog-closed-reason"
+ className="mt-3 text-muted-foreground text-sm"
+ >
+ <Trans
+ i18nKey="shareDialogPollClosed"
+ defaults="Reopen the poll to send invites"
+ />
+ </p>
+ ) : null}
- <AnimatedHeight className="mt-3">
- {invitesQuery.isPending ? (
- <div className="relative mt-2">
- <InviteeListPreview />
- <output
- aria-label={t("loading", { defaultValue: "Loading..." })}
- className="absolute inset-0 grid place-items-center backdrop-blur-[2px]"
- >
- <Spinner />
- </output>
- </div>
- ) : invitesQuery.isError ? (
- <div className="relative mt-2">
- <InviteeListPreview />
- <EmptyState className="absolute inset-0 py-0 backdrop-blur-[2px]">
- <EmptyStateIcon>
- <MailIcon />
- </EmptyStateIcon>
- <EmptyStateTitle>
- <Trans
- i18nKey="shareDialogInvitesLoadFailed"
- defaults="Couldn't load invites"
- />
- </EmptyStateTitle>
- <EmptyStateFooter className="mt-3">
- <Button
- size="sm"
- onClick={() => invitesQuery.refetch()}
- disabled={invitesQuery.isFetching}
- >
- <Trans i18nKey="tryAgain" defaults="Try again" />
- </Button>
- </EmptyStateFooter>
- </EmptyState>
- </div>
- ) : rows.length === 0 ? (
- <div className="relative mt-2">
- <InviteeListPreview />
- <EmptyState className="absolute inset-0 py-0 backdrop-blur-[2px]">
- <EmptyStateIcon>
- <MailIcon />
- </EmptyStateIcon>
- <EmptyStateTitle>
- <Trans
- i18nKey="shareDialogNoInvitesTitle"
- defaults="No one invited yet"
- />
- </EmptyStateTitle>
- <EmptyStateDescription>
- <Trans
- i18nKey="shareDialogNoInvitesDescription"
- defaults="Enter an address above to send the first invite."
- />
- </EmptyStateDescription>
- </EmptyState>
- </div>
- ) : (
- <>
- <h4 id="share-dialog-invited-heading" className="sr-only">
- {countLabel(rows.length)}
- </h4>
- <ul
- aria-labelledby="share-dialog-invited-heading"
- className="-mx-1.5 max-h-72 min-h-0 overflow-y-auto px-1.5"
+ <AnimatedHeight className="mt-3">
+ {invitesQuery.isLoading ? (
+ <div className="relative mt-2">
+ <InviteeListPreview />
+ <output
+ aria-label={t("loading", { defaultValue: "Loading..." })}
+ className="absolute inset-0 grid place-items-center backdrop-blur-[2px]"
+ >
+ <Spinner />
+ </output>
+ </div>
+ ) : invitesQuery.isError ? (
+ <div className="relative mt-2">
+ <InviteeListPreview />
+ <EmptyState className="absolute inset-0 py-0 backdrop-blur-[2px]">
+ <EmptyStateIcon>
+ <MailIcon />
+ </EmptyStateIcon>
+ <EmptyStateTitle>
+ <Trans
+ i18nKey="shareDialogInvitesLoadFailed"
+ defaults="Couldn't load invites"
+ />
+ </EmptyStateTitle>
+ <EmptyStateFooter className="mt-3">
+ <Button
+ size="sm"
+ onClick={() => invitesQuery.refetch()}
+ disabled={invitesQuery.isFetching}
>
- {rows.map((row) => (
- <InviteeRow
- key={row.id}
- email={row.email}
- status={row.status}
- inviteId={row.inviteUrl ? row.id : undefined}
- inviteUrl={row.inviteUrl}
- />
- ))}
- </ul>
- </>
- )}
- </AnimatedHeight>
- </>
- )}
+ <Trans i18nKey="tryAgain" defaults="Try again" />
+ </Button>
+ </EmptyStateFooter>
+ </EmptyState>
+ </div>
+ ) : rows.length === 0 ? (
+ <div className="relative mt-2">
+ <InviteeListPreview />
+ <EmptyState className="absolute inset-0 py-0 backdrop-blur-[2px]">
+ <EmptyStateIcon>
+ <MailIcon />
+ </EmptyStateIcon>
+ <EmptyStateTitle>
+ <Trans
+ i18nKey="shareDialogNoInvitesTitle"
+ defaults="No one invited yet"
+ />
+ </EmptyStateTitle>
+ <EmptyStateDescription>
+ <Trans
+ i18nKey="shareDialogNoInvitesDescription"
+ defaults="Enter an address above to send the first invite."
+ />
+ </EmptyStateDescription>
+ </EmptyState>
+ </div>
+ ) : (
+ <>
+ <h4 id="share-dialog-invited-heading" className="sr-only">
+ {countLabel(rows.length)}
+ </h4>
+ <ul
+ aria-labelledby="share-dialog-invited-heading"
+ className="-mx-1.5 max-h-72 min-h-0 overflow-y-auto px-1.5"
+ >
+ {rows.map((row) => (
+ <InviteeRow
+ key={row.id}
+ email={row.email}
+ status={row.status}
+ inviteId={row.inviteUrl ? row.id : undefined}
+ inviteUrl={row.inviteUrl}
+ />
+ ))}
+ </ul>
+ </>
+ )}
+ </AnimatedHeight>
<p className="sr-only" aria-live="polite">
{announcement}