damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

commit e3f72821f194356aab1d900ab3db404eaafda84d
parent bcd15c47592acf98c20e92fcb1ea4fed716e7f90
Author: Daniel D’Aquino <daniel@daquino.me>
Date:   Wed,  3 Jan 2024 16:46:36 -0800

Add more questions to FAQ, and improve intl integration

Diffstat:
Mcontent/compiled-locales/en.json | 110++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mcontent/locales/en.json | 62+++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Msrc/components/sections/PurpleFAQ.tsx | 57++++++++++++++++++++++++++++++++++++---------------------
Msrc/pages/purple/index.tsx | 3++-
4 files changed, 196 insertions(+), 36 deletions(-)

diff --git a/content/compiled-locales/en.json b/content/compiled-locales/en.json @@ -347,34 +347,130 @@ "value": "Get more from Damus." } ], - "purple.faq.answer.1.a": [ + "purple.faq.1.a": [ { "type": 0, - "value": "Oh yeah! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." + "value": "Yes! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." } ], - "purple.faq.answer.2.a": [ + "purple.faq.1.q": [ + { + "type": 0, + "value": "Can I pay with Lightning?" + } + ], + "purple.faq.2.a": [ { "type": 0, "value": "Unfortunately not. Apple doesn’t allow apps to accept Lightning payments. but you can register on the website and pay with Lightning there." } ], + "purple.faq.2.q": [ + { + "type": 0, + "value": "Can I pay with lightning via the app?" + } + ], + "purple.faq.3.a": [ + { + "type": 0, + "value": "Damus Purple is a paid subscription to Damus that gives you access to exclusive features, and helps us fund the project" + } + ], + "purple.faq.3.q": [ + { + "type": 0, + "value": "What is Damus Purple?" + } + ], + "purple.faq.4.a": [ + { + "type": 0, + "value": "Currently we offer automatic translations of posts. We are working to add more features as soon as possible." + } + ], + "purple.faq.4.q": [ + { + "type": 0, + "value": "What are the exclusive features?" + } + ], + "purple.faq.5.a": [ + { + "type": 0, + "value": "Please see the section below for pricing." + } + ], + "purple.faq.5.q": [ + { + "type": 0, + "value": "How much does it cost?" + } + ], + "purple.faq.6.a": [ + { + "type": 0, + "value": "Yes! You can pay with fiat if you register on the iOS app, via Apple Pay." + } + ], + "purple.faq.6.q": [ + { + "type": 0, + "value": "Can I pay with fiat?" + } + ], + "purple.faq.7.a": [ + { + "type": 0, + "value": "Sorry, we do not accept any cryptographic currencies other than Bitcoin via Lightning network." + } + ], + "purple.faq.7.q": [ + { + "type": 0, + "value": "Can I pay with crypto?" + } + ], + "purple.faq.8.a": [ + { + "type": 0, + "value": "Yes! You can donate to Damus via the Lightning network. Please click on 'Zap us' on the top menu." + } + ], + "purple.faq.8.q": [ + { + "type": 0, + "value": "Can I simply donate to Damus?" + } + ], "purple.faq.headline": [ { "type": 0, "value": "Frequent Questions" } ], - "purple.faq.question.1.q": [ + "purple.final_cta.headline": [ { "type": 0, - "value": "Can I pay with Lightning?" + "value": "Get Purple today!" + } + ], + "purple.final_cta.open_app": [ + { + "type": 0, + "value": "Open in Damus" + } + ], + "purple.final_cta.subheadline": [ + { + "type": 0, + "value": "Contribute to the future of the free internet, and look cool doing it." } ], - "purple.faq.question.2.q": [ + "purple.final_cta.subscribe": [ { "type": 0, - "value": "But can I pay with lightning via the app?" + "value": "Subscribe" } ], "purple.hero.learn-more": [ diff --git a/content/locales/en.json b/content/locales/en.json @@ -167,20 +167,68 @@ "purple.benefits.headline": { "string": "Get more from Damus." }, - "purple.faq.answer.1.a": { - "string": "Oh yeah! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." + "purple.faq.1.a": { + "string": "Yes! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." }, - "purple.faq.answer.2.a": { + "purple.faq.1.q": { + "string": "Can I pay with Lightning?" + }, + "purple.faq.2.a": { "string": "Unfortunately not. Apple doesn’t allow apps to accept Lightning payments. but you can register on the website and pay with Lightning there." }, + "purple.faq.2.q": { + "string": "Can I pay with lightning via the app?" + }, + "purple.faq.3.a": { + "string": "Damus Purple is a paid subscription to Damus that gives you access to exclusive features, and helps us fund the project" + }, + "purple.faq.3.q": { + "string": "What is Damus Purple?" + }, + "purple.faq.4.a": { + "string": "Currently we offer automatic translations of posts. We are working to add more features as soon as possible." + }, + "purple.faq.4.q": { + "string": "What are the exclusive features?" + }, + "purple.faq.5.a": { + "string": "Please see the section below for pricing." + }, + "purple.faq.5.q": { + "string": "How much does it cost?" + }, + "purple.faq.6.a": { + "string": "Yes! You can pay with fiat if you register on the iOS app, via Apple Pay." + }, + "purple.faq.6.q": { + "string": "Can I pay with fiat?" + }, + "purple.faq.7.a": { + "string": "Sorry, we do not accept any cryptographic currencies other than Bitcoin via Lightning network." + }, + "purple.faq.7.q": { + "string": "Can I pay with crypto?" + }, + "purple.faq.8.a": { + "string": "Yes! You can donate to Damus via the Lightning network. Please click on 'Zap us' on the top menu." + }, + "purple.faq.8.q": { + "string": "Can I simply donate to Damus?" + }, "purple.faq.headline": { "string": "Frequent Questions" }, - "purple.faq.question.1.q": { - "string": "Can I pay with Lightning?" + "purple.final_cta.headline": { + "string": "Get Purple today!" + }, + "purple.final_cta.open_app": { + "string": "Open in Damus" }, - "purple.faq.question.2.q": { - "string": "But can I pay with lightning via the app?" + "purple.final_cta.subheadline": { + "string": "Contribute to the future of the free internet, and look cool doing it." + }, + "purple.final_cta.subscribe": { + "string": "Subscribe" }, "purple.hero.learn-more": { "string": "Learn more" diff --git a/src/components/sections/PurpleFAQ.tsx b/src/components/sections/PurpleFAQ.tsx @@ -11,28 +11,43 @@ import { AccordionTrigger, } from "@/components/ui/Accordion" -const faq = [ - { - questionIntlString: "purple.faq.1.q", - answerIntlString: "purple.faq.1.a", - }, - { - questionIntlString: "purple.faq.2.q", - answerIntlString: "purple.faq.2.a", - } -] - - export function PurpleFAQ({ className }: { className?: string }) { const intl = useIntl() - // This type of structure is necessary in this case to make strings get picked up by `npm run i18n` - const faqIntlStrings: Record<string, string> = { - "purple.faq.1.q": intl.formatMessage({ id: "purple.faq.question.1.q", defaultMessage: "Can I pay with Lightning?" }), - "purple.faq.1.a": intl.formatMessage({ id: "purple.faq.answer.1.a", defaultMessage: "Oh yeah! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." }), - "purple.faq.2.q": intl.formatMessage({ id: "purple.faq.question.2.q", defaultMessage: "But can I pay with lightning via the app?" }), - "purple.faq.2.a": intl.formatMessage({ id: "purple.faq.answer.2.a", defaultMessage: "Unfortunately not. Apple doesn’t allow apps to accept Lightning payments. but you can register on the website and pay with Lightning there." }), - } + const faq = [ + { + question: intl.formatMessage({ id: "purple.faq.3.q", defaultMessage: "What is Damus Purple?" }), + answer: intl.formatMessage({ id: "purple.faq.3.a", defaultMessage: "Damus Purple is a paid subscription to Damus that gives you access to exclusive features, and helps us fund the project" }), + }, + { + question: intl.formatMessage({ id: "purple.faq.4.q", defaultMessage: "What are the exclusive features?" }), + answer: intl.formatMessage({ id: "purple.faq.4.a", defaultMessage: "Currently we offer automatic translations of posts. We are working to add more features as soon as possible." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.5.q", defaultMessage: "How much does it cost?" }), + answer: intl.formatMessage({ id: "purple.faq.5.a", defaultMessage: "Please see the section below for pricing." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.1.q", defaultMessage: "Can I pay with Lightning?" }), + answer: intl.formatMessage({ id: "purple.faq.1.a", defaultMessage: "Yes! You can pay with Lightning if you register on the website. For the iOS app, you can pay with Apple Pay." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.6.q", defaultMessage: "Can I pay with fiat?" }), + answer: intl.formatMessage({ id: "purple.faq.6.a", defaultMessage: "Yes! You can pay with fiat if you register on the iOS app, via Apple Pay." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.7.q", defaultMessage: "Can I pay with crypto?" }), + answer: intl.formatMessage({ id: "purple.faq.7.a", defaultMessage: "Sorry, we do not accept any cryptographic currencies other than Bitcoin via Lightning network." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.2.q", defaultMessage: "Can I pay with lightning via the app?" }), + answer: intl.formatMessage({ id: "purple.faq.2.a", defaultMessage: "Unfortunately not. Apple doesn’t allow apps to accept Lightning payments. but you can register on the website and pay with Lightning there." }), + }, + { + question: intl.formatMessage({ id: "purple.faq.8.q", defaultMessage: "Can I simply donate to Damus?" }), + answer: intl.formatMessage({ id: "purple.faq.8.a", defaultMessage: "Yes! You can donate to Damus via the Lightning network. Please click on \'Zap us\' on the top menu." }), + } + ] return (<> <div className={cn("bg-black overflow-hidden relative", className)}> @@ -48,9 +63,9 @@ export function PurpleFAQ({ className }: { className?: string }) { <Accordion type="single" collapsible className="w-full text-white max-w-3xl mx-auto"> {faq.map((item, index) => ( <AccordionItem value={`item-${index}`} key={index}> - <AccordionTrigger>{faqIntlStrings[item.questionIntlString]}</AccordionTrigger> + <AccordionTrigger>{item.question}</AccordionTrigger> <AccordionContent> - {faqIntlStrings[item.answerIntlString]} + {item.answer} </AccordionContent> </AccordionItem> ))} diff --git a/src/pages/purple/index.tsx b/src/pages/purple/index.tsx @@ -21,7 +21,8 @@ export default function HomePage() { setMessages(English); break; case "ja": - setMessages(Japanese); + // TODO: Add Japanese translations and then switch to "Japanese" below + setMessages(English); break; default: setMessages(English);