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
89 lines
2.9 KiB
TypeScript
89 lines
2.9 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { useState } from "react";
|
|
|
|
import { InvitePerson } from "@/components/InvitePerson";
|
|
|
|
import { NewPerson } from "./NewPerson";
|
|
|
|
/**
|
|
* Adding a person: typing in their birth data (uses a slot), or inviting
|
|
* them to compare charts (they give their own data; no slot used).
|
|
*/
|
|
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 || !invitesOpen ? "data" : "invite");
|
|
return (
|
|
<div className="field" style={{ gap: 18 }}>
|
|
<div className="mode-switch" role="tablist" aria-label="Hogyan veszed fel?">
|
|
<button
|
|
type="button"
|
|
role="tab"
|
|
aria-selected={mode === "data"}
|
|
className="mode-option"
|
|
onClick={() => setMode("data")}
|
|
>
|
|
<strong>Adatok megadása</strong>
|
|
<span>Te írod be a születési adatait. Egy személyhelyet használ.</span>
|
|
</button>
|
|
<button
|
|
type="button"
|
|
role="tab"
|
|
aria-selected={mode === "invite"}
|
|
aria-disabled={!invitesOpen}
|
|
disabled={!invitesOpen}
|
|
className="mode-option"
|
|
onClick={() => setMode("invite")}
|
|
>
|
|
<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" ? (
|
|
canAdd ? (
|
|
<>
|
|
<NewPerson />
|
|
<p className="hint">Az adatokat a felvételt követő egy órán belül még javíthatod, utána nem módosíthatók.</p>
|
|
</>
|
|
) : (
|
|
full
|
|
)
|
|
) : hasOwnChart ? (
|
|
<>
|
|
<InvitePerson />
|
|
<p className="hint">
|
|
A meghívott a saját képletét és rövid összefoglalóját ingyen kapja. Ti ketten az összevetést látjátok, egymás
|
|
születési adatait nem. A részletes kapcsolati elemzést bármelyikőtök kérheti egy kapcsolati elemzéssel, és
|
|
mindketten látjátok.
|
|
</p>
|
|
</>
|
|
) : (
|
|
<p className="muted">
|
|
A meghívó a saját képleteddel veti össze az övét, ezért előbb <Link href="/profil#birth">add meg a saját
|
|
születési adataidat</Link>.
|
|
</p>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|