Compare commits

..

2 commits

Author SHA1 Message Date
Dariusz Niemczyk 6cb774c7c0
chore: remove unnecessary lingui scripts 2025-02-11 14:53:13 +01:00
Dariusz Niemczyk 23b53b084f
feat: add newsletter subscription 2025-02-11 14:52:49 +01:00
5 changed files with 14 additions and 11 deletions

View file

@ -6,11 +6,7 @@
"dev": "next dev --turbopack", "dev": "next dev --turbopack",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint"
"translations:extract": "lingui extract-template",
"translations:compile": "lingui compile",
"translations:sync": "lingui extract --overwrite && lingui compile",
"translations:sync_and_purge": "lingui extract --overwrite --clean && lingui compile"
}, },
"dependencies": { "dependencies": {
"@formatjs/intl-localematcher": "^0.5.10", "@formatjs/intl-localematcher": "^0.5.10",

View file

@ -7,10 +7,9 @@ import Head from 'next/head';
import { ThemeProvider } from "@/components/providers"; import { ThemeProvider } from "@/components/providers";
import { translations } from "@/i18n/translations"; import { translations } from "@/i18n/translations";
import { Oxanium } from "next/font/google";
import { headers } from "next/headers"; import { headers } from "next/headers";
const oxanium = Oxanium({ subsets: ["latin-ext"] })
import { oxanium } from "@/fonts";
import type { Metadata } from 'next'; import type { Metadata } from 'next';

View file

@ -21,6 +21,7 @@ import {
FormLabel FormLabel
} from "@/components/ui/form"; } from "@/components/ui/form";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { oxanium } from "@/fonts";
import { Translations } from "@/i18n/translations"; import { Translations } from "@/i18n/translations";
import { import {
NewsletterFormSchema, NewsletterFormSchema,
@ -32,7 +33,7 @@ export function NewsletterPopup({ t }: { t: Translations }) {
return ( return (
<Dialog> <Dialog>
<DialogTrigger asChild> <DialogTrigger asChild>
<Button className="text-xl mt-4 jgs7 uppercase cursor-pointer">{t.newsletter.popupButton}</Button> <Button className={`${oxanium.className} text-xl mt-4 uppercase cursor-pointer`}>{t.newsletter.popupButton}</Button>
</DialogTrigger> </DialogTrigger>
<DialogContent className="sm:max-w-[425px]"> <DialogContent className="sm:max-w-[425px]">
<DialogHeader> <DialogHeader>
@ -68,7 +69,7 @@ export default function SubscriptionForm({ t }: { t: Translations }) {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormControl> <FormControl>
<Input placeholder="E-mail" type="email" required {...field} /> <Input placeholder={t.newsletter.emailField} type="email" required {...field} />
</FormControl> </FormControl>
</FormItem> </FormItem>
)} )}
@ -80,7 +81,7 @@ export default function SubscriptionForm({ t }: { t: Translations }) {
render={({ field }) => ( render={({ field }) => (
<FormItem> <FormItem>
<FormControl> <FormControl>
<Input placeholder="Name (optional)" {...field} /> <Input placeholder={t.newsletter.nameField} {...field} />
</FormControl> </FormControl>
</FormItem> </FormItem>
)} )}
@ -103,7 +104,7 @@ export default function SubscriptionForm({ t }: { t: Translations }) {
<FormLabel htmlFor="uodo"> <FormLabel htmlFor="uodo">
{t.newsletter.policyPrivacyCheckboxTitle} {t.newsletter.policyPrivacyCheckboxTitle}
</FormLabel> </FormLabel>
<p className="text-sm text-muted-foreground"> <p className="mt-1 text-sm text-muted-foreground">
{t.newsletter.policyPrivacyCheckboxDescription} {t.newsletter.policyPrivacyCheckboxDescription}
</p> </p>
</div> </div>

3
src/fonts.ts Normal file
View file

@ -0,0 +1,3 @@
import { Oxanium } from "next/font/google";
export const oxanium = Oxanium({ subsets: ["latin-ext"] })

View file

@ -67,6 +67,8 @@ const pl = {
}, },
newsletter: { newsletter: {
emailField: "E-mail",
nameField: "Imię/ksywa (opcjonalne)",
popupButton: "Zapisz się do newslettera", popupButton: "Zapisz się do newslettera",
title: "Newsletter CebulaCamp 2025", title: "Newsletter CebulaCamp 2025",
description: "Zasubskrybuj aby otrzymywać najnowsze wiadomości", description: "Zasubskrybuj aby otrzymywać najnowsze wiadomości",
@ -142,6 +144,8 @@ const en = {
}, },
newsletter: { newsletter: {
emailField: "E-mail",
nameField: "Name/nickname (optional)",
popupButton: "Subscribe to newsletter", popupButton: "Subscribe to newsletter",
title: "Newsletter CebulaCamp 2025", title: "Newsletter CebulaCamp 2025",
description: "Subscribe for live news", description: "Subscribe for live news",