refactor: internationalize terms-of-service page and improve styling

- Extract all terms-of-service text content into messages/en.json and messages/hr.json
- Update terms-of-service page to use next-intl translations with t.rich()
- Replace dangerouslySetInnerHTML with proper t.rich() formatting
- Add Croatian translation for terms-of-service page
- Increase disclaimer max-width from 20rem to 30rem for better readability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-12-24 21:54:16 +01:00
parent dc6fa0971e
commit 958abcc5e7
4 changed files with 182 additions and 48 deletions

View File

@@ -1,52 +1,72 @@
import { Main } from "@/app/ui/Main";
import { getTranslations } from "next-intl/server";
const TermsPage = () =>
<Main>
<article className="prose container">
<h1>Terms of Service for Home Utility Bills Tracking Web Application</h1>
<h2>1. Introduction</h2>
<p>Welcome to our Home Utility Bills Tracking Web Application (App). These Terms of Service (Terms) govern your access to and use of our App. By accessing or using the App, you agree to be bound by these Terms.</p>
<h2>2. Use of the Service</h2>
<ol>
<li><strong>Eligibility</strong>: You must be at least 18 years old to use the App.</li>
<li><strong>Account Registration</strong>: You must register for an account through Google OAuth to access the App.</li>
<li><strong>User Responsibilities</strong>: You are responsible for all activities conducted under your account and for keeping your password confidential.</li>
</ol>
<h2>3. User Content</h2>
<ol>
<li><strong>Ownership</strong>: You retain all rights to the data you enter into the App, including billing locations, bill names, and attached documents.</li>
<li><strong>Licenses</strong>: You grant us a license to use, store, and display the data you enter into the App for the purpose of providing the service.</li>
</ol>
<h2>4. Prohibited Conduct</h2>
<p>You agree not to use the App in a way that:</p>
<ol>
<li>Violates any law or regulation.</li>
<li>Is harmful, fraudulent, deceptive, threatening, harassing, defamatory, obscene, or otherwise objectionable.</li>
<li>Jeopardizes the security of your account or anyone else&apos;s account.</li>
</ol>
<h2>5. Modifications to the App</h2>
<p>We reserve the right to modify or discontinue, temporarily or permanently, the App (or any part thereof) with or without notice.</p>
<h2>6. Termination</h2>
<p>We may terminate or suspend your access to the App immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms.</p>
const TermsPage = async () => {
const t = await getTranslations("terms-of-service-page");
<h2>7. Disclaimers</h2>
<p>The App is provided on an AS IS and AS AVAILABLE basis. We disclaim all warranties of any kind, whether express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement.</p>
<p><strong>2D Barcode Information Disclaimer:</strong> We do not assume responsibility for the information contained within the 2D barcodes presented by the App. The content encoded in 2D barcodes is generated based on the information provided by the users or derived from the documents uploaded by the user, and we do not verify or guarantee its accuracy or completeness. Users are advised to review and confirm the correctness of such content before using it. We are not liable for any losses or damages resulting from the use of the 2D barcodes, including but not limited to transactions or payments initiated based on the information contained in these barcodes that may be detrimental to the user.</p>
const richTextFormat = {
strong: (chunks: React.ReactNode) => <strong>{chunks}</strong>,
a: (chunks: React.ReactNode) => <a href="mailto:support@rezije.app">{chunks}</a>
};
<h2>8. Limitation of Liability</h2>
<p>In no event shall we be liable for any indirect, incidental, special, consequential or punitive damages, or any loss of profits or revenues, whether incurred directly or indirectly, or any loss of data, use, goodwill, or other intangible losses, resulting from:</p>
<ol>
<li>your access to or use of or inability to access or use the App;</li>
<li>any conduct or content of any third party on the App;</li>
<li>the information contained within the 2D barcodes generated or presented by the App.</li>
</ol>
<h2>9. Governing Law</h2>
<p>These Terms shall be governed and construed in accordance with the laws of Croatia, without regard to its conflict of law provisions.</p>
<h2>10. Changes</h2>
<p>We reserve the right, at our sole discretion, to modify or replace these Terms at any time. We will try to provide at least 10 days&apos; notice prior to any new terms taking effect.</p>
<h2>11. Contact Us</h2>
<p>If you have any questions about these Terms, please contact us at <a href="mail:support@rezije.app">support@rezije.app</a>.</p>
</article>
</Main>;
return (
<Main>
<article className="prose container">
<h1>{t("title")}</h1>
export default TermsPage;
<h2>{t("section-1.heading")}</h2>
<p>{t("section-1.content")}</p>
<h2>{t("section-2.heading")}</h2>
<ol>
<li>{t.rich("section-2.item-1", richTextFormat)}</li>
<li>{t.rich("section-2.item-2", richTextFormat)}</li>
<li>{t.rich("section-2.item-3", richTextFormat)}</li>
</ol>
<h2>{t("section-3.heading")}</h2>
<ol>
<li>{t.rich("section-3.item-1", richTextFormat)}</li>
<li>{t.rich("section-3.item-2", richTextFormat)}</li>
</ol>
<h2>{t("section-4.heading")}</h2>
<p>{t("section-4.intro")}</p>
<ol>
<li>{t("section-4.item-1")}</li>
<li>{t("section-4.item-2")}</li>
<li>{t("section-4.item-3")}</li>
</ol>
<h2>{t("section-5.heading")}</h2>
<p>{t("section-5.content")}</p>
<h2>{t("section-6.heading")}</h2>
<p>{t("section-6.content")}</p>
<h2>{t("section-7.heading")}</h2>
<p>{t("section-7.paragraph-1")}</p>
<p>{t.rich("section-7.paragraph-2", richTextFormat)}</p>
<h2>{t("section-8.heading")}</h2>
<p>{t("section-8.intro")}</p>
<ol>
<li>{t("section-8.item-1")}</li>
<li>{t("section-8.item-2")}</li>
<li>{t("section-8.item-3")}</li>
</ol>
<h2>{t("section-9.heading")}</h2>
<p>{t("section-9.content")}</p>
<h2>{t("section-10.heading")}</h2>
<p>{t("section-10.content")}</p>
<h2>{t("section-11.heading")}</h2>
<p>{t.rich("section-11.content", richTextFormat)}</p>
</article>
</Main>
);
};
export default TermsPage;

View File

@@ -6,7 +6,7 @@ export const paragraphFormatFactory = (locale: string) => ({
bold: (chunks: ReactNode) => <strong className='text-bold' >{chunks}</strong>,
indigo: (chunks: ReactNode) => <span className="text-indigo-400"> {chunks} </span>,
p: (chunks: ReactNode) => <p className="p mt-[1em] max-w-[38rem] mx-auto text-justify">{chunks}</p>,
disclaimer: (chunks: ReactNode) => <p className="p mt-[1em] max-w-[20rem] mx-auto text-center text-sm text-neutral-500">{chunks}</p>,
disclaimer: (chunks: ReactNode) => <p className="p mt-[1em] max-w-[30rem] mx-auto text-center text-sm text-neutral-500">{chunks}</p>,
hint: (chunks: ReactNode) => <span className='text-indigo-400 block'> {chunks}</span>,
linkTermsOfService: (chunks: ReactNode) => <Link href={`/${locale}/terms-of-service`} className="hover:underline italic">{chunks}</Link>,
linkPrivacyPolicy: (chunks: ReactNode) => <Link href={`/${locale}/privacy-policy`} className="hover:underline italic">{chunks}</Link>

View File

@@ -273,5 +273,62 @@
"cancel-button": "Cancel",
"back-to-home-button": "Back to Home",
"save-error-message": "Error saving changes"
},
"terms-of-service-page": {
"title": "Terms of Service for Home Utility Bills Tracking Web Application",
"section-1": {
"heading": "1. Introduction",
"content": "Welcome to our Home Utility Bills Tracking Web Application (\"App\"). These Terms of Service (\"Terms\") govern your access to and use of our App. By accessing or using the App, you agree to be bound by these Terms."
},
"section-2": {
"heading": "2. Use of the Service",
"item-1": "<strong>Eligibility</strong>: You must be at least 18 years old to use the App.",
"item-2": "<strong>Account Registration</strong>: You must register for an account through Google OAuth to access the App.",
"item-3": "<strong>User Responsibilities</strong>: You are responsible for all activities conducted under your account and for keeping your password confidential."
},
"section-3": {
"heading": "3. User Content",
"item-1": "<strong>Ownership</strong>: You retain all rights to the data you enter into the App, including billing locations, bill names, and attached documents.",
"item-2": "<strong>Licenses</strong>: You grant us a license to use, store, and display the data you enter into the App for the purpose of providing the service."
},
"section-4": {
"heading": "4. Prohibited Conduct",
"intro": "You agree not to use the App in a way that:",
"item-1": "Violates any law or regulation.",
"item-2": "Is harmful, fraudulent, deceptive, threatening, harassing, defamatory, obscene, or otherwise objectionable.",
"item-3": "Jeopardizes the security of your account or anyone else's account."
},
"section-5": {
"heading": "5. Modifications to the App",
"content": "We reserve the right to modify or discontinue, temporarily or permanently, the App (or any part thereof) with or without notice."
},
"section-6": {
"heading": "6. Termination",
"content": "We may terminate or suspend your access to the App immediately, without prior notice or liability, for any reason whatsoever, including without limitation if you breach the Terms."
},
"section-7": {
"heading": "7. Disclaimers",
"paragraph-1": "The App is provided on an \"AS IS\" and \"AS AVAILABLE\" basis. We disclaim all warranties of any kind, whether express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement.",
"paragraph-2": "<strong>2D Barcode Information Disclaimer:</strong> We do not assume responsibility for the information contained within the 2D barcodes presented by the App. The content encoded in 2D barcodes is generated based on the information provided by the users or derived from the documents uploaded by the user, and we do not verify or guarantee its accuracy or completeness. Users are advised to review and confirm the correctness of such content before using it. We are not liable for any losses or damages resulting from the use of the 2D barcodes, including but not limited to transactions or payments initiated based on the information contained in these barcodes that may be detrimental to the user."
},
"section-8": {
"heading": "8. Limitation of Liability",
"intro": "In no event shall we be liable for any indirect, incidental, special, consequential or punitive damages, or any loss of profits or revenues, whether incurred directly or indirectly, or any loss of data, use, goodwill, or other intangible losses, resulting from:",
"item-1": "your access to or use of or inability to access or use the App;",
"item-2": "any conduct or content of any third party on the App;",
"item-3": "the information contained within the 2D barcodes generated or presented by the App."
},
"section-9": {
"heading": "9. Governing Law",
"content": "These Terms shall be governed and construed in accordance with the laws of Croatia, without regard to its conflict of law provisions."
},
"section-10": {
"heading": "10. Changes",
"content": "We reserve the right, at our sole discretion, to modify or replace these Terms at any time. We will try to provide at least 10 days' notice prior to any new terms taking effect."
},
"section-11": {
"heading": "11. Contact Us",
"content": "If you have any questions about these Terms, please contact us at <a href=\"mail:support@rezije.app\">support@rezije.app</a>."
}
}
}

View File

@@ -270,5 +270,62 @@
"cancel-button": "Odustani",
"back-to-home-button": "Povratak na početnu",
"save-error-message": "Greška pri spremanju promjena"
},
"terms-of-service-page": {
"title": "Uvjeti korištenja web aplikacije za evidenciju režija",
"section-1": {
"heading": "1. Uvod",
"content": "Dobrodošli u našu web aplikaciju za evidenciju režija (\"Aplikacija\"). Ovi Uvjeti korištenja (\"Uvjeti\") uređuju vaš pristup i korištenje naše Aplikacije. Pristupom ili korištenjem Aplikacije slažete se biti vezani ovim Uvjetima."
},
"section-2": {
"heading": "2. Korištenje usluge",
"item-1": "<strong>Prihvatljivost</strong>: Morate imati najmanje 18 godina za korištenje Aplikacije.",
"item-2": "<strong>Registracija računa</strong>: Morate se registrirati za račun putem Google OAuth-a kako biste pristupili Aplikaciji.",
"item-3": "<strong>Odgovornosti korisnika</strong>: Odgovorni ste za sve aktivnosti provedene pod vašim računom i za čuvanje vaše lozinke povjerljivom."
},
"section-3": {
"heading": "3. Korisnički sadržaj",
"item-1": "<strong>Vlasništvo</strong>: Zadržavate sva prava na podatke koje unosite u Aplikaciju, uključujući lokacije naplate, nazive računa i priložene dokumente.",
"item-2": "<strong>Licence</strong>: Dajete nam licencu za korištenje, pohranu i prikaz podataka koje unosite u Aplikaciju u svrhu pružanja usluge."
},
"section-4": {
"heading": "4. Zabranjeno ponašanje",
"intro": "Slažete se da nećete koristiti Aplikaciju na način koji:",
"item-1": "Krši bilo koji zakon ili propise.",
"item-2": "Je štetan, prijevaran, obmanjujući, prijeteći, uznemirujući, klevetničk, opscen ili na drugi način neprimjeren.",
"item-3": "Ugrožava sigurnost vašeg računa ili računa bilo koga drugog."
},
"section-5": {
"heading": "5. Izmjene Aplikacije",
"content": "Zadržavamo pravo modificirati ili prekinuti, privremeno ili trajno, Aplikaciju (ili bilo koji njen dio) s ili bez obavijesti."
},
"section-6": {
"heading": "6. Raskid",
"content": "Možemo odmah prekinuti ili suspendirati vaš pristup Aplikaciji, bez prethodne obavijesti ili odgovornosti, iz bilo kojeg razloga, uključujući bez ograničenja ako prekršite Uvjete."
},
"section-7": {
"heading": "7. Odricanje odgovornosti",
"paragraph-1": "Aplikacija se pruža \"KAKO JEST\" i \"KAKO JE DOSTUPNA\". Odričemo se svih jamstava bilo koje vrste, bilo izričitih ili implicitnih, uključujući, ali ne ograničavajući se na, implicitna jamstva trgovinske valjanosti, prikladnosti za određenu svrhu i nepovrjeđivanja.",
"paragraph-2": "<strong>Odricanje odgovornosti za informacije 2D barkoda:</strong> Ne preuzimamo odgovornost za informacije sadržane u 2D barkodovima koje prikazuje Aplikacija. Sadržaj kodiran u 2D barkodovima generiran je na temelju informacija koje pružaju korisnici ili izveden iz dokumenata koje je učitao korisnik, i ne provjeravamo niti jamčimo njegovu točnost ili potpunost. Korisnicima se savjetuje da provjere i potvrde ispravnost takvog sadržaja prije korištenja. Nismo odgovorni za bilo kakve gubitke ili štete koje proizlaze iz korištenja 2D barkodova, uključujući ali ne ograničavajući se na transakcije ili plaćanja pokrenuta na temelju informacija sadržanih u tim barkodovima koje mogu biti štetne za korisnika."
},
"section-8": {
"heading": "8. Ograničenje odgovornosti",
"intro": "Ni u kojem slučaju nećemo biti odgovorni za bilo kakvu indirektnu, slučajnu, posebnu, posljedičnu ili kaznenu štetu, ili bilo kakav gubitak dobiti ili prihoda, bilo da je pretrpljen izravno ili neizravno, ili bilo kakav gubitak podataka, korištenja, dobrih vrijednosti ili drugih nematerijalnih gubitaka, koji proizlaze iz:",
"item-1": "vašeg pristupa ili korištenja ili nemogućnosti pristupa ili korištenja Aplikacije;",
"item-2": "bilo kojeg ponašanja ili sadržaja bilo koje treće strane na Aplikaciji;",
"item-3": "informacija sadržanih u 2D barkodovima generiranim ili prikazanim od strane Aplikacije."
},
"section-9": {
"heading": "9. Mjerodavno pravo",
"content": "Ovi Uvjeti će se uređivati i tumačiti u skladu sa zakonima Republike Hrvatske, bez obzira na njezine odredbe o sukobu zakona."
},
"section-10": {
"heading": "10. Izmjene",
"content": "Zadržavamo pravo, prema vlastitom nahođenju, modificirati ili zamijeniti ove Uvjete u bilo kojem trenutku. Pokušat ćemo dati najmanje 10 dana obavijesti prije stupanja na snagu bilo kojih novih uvjeta."
},
"section-11": {
"heading": "11. Kontaktirajte nas",
"content": "Ako imate bilo kakvih pitanja o ovim Uvjetima, molimo kontaktirajte nas na <a href=\"mail:support@rezije.app\">support@rezije.app</a>."
}
}
}