Inviting shown but off until launch; waitlist confirmation; waitlist invites with a package
USER_INVITES (default false) keeps users from inviting others until the launch: the 'Meghívom' option and a 'Hívd meg, akit szeretsz' card on the persons page are shown, disabled, with 'Hamarosan'; the backend refuses with invites_disabled (admins may always). Joining the waitlist sends one confirmation e-mail (waitlist_joined) with a link that takes the address off the list and opts it out; at most 10 per address in 15 minutes. Admins can pick a package for waitlist invitations, like on the invitation form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -14,16 +14,19 @@ import { NewPerson } from "./NewPerson";
|
||||
export function NewPersonChooser({
|
||||
canAdd,
|
||||
hasOwnChart,
|
||||
invitesOpen,
|
||||
full,
|
||||
}: {
|
||||
/** A slot is free for typed-in data. */
|
||||
canAdd: boolean;
|
||||
/** Inviting is on (until the launch it is shown, but off). */
|
||||
invitesOpen: boolean;
|
||||
/** Inviting compares with the user's own chart. */
|
||||
hasOwnChart: boolean;
|
||||
/** Shown instead of the form when no slot is left. */
|
||||
full: React.ReactNode;
|
||||
}) {
|
||||
const [mode, setMode] = useState<"data" | "invite">(canAdd ? "data" : "invite");
|
||||
const [mode, setMode] = useState<"data" | "invite">(canAdd || !invitesOpen ? "data" : "invite");
|
||||
return (
|
||||
<div className="field" style={{ gap: 18 }}>
|
||||
<div className="mode-switch" role="tablist" aria-label="Hogyan veszed fel?">
|
||||
@@ -41,11 +44,19 @@ export function NewPersonChooser({
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={mode === "invite"}
|
||||
aria-disabled={!invitesOpen}
|
||||
disabled={!invitesOpen}
|
||||
className="mode-option"
|
||||
onClick={() => setMode("invite")}
|
||||
>
|
||||
<strong>Meghívom</strong>
|
||||
<span>Ő adja meg a saját adatait, és megnézitek, mennyire illetek össze. Ingyenes, nem kell hozzá hely.</span>
|
||||
<strong>
|
||||
Meghívom {!invitesOpen && <span className="badge mode-soon">Hamarosan</span>}
|
||||
</strong>
|
||||
<span>
|
||||
{invitesOpen
|
||||
? "Ő adja meg a saját adatait, és megnézitek, mennyire illetek össze. Ingyenes, nem kell hozzá hely."
|
||||
: "Hamarosan meghívhatod azokat, akiket szeretsz: ők adják meg a saját adataikat, és együtt nézitek meg, mennyire illetek össze."}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
{mode === "data" ? (
|
||||
|
||||
Reference in New Issue
Block a user