(null)
const timezone = getClientTimezone()
const locale = i18n.language
- const links = [
- { text: 'EULA', href: 'https://aura.wit.life/terms' },
- { text: 'Privacy Policy', href: 'https://aura.wit.life/privacy' },
- ]
const handleValidEmail = (email: string) => {
dispatch(actions.form.addEmail(email))
setIsDisabled(false)
@@ -66,7 +62,12 @@ function EmailEnterPage(): JSX.Element {
onInvalid={() => setIsDisabled(true)}
/>
{t('we_dont_share')}
- {t('continue_agree')}
+
+ {t('continue_agree', {
+ eulaLink: {t('eula')},
+ privacyLink: {t('privacy_policy')},
+ })}
+
{isLoading ? : t('continue')}
diff --git a/src/components/Navbar/index.tsx b/src/components/Navbar/index.tsx
index be3e040..525ab05 100644
--- a/src/components/Navbar/index.tsx
+++ b/src/components/Navbar/index.tsx
@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { useAuth } from '../../auth'
import { useLegal } from '../../legal'
@@ -13,6 +14,7 @@ const capitalize = (str: string) => str.charAt(0).toUpperCase() + str.slice(1)
function Navbar({ isOpen, closeMenu }: NavbarProps): JSX.Element {
const { logout } = useAuth()
+ const { t } = useTranslation()
const legal = useLegal()
const combinedClassNames = ['navbar', isOpen && 'navbar--open'].filter(Boolean).join(' ')
return (
@@ -31,7 +33,10 @@ function Navbar({ isOpen, closeMenu }: NavbarProps): JSX.Element {
{capitalize(item.title)}
))}
- Contact us
+
+ {t('contact_us')}
+
+
Log Out
diff --git a/src/components/PaymentPage/index.tsx b/src/components/PaymentPage/index.tsx
index a57787e..61ad87f 100644
--- a/src/components/PaymentPage/index.tsx
+++ b/src/components/PaymentPage/index.tsx
@@ -57,7 +57,9 @@ function PaymentPage(): JSX.Element {
{t('card')}
- You will be charged only $1 for your 7-day trial. We'll email your a reminder before your trial period ends.
+
+ {t('will_be_charged', { strongText: {t('trial_price')} })}
+
>
)}
diff --git a/src/components/Policy/index.tsx b/src/components/Policy/index.tsx
index 9979f7b..06a2930 100644
--- a/src/components/Policy/index.tsx
+++ b/src/components/Policy/index.tsx
@@ -1,13 +1,6 @@
-import { ReactNode } from 'react'
import './styles.css'
-type Link = {
- text: string
- href: string
-}
-
interface PolicyProps {
- links: Link[]
children: string
sizing?: 'small' | 'medium' | 'large'
}
@@ -18,26 +11,10 @@ const sizes = {
large: 'policy--large',
}
-function Policy({ links, children, sizing = 'small' }: PolicyProps): JSX.Element {
- const createLinkedContent = (sentence: string): ReactNode[] => {
- const pattern = links.map(link => `(${link.text})`).join('|');
- const regex = new RegExp(pattern, 'g');
- return sentence.split(regex).map((part, idx) => {
- const link = links.find(({ text }) => text === part);
-
- if (!link) return part
-
- return (
-
- {link.text}
-
- );
- });
- }
-
+function Policy({ children, sizing = 'small' }: PolicyProps): JSX.Element {
return (
-
{createLinkedContent(children)}
+
{children}
)
}
diff --git a/src/components/StaticPage/index.tsx b/src/components/StaticPage/index.tsx
index fe06142..7425101 100644
--- a/src/components/StaticPage/index.tsx
+++ b/src/components/StaticPage/index.tsx
@@ -2,6 +2,7 @@ import { useParams } from 'react-router'
import { useTranslation } from 'react-i18next'
import { useApi, useApiCall, Element } from '../../api'
import { useCallback } from 'react'
+import parse from 'html-react-parser'
import Loader from '../Loader'
import NotFoundPage from '../NotFoundPage'
import './styles.css'
@@ -20,7 +21,7 @@ function StaticPage(): JSX.Element {
return (
- {isPending ? : }
+ {isPending ? : {parse(data?.body)}
}
{error && }
)
diff --git a/src/components/SubscriptionPage/index.tsx b/src/components/SubscriptionPage/index.tsx
index 3c9d706..d74d1c0 100644
--- a/src/components/SubscriptionPage/index.tsx
+++ b/src/components/SubscriptionPage/index.tsx
@@ -14,9 +14,6 @@ function SubscriptionPage(): JSX.Element {
const { t } = useTranslation()
const navigate = useNavigate()
const email = useSelector(selectors.selectEmail)
- const links = [
- { text: 'Subscription policy', href: 'https://aura.wit.life/' },
- ]
const currency = Currency.USD
const locale = Locale.EN
const paymentItems = [
@@ -35,7 +32,11 @@ function SubscriptionPage(): JSX.Element {
{t('get_access')}
- {t('subscription_policy')}
+
+ {t('subscription_text', {
+ policyLink: {t('subscription_policy')},
+ })}
+
>
)
diff --git a/src/init.tsx b/src/init.tsx
index 94830e4..954ae0e 100644
--- a/src/init.tsx
+++ b/src/init.tsx
@@ -1,5 +1,6 @@
import React from 'react'
import i18next from 'i18next'
+import ReactPostprocessor from 'i18next-react-postprocessor'
import { BrowserRouter } from 'react-router-dom'
import { I18nextProvider, initReactI18next } from 'react-i18next'
import { Provider } from 'react-redux'
@@ -17,8 +18,8 @@ const init = async () => {
const resources = buildResources(response)
const legal = buildLegal(response)
const i18nextInstance = i18next.createInstance()
- const options = { lng, resources, fallbackLng }
- await i18nextInstance.use(initReactI18next).init(options)
+ const options = { lng, resources, fallbackLng, postProcess: [ `reactPostprocessor` ] }
+ await i18nextInstance.use(initReactI18next).use(new ReactPostprocessor()).init(options)
return (
diff --git a/src/locales/dev.ts b/src/locales/dev.ts
index 970c01a..7c2e62e 100644
--- a/src/locales/dev.ts
+++ b/src/locales/dev.ts
@@ -3,7 +3,10 @@ export default {
lets_start: "Let's start!",
next: "Next",
date_of_birth: "What's your date of birth?",
- privacy_text: "By continuing, you agree to our EULA and Privacy Notice. Have a question? Reach our support team here",
+ privacy_text: "By continuing, you agree to our and . Have a question? Reach our support team ",
+ eula: 'EULA',
+ here: 'here',
+ privacy_notice: 'Privacy Notice',
born_time_question: "What time were you born?",
nasa_data_using: "We use NASA data to determine the exact position of the planets in the sky at the time of your birth to create wallpapers that are just right for you.",
cta_title: "Start your 7-day trial",
@@ -20,19 +23,24 @@ export default {
we_will_email_you: "We will email you a copy of your wallpaper for easy access.",
your_email: "Your email",
we_dont_share: "We don't share any personal information.",
- continue_agree: 'By clicking "Continue" below, you agree to our EULA and Privacy Policy.',
+ continue_agree: 'By clicking "Continue" below, you agree to our and .',
+ privacy_policy: "Privacy Policy",
continue: 'Continue',
app_name: "Aura",
unexpected_error: 'Sorry, an unexpected error has occurred.',
oops: "Oops!",
- total_today: 'Total today',
+ total_today: "Total today",
charged_only: "You will be charged only $1 for your 7-day trial. We'll email you a reminder before your trial period ends. Cancel anytime.",
- purposes: 'For entertaiment purposes only.',
- get_access: 'Get access',
- subscription_policy: 'By proceeding, you agree that if you do not cancel your subscription before the end of the 7-day trial period, you will be automatically charged nineteen US dollars zero cents every 2 weeks until you cancel the subscription in the settings. Learn more about cancellation and refund policy in Subscription policy',
- company_name: 'Wit LLC, California, US',
- choose_payment: 'Choose Payment Method',
- or: 'OR',
- card: 'Credit / Debit Card',
+ purposes: "For entertaiment purposes only.",
+ get_access: "Get access",
+ subscription_text: "By proceeding, you agree that if you do not cancel your subscription before the end of the 7-day trial period, you will be automatically charged nineteen US dollars zero cents every 2 weeks until you cancel the subscription in the settings. Learn more about cancellation and refund policy in ",
+ subscription_policy: "Subscription policy",
+ company_name: "Wit LLC, California, US",
+ choose_payment: "Choose Payment Method",
+ or: "OR",
+ card: "Credit / Debit Card",
+ contact_us: "Contact us",
+ will_be_charged: "You will be charged only . We'll email your a reminder before your trial period ends.",
+ trial_price: "$1 for your 7-day trial",
},
}