പ്രിവ്യൂ സാമ്പിൾ ഡാറ്റയിലാണ് പ്രവർത്തിക്കുന്നത്. നെറ്റ്വർക്കോ ചാനലോ വേണ്ട.
tsx
import { YuvaSubscribe } from "@/components/yuva-subscribe"
export function Newsletter() {
return (
<YuvaSubscribe
server={process.env.NEXT_PUBLIC_YUVA_SERVER}
channel={process.env.NEXT_PUBLIC_YUVA_CHANNEL}
name="optional"
privacyUrl="/privacy"
/>
)
}ഇൻസ്റ്റലേഷൻ
ഇത് ഒരു shadcn പ്രോജക്റ്റിൽ പ്രവർത്തിപ്പിക്കുക. ഫയലുകൾ നിങ്ങളുടെ സ്വന്തം കോഡിലേക്ക് പകർത്തപ്പെടും.
Shell
npx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
pnpm dlx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
yarn dlx shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonShell
bunx --bun shadcn@latest add https://useyuva.com/r/yuva-subscribe.jsonഉപയോഗം
tsx
import { YuvaSubscribe } from "@/components/yuva-subscribe"
<YuvaSubscribe server={server} channel={channel} />Props
YuvaSubscribeProps
| Prop | തരം |
|---|---|
server? | string |
channel? | string |
client? | YuvaClient |
identityToken? | IdentityTokenSource | null |
lists? | string[] |
layout? | "stacked" | "inline" |
name? | "off" | "optional" | "required" |
consent? | string |
privacyUrl? | string |
locale? | string |
labels? | Partial<YuvaSubscribeLabels> |
onSubscribe? | (detail: { lists: string[]; confirmation: boolean }) => void |
className? | string |
ലേബലുകൾ
ഓരോ ലേബലിനും ഇംഗ്ലീഷ് ഡിഫോൾട്ട് ഉണ്ട്. അവ മാറ്റാനോ വിവർത്തനം ചെയ്യാനോ labels ഒബ്ജക്റ്റിന്റെ ഒരു ഭാഗം നൽകുക.
| ലേബൽ | ഡിഫോൾട്ട് |
|---|---|
lists | "Lists" |
email | "E-mail address" |
name | "Your name" |
nameOptional | "Your name (optional)" |
button | "Subscribe" |
sending | "Subscribing…" |
consent | (lists, inbox) => `I want to receive e-mails about ${lists} from ${inbox}. I can unsubscribe at any time.` |
privacy | "Privacy policy" |
checkInbox | "Almost done. Check your inbox and confirm your subscription." |
subscribed | "Thanks! You are subscribed." |
pending | "Check your inbox to confirm." |
chooseList | "Choose at least one list." |
invalidEmail | "Enter a valid e-mail address." |
nameRequired | "Enter your name." |
consentRequired | "Tick the box to agree." |
noEmail | "Your account has no e-mail address yet." |
rateLimited | "Too many attempts. Wait a moment and try again." |
offline | "You seem to be offline." |
generic | "Could not subscribe. Try again." |
ആശ്രിതത്വങ്ങൾ
ഈ ഇനം ഇൻസ്റ്റാൾ ചെയ്യുമ്പോൾ താഴെയുള്ളവയും ചേർക്കപ്പെടും.