feat: Gründungsmitglieder (erste 250 Tiere) und Kurator-Begrüßung
- Pet.isFoundingMember: in pets.create per bewachter SQL-Anweisung für die
ersten 250 Tiere gesetzt, nie entzogen; Abzeichen (Spross) in Feed und
Profil, Web + App, unabhängig vom Empfehlungsprogramm
- Kurator "PawFeed Team": folgt jedem neuen Tier und schickt eine
Begrüßungs-Direktnachricht (DE/EN nach Sprache beim Anlegen), im
Hintergrund — blockiert das Onboarding nicht
- CuratorSettings + Admin-Seite /p/[secret]/curator: Schalter, Texte mit
Pflicht-Platzhalter {name} und Vorschau, Zähler der Gründungsmitglieder
- prisma/backfill_founding_members.sql, prisma/enable_rls_curator.sql
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f7acf1d98
commit
307b76e8fd
23 files changed
+554
-9
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { View, StyleSheet } from "react-native";
|
||||
import { BadgeCheck, Sparkles } from "lucide-react-native";
|
||||
import { BadgeCheck, Sparkles, Sprout } from "lucide-react-native";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { isActiveSponsor } from "../lib/sponsor";
|
||||
import { colors } from "../theme/tokens";
|
||||
import { ReferralIcon } from "../lib/referral-icons";
|
||||
@@ -7,21 +8,27 @@ import { useOwnerRankWithPerk, type ReferralOwnerFields } from "../hooks/useRefe
|
||||
|
||||
type Props = {
|
||||
isVerified?: boolean;
|
||||
/** Eines der ersten 250 Tiere (Pet.isFoundingMember). */
|
||||
isFoundingMember?: boolean;
|
||||
sponsor?: { sponsorSince: Date | string | null; sponsorPeriodEnd: Date | string | null } | null;
|
||||
/** Owner-Felder referralRankId/referralPerks — Rang-Abzeichen des Empfehlungsprogramms. */
|
||||
referral?: ReferralOwnerFields | null;
|
||||
};
|
||||
|
||||
/** Port of web's src/components/ui/pet-identity-badges.tsx. */
|
||||
export function PetIdentityBadges({ isVerified, sponsor, referral }: Props) {
|
||||
const FOUNDING_COLOR = "#059669"; // emerald-600, wie im Web
|
||||
|
||||
export function PetIdentityBadges({ isVerified, isFoundingMember, sponsor, referral }: Props) {
|
||||
const { t } = useTranslation();
|
||||
const showSponsor = sponsor ? isActiveSponsor(sponsor) : false;
|
||||
const rank = useOwnerRankWithPerk(referral, "NAME_BADGE");
|
||||
if (!isVerified && !showSponsor && !rank) return null;
|
||||
if (!isVerified && !isFoundingMember && !showSponsor && !rank) return null;
|
||||
|
||||
return (
|
||||
<View style={styles.row}>
|
||||
{isVerified && <BadgeCheck size={14} color={colors.marigoldOrange} />}
|
||||
{showSponsor && <Sparkles size={14} color={colors.marigoldOrange} />}
|
||||
{isFoundingMember && <Sprout size={14} color={FOUNDING_COLOR} accessibilityLabel={t("foundingMember.label")} />}
|
||||
{rank && <ReferralIcon icon={rank.icon} size={14} color={rank.color} fill={rank.color} accessibilityLabel={rank.name} />}
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -59,6 +59,7 @@ export type PostCardPost = {
|
||||
nickname?: string | null;
|
||||
avatarKey?: string | null;
|
||||
isVerified?: boolean;
|
||||
isFoundingMember?: boolean;
|
||||
owner?: {
|
||||
sponsorSince: Date | string | null;
|
||||
sponsorPeriodEnd: Date | string | null;
|
||||
@@ -148,7 +149,7 @@ export function PostCard({ post, actingPetId, isTrending, isVisible = true }: Pr
|
||||
<View style={styles.headerText}>
|
||||
<View style={styles.nameRow}>
|
||||
<Text style={styles.name}>{formatPetName(post.pet)}</Text>
|
||||
<PetIdentityBadges isVerified={post.pet.isVerified} sponsor={post.pet.owner} referral={post.pet.owner} />
|
||||
<PetIdentityBadges isVerified={post.pet.isVerified} isFoundingMember={post.pet.isFoundingMember} sponsor={post.pet.owner} referral={post.pet.owner} />
|
||||
{isTrending && (
|
||||
<View style={styles.trendingBadge}>
|
||||
<Flame size={11} color={colors.marigoldDeep} fill={colors.marigoldDeep} />
|
||||
|
||||
Reference in new issue
Block a user