diff --git a/next/components/organisms/componentsUserPage/PlansAndPayment.js b/next/components/organisms/componentsUserPage/PlansAndPayment.js index be3d66282..9ea34626c 100644 --- a/next/components/organisms/componentsUserPage/PlansAndPayment.js +++ b/next/components/organisms/componentsUserPage/PlansAndPayment.js @@ -18,6 +18,7 @@ import { ControlledInputSimple } from "../../atoms/ControlledInput"; import Link from "../../atoms/Link"; import Toggle from "../../atoms/Toggle"; import { CardPrice } from "../../../pages/prices"; +import { CardPriceEnterprise } from "../../../pages/prices"; import PaymentSystem from "../../organisms/PaymentSystem"; import { triggerGAEvent } from "../../../utils"; @@ -36,7 +37,7 @@ import ErrIcon from "../../../public/img/icons/errIcon"; import stylesPS from "../../../styles/paymentSystem.module.css"; export default function PlansAndPayment ({ userData }) { - const { t } = useTranslation('user'); + const { t } = useTranslation(['user', 'prices']); const router = useRouter() const { query } = router const [plan, setPlan] = useState("") @@ -141,7 +142,7 @@ export default function PlansAndPayment ({ userData }) { const resources = { "BD Gratis" : { - title: t('username.DBFree'), + title: t('prices:plans.free.title'), buttons: [{ text: t('username.comparePlans'), onClick: () => { @@ -149,18 +150,13 @@ export default function PlansAndPayment ({ userData }) { setToggleAnual(true) }} ], - resources : [ - {name: t('username.processedTables')}, - {name: t('username.integratedData'), tooltip: t('username.integratedDataTooltip')}, - {name: t('username.updatedLowFrequencyData')}, - {name: t('username.cloudAccess')}, - {name: t('username.sqlPythonRAccess')}, - {name: t('username.biIntegration')}, - planActive ? "" : {name: t('username.downloadLimit100MB'), tooltip: t('username.downloadLimit100MBTooltip')}, - ] + resources: t('prices:plans.free.features', { returnObjects: true }).map((feature, index) => ({ + name: feature, + tooltip: index === 1 ? t('prices:tooltips.integratedData') : (index === 6 ? t('prices:tooltips.downloadLimit') : null) + })) }, "bd_pro" : { - title: t('username.DBPro'), + title: t('prices:plans.pro.title'), buttons : [{ text: t('username.cancelPlan'), onClick: () => CancelModalPlan.onOpen(), @@ -177,14 +173,13 @@ export default function PlansAndPayment ({ userData }) { } } }], - resources : [ - {name: t('username.dozensOfHighFrequencyDatasets')}, - {name: t('username.companyReferenceTable')}, - {name: t('username.downloadLimit1GB'), tooltip: t('username.downloadLimit1GBTooltip')}, - ] + resources: t('prices:plans.pro.features', { returnObjects: true }).map((feature, index) => ({ + name: feature, + tooltip: index === 2 ? t('prices:tooltips.downloadLimitPro') : null + })) }, "bd_pro_empresas" : { - title: t('username.DBEnterprise'), + title: t('prices:plans.enterprise.title'), buttons : [{ text: t('username.cancelPlan'), onClick: () => CancelModalPlan.onOpen(), @@ -201,10 +196,8 @@ export default function PlansAndPayment ({ userData }) { } } }], - resources : [ - {name: t('username.accessFor10Accounts')}, - {name: t('username.prioritySupport')} - ]} + resources: t('prices:plans.enterprise.features', { returnObjects: true }).map(feature => ({ name: feature })) + } } const defaultResource = resources["BD Gratis"] @@ -1200,38 +1193,33 @@ export default function PlansAndPayment ({ userData }) { spacing={0} > {t('username.DBFreeSubtitle')}} + title={t('prices:plans.free.title')} + subTitle={<>{t('prices:plans.free.subtitle')}} price={"0"} - textResource={t('username.resources')} - resources={[ - {name: t('username.processedTables')}, - {name: t('username.integratedData'), tooltip: t('username.integratedDataTooltip')}, - {name: t('username.cloudAccess')}, - {name: t('username.sqlPythonRAccess')}, - {name: t('username.biIntegration')}, - {name: t('username.downloadLimit100MB'), tooltip: t('username.downloadLimit100MBTooltip')}, - ]} + textResource={t('prices:features')} + resources={t('prices:plans.free.features', { returnObjects: true }).map((feature, index) => ({ + name: feature, + tooltip: index === 1 ? t('prices:tooltips.integratedData') : (index === 6 ? t('prices:tooltips.downloadLimit') : null) + }))} button={{ - text: t('username.exploreFeatures'), + text: t('prices:exploreFeatures'), href: "/search", noHasModal: true, }} /> {t('username.DBProSubtitle')}} + title={t('prices:plans.pro.title')} + subTitle={<>{t('prices:plans.pro.subtitle')}} price={plans?.[`bd_pro_${toggleAnual ? "year" : "month"}`].amount || 444} anualPlan={toggleAnual} - textResource={t('username.allDBFreeResources')} - resources={[ - {name: t('username.dozensOfHighFrequencyDatasets')}, - {name: t('username.companyReferenceTable')}, - {name: t('username.downloadLimit1GB'), tooltip: t('username.downloadLimit1GBTooltip')} - ]} + textResource={t('prices:allFeaturesPlus', { plan: t('prices:plans.free.title') })} + resources={t('prices:plans.pro.features', { returnObjects: true }).map((feature, index) => ({ + name: feature, + tooltip: index === 2 ? t('prices:tooltips.downloadLimitPro') : null + }))} button={{ - text: `${subscriptionInfo?.stripeSubscription === "bd_pro" ? t('username.currentPlan') : hasSubscribed ? t('username.subscribe') : t('username.startFreeTrial')}`, + text: `${subscriptionInfo?.stripeSubscription === "bd_pro" ? t('currentPlan') : hasSubscribed ? t('subscribe') : t('startFreeTrial')}`, onClick: subscriptionInfo?.stripeSubscription === "bd_pro" ? () => {} : () => { setPlan(plans?.[`bd_pro_${toggleAnual ? "year" : "month"}`]._id) PlansModal.onClose() @@ -1241,24 +1229,17 @@ export default function PlansAndPayment ({ userData }) { }} /> - {t('username.DBEnterpriseSubtitle')}} - price={plans?.[`bd_empresas_${toggleAnual ? "year" : "month"}`].amount || 3360} - anualPlan={toggleAnual} - textResource={t('username.allDBProResources')} - resources={[ - {name: t('username.accessFor10Accounts')}, - {name: t('username.prioritySupport')} - ]} + {t('prices:plans.enterprise.subtitle')}} + price="" + textResource={t('prices:allFeaturesPlus', { plan: t('prices:plans.pro.title') })} + resources={t('prices:plans.enterprise.features', { returnObjects: true }).map((feature, index) => ({ + name: feature, + }))} button={{ - text: `${subscriptionInfo?.stripeSubscription === "bd_pro_empresas" ? t('username.currentPlan') : hasSubscribed ? t('username.subscribe') : t('username.startFreeTrial')}`, - onClick: subscriptionInfo?.stripeSubscription === "bd_pro_empresas" ? () => {} : () => { - setPlan(plans?.[`bd_empresas_${toggleAnual ? "year" : "month"}`]._id) - PlansModal.onClose() - EmailModal.onOpen() - }, - isCurrentPlan: subscriptionInfo?.stripeSubscription === "bd_pro_empresas" ? true : false, + text: t('prices:plans.enterprise.contactUs'), + href: "/contact-services", }} /> diff --git a/next/pages/_app.js b/next/pages/_app.js index 957df2772..a4f6a2234 100644 --- a/next/pages/_app.js +++ b/next/pages/_app.js @@ -10,7 +10,6 @@ function MyApp({ Component, pageProps }) { const router = useRouter(); const { locale } = router; const { t } = useTranslation('app'); - const queryClient = new QueryClient({ cacheTime: 0, }); diff --git a/next/pages/contact-consulting.js b/next/pages/contact-services.js similarity index 97% rename from next/pages/contact-consulting.js rename to next/pages/contact-services.js index 5b716c8f9..4bde624ee 100644 --- a/next/pages/contact-consulting.js +++ b/next/pages/contact-services.js @@ -21,7 +21,7 @@ export async function getStaticProps({ locale }) { }; } -export default function ContactConsulting() { +export default function ContactServices() { const { t } = useTranslation('contact'); const { locale } = useRouter(); diff --git a/next/pages/prices.js b/next/pages/prices.js index eb926b926..645abe262 100644 --- a/next/pages/prices.js +++ b/next/pages/prices.js @@ -294,6 +294,264 @@ export const CardPrice = ({ ) } +export const CardPriceEnterprise = ({ + title, + subTitle, + price, + anualPlan = false, + textResource, + resources = [], + button, + locale, +}) => { + const { t } = useTranslation('prices'); + + return ( + + + + + {title} + + + + + {subTitle} + + + + + + {t('plans.enterprise.customPrice')} + + + + + + + + + + + + {textResource} + + + {resources.map((elm, i) => { + return ( + + + + {elm.name} + + {elm.tooltip && + + + + } + + ) + })} + + + + {button.isCurrentPlan ? ( + + {t('currentPlan')} + + ) : ( + + + {t(button.text)} + + + )} + + {t('readThe')} + + + {t('termsOfService')} + + + . + + + + + + ) +} + export function SectionPrice() { const { t, ready } = useTranslation('prices'); const { locale } = useRouter(); @@ -463,17 +721,15 @@ export function SectionPrice() { locale={locale} /> - ({ name: feature }))} button={{ - text: isBDEmp.isCurrentPlan && planIntervalPlan() ? t('currentPlan') : hasSubscribed ? t('subscribe') : t('startFreeTrial'), - href: username === null ? `/user/login?i=${plans?.[`bd_empresas_${toggleAnual ? "year" : "month"}`]._id}` :`/user/${username}?plans_and_payment&i=${plans?.[`bd_empresas_${toggleAnual ? "year" : "month"}`]._id}`, - isCurrentPlan: isBDEmp.isCurrentPlan && planIntervalPlan(), + text: t('plans.enterprise.contactUs'), + href: "/contact-services", }} locale={locale} /> diff --git a/next/pages/services.js b/next/pages/services.js index 52d9a39bd..d2608243d 100644 --- a/next/pages/services.js +++ b/next/pages/services.js @@ -120,7 +120,7 @@ function Slogan () { {t('slogan.description')}