diff --git a/pages/api/upgrade.ts b/pages/api/upgrade.ts index e415ce62..bcfe02a3 100644 --- a/pages/api/upgrade.ts +++ b/pages/api/upgrade.ts @@ -12,7 +12,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) return res.status(401).json({ message: "Not authenticated" }); } - if (req.method !== "GET") { + if (!["GET", "POST"].includes(req.method!)) { throw new HttpCode({ statusCode: 405, message: "Method Not Allowed" }); } @@ -42,6 +42,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse) }); const data = await response.json(); + if (!data.url) throw new HttpCode({ statusCode: 401, message: data.message }); + res.redirect(303, data.url); } catch (error) { console.error(`error`, error); diff --git a/pages/event-types/index.tsx b/pages/event-types/index.tsx index 72a52e52..f1285575 100644 --- a/pages/event-types/index.tsx +++ b/pages/event-types/index.tsx @@ -8,6 +8,7 @@ import { LinkIcon, UsersIcon, } from "@heroicons/react/solid"; +import { Trans } from "next-i18next"; import Head from "next/head"; import Link from "next/link"; import React, { Fragment, useEffect, useState } from "react"; @@ -329,12 +330,13 @@ const EventTypesPage = () => { severity="warning" title={<>{t("plan_upgrade")}} message={ - <> - {t("to_upgrade_go_to")}{" "} - - {"https://cal.com/upgrade"} + + You can + + upgrade here - + . + } className="mb-4" /> diff --git a/pages/settings/billing.tsx b/pages/settings/billing.tsx index 8a28bce5..5c5fcb0a 100644 --- a/pages/settings/billing.tsx +++ b/pages/settings/billing.tsx @@ -1,41 +1,58 @@ import { ExternalLinkIcon } from "@heroicons/react/solid"; +import { ReactNode } from "react"; import { useLocale } from "@lib/hooks/useLocale"; import SettingsShell from "@components/SettingsShell"; -import Shell from "@components/Shell"; +import Shell, { useMeQuery } from "@components/Shell"; import Button from "@components/ui/Button"; +type CardProps = { title: string; description: string; className?: string; children: ReactNode }; +const Card = ({ title, description, className = "", children }: CardProps): JSX.Element => ( +
+
+

{title}

+
+

{description}

+
+
{children}
+
+
+); + export default function Billing() { const { t } = useLocale(); + const query = useMeQuery(); + const { data } = query; return (
-
+ {data?.plan && ["FREE", "TRIAL"].includes(data.plan) && ( + +
+ +
+
+ )} + + +
+ +
+
+
-

- {t("view_and_manage_billing_details")} -

-
-

{t("view_and_edit_billing_details")}

-
-
-
- -
-
-
-
-
-
-

{t("need_anything_else")}

-
+

{t("need_anything_else")}

+

{t("further_billing_help")}

diff --git a/pages/settings/profile.tsx b/pages/settings/profile.tsx index 164dfee8..65a18975 100644 --- a/pages/settings/profile.tsx +++ b/pages/settings/profile.tsx @@ -3,6 +3,7 @@ import { TrashIcon } from "@heroicons/react/solid"; import crypto from "crypto"; import { GetServerSidePropsContext } from "next"; import { signOut } from "next-auth/react"; +import { Trans } from "next-i18next"; import { useRouter } from "next/router"; import { ComponentProps, FormEvent, RefObject, useEffect, useMemo, useRef, useState } from "react"; import Select from "react-select"; @@ -72,14 +73,14 @@ function HideBrandingInput(props: { hideBrandingRef: RefObject

{t("remove_cal_branding_description")}

-

- {" "} - {t("to_upgrade_go_to")}{" "} - - cal.com/upgrade - - . + + You can + + upgrade here + + . +

diff --git a/pages/settings/teams.tsx b/pages/settings/teams.tsx index 1879dae7..b953ac31 100644 --- a/pages/settings/teams.tsx +++ b/pages/settings/teams.tsx @@ -1,6 +1,7 @@ import { PlusIcon } from "@heroicons/react/solid"; import classNames from "classnames"; import { useSession } from "next-auth/react"; +import { Trans } from "next-i18next"; import { useState } from "react"; import { useLocale } from "@lib/hooks/useLocale"; @@ -44,12 +45,13 @@ export default function Teams() { severity="warning" title={<>{t("plan_upgrade_teams")}} message={ - <> - {t("to_upgrade_go_to")}{" "} - - {"https://cal.com/upgrade"} + + You can + + upgrade here - + . + } className="my-4" /> diff --git a/public/static/locales/de/common.json b/public/static/locales/de/common.json index cbe02332..adbf41f8 100644 --- a/public/static/locales/de/common.json +++ b/public/static/locales/de/common.json @@ -450,7 +450,6 @@ "readonly": "Schreibgeschützt", "plan_upgrade": "Sie müssen Ihr Paket upgraden, um mehr als einen aktiven Ereignistyp zu haben.", "plan_upgrade_teams": "Du musst deinen Plan upgraden, um ein Team zu erstellen.", - "plan_upgrade_instructions": "Zum Upgrade, gehen Sie auf https://cal.com/upgrade", "event_types_page_title": "Ereignistypen", "event_types_page_subtitle": "Erstellen Sie teilbare Ereignisse, die andere Personen buchen können.", "new_event_type_btn": "Neuer Ereignistyp", @@ -484,7 +483,6 @@ "create_manage_teams_collaborative": "Erstellen und verwalten Sie Teams, um kollaborative Funktionen zu nutzen.", "only_available_on_pro_plan": "Diese Funktion ist nur im Pro Plan verfügbar", "remove_cal_branding_description": "Um die Cal Werbung von Ihren Buchungsseiten zu entfernen, müssen Sie auf ein Pro-Konto upgraden.", - "to_upgrade_go_to": "Zum Upgrade gehen Sie zu", "edit_profile_info_description": "Bearbeiten Sie Ihre Profilinformationen, welche bei Ihrem Cal-Link angezeigt werden.", "change_email_tip": "Möglicherweise müssen Sie sich aus- und einloggen, um die Änderung wirksam zu machen.", "little_something_about": "Ein wenig über sich selbst.", diff --git a/public/static/locales/en/common.json b/public/static/locales/en/common.json index 66ae463b..35be6fdb 100644 --- a/public/static/locales/en/common.json +++ b/public/static/locales/en/common.json @@ -451,9 +451,11 @@ "url": "URL", "hidden": "Hidden", "readonly": "Readonly", + "plan_description": "You're currently on the {{plan}} plan.", + "plan_upgrade_invitation": "Upgrade your account to the pro plan to unlock all of the features we have to offer.", "plan_upgrade": "You need to upgrade your plan to have more than one active event type.", "plan_upgrade_teams": "You need to upgrade your plan to create a team.", - "plan_upgrade_instructions": "To upgrade, go to https://cal.com/upgrade", + "plan_upgrade_instructions": "You can <1>upgrade here.", "event_types_page_title": "Event Types", "event_types_page_subtitle": "Create events to share for people to book on your calendar.", "new_event_type_btn": "New event type", @@ -487,7 +489,6 @@ "create_manage_teams_collaborative": "Create and manage teams to use collaborative features.", "only_available_on_pro_plan": "This feature is only available in Pro plan", "remove_cal_branding_description": "In order to remove the Cal branding from your booking pages, you need to upgrade to a Pro account.", - "to_upgrade_go_to": "To upgrade go to", "edit_profile_info_description": "Edit your profile information, which shows on your scheduling link.", "change_email_tip": "You may need to log out and back in to see the change take effect.", "little_something_about": "A little something about yourself.", diff --git a/public/static/locales/es/common.json b/public/static/locales/es/common.json index 39c630c5..ae3bcf78 100644 --- a/public/static/locales/es/common.json +++ b/public/static/locales/es/common.json @@ -446,7 +446,6 @@ "readonly": "Sólo Lectura", "plan_upgrade": "Necesitas actualizar tu plan para tener más de un tipo de evento activo.", "plan_upgrade_teams": "Necesita actualizar su plan para crear un equipo.", - "plan_upgrade_instructions": "Para actualizar, dirígete a https://cal.com/upgrade", "event_types_page_title": "Tipos de Evento", "event_types_page_subtitle": "Crea eventos para que la gente que invites reserve en tu calendario.", "new_event_type_btn": "Nuevo Tipo de Evento", @@ -480,7 +479,6 @@ "create_manage_teams_collaborative": "Cree y gestiona equipos para utilizar las funciones colaborativas.", "only_available_on_pro_plan": "Esta función solo está disponible en el plan Pro", "remove_cal_branding_description": "Para eliminar la marca Cal de sus páginas de reserva, debe actualizar a una cuenta Pro.", - "to_upgrade_go_to": "Para actualizar vaya a", "edit_profile_info_description": "Edite la información de su perfil, que se muestra en su enlace de programación.", "little_something_about": "Algo sobre ti.", "profile_updated_successfully": "Perfil Actualizado con Éxito", diff --git a/public/static/locales/fr/common.json b/public/static/locales/fr/common.json index 4e4eaf01..812bc278 100644 --- a/public/static/locales/fr/common.json +++ b/public/static/locales/fr/common.json @@ -414,7 +414,6 @@ "hidden": "Caché", "readonly": "Lire seulement", "plan_upgrade": "Vous devez mettre à niveau votre plan pour avoir plus d'un type d'événement actif.", - "plan_upgrade_instructions": "Pour mettre à niveau, allez sur https://cal.com/upgrade", "event_types_page_title": "Types d’événement", "event_types_page_subtitle": "Créez des événements à partager pour que les gens puissent les réserver sur votre calendrier.", "new_event_type_btn": "Nouveau type d'événement", @@ -448,7 +447,6 @@ "create_manage_teams_collaborative": "Créer et gérer des équipes pour utiliser les fonctionnalités de collaboration.", "only_available_on_pro_plan": "Cette fonctionnalité n'est disponible que dans l'offre Pro", "remove_cal_branding_description": "Pour retirer l'image de marque de Cal de vos pages de réservation, vous devez passer à un compte Pro.", - "to_upgrade_go_to": "Pour mettre à niveau, allez à", "edit_profile_info_description": "Modifiez les informations de votre profil, qui apparaissent sur votre lien de réservation.", "little_something_about": "Quelque chose à propos de vous.", "profile_updated_successfully": "Profil mis à jour avec succès", diff --git a/public/static/locales/it/common.json b/public/static/locales/it/common.json index 946296f1..67347057 100644 --- a/public/static/locales/it/common.json +++ b/public/static/locales/it/common.json @@ -440,7 +440,6 @@ "readonly": "Sola lettura", "plan_upgrade": "È necessario aggiornare il piano per avere più di un tipo di evento attivo.", "plan_upgrade_teams": "Devi aggiornare il tuo piano per creare un team.", - "plan_upgrade_instructions": "Per aggiornare, vai su https://cal.com/upgrade", "event_types_page_title": "Tipo di Evento", "event_types_page_subtitle": "Crea eventi da condividere per le persone che prenotano sul tuo calendario.", "new_event_type_btn": "Nuovo tipo di evento", @@ -474,7 +473,6 @@ "create_manage_teams_collaborative": "Crea e gestisci team per utilizzare funzionalità di collaborazione.", "only_available_on_pro_plan": "Questa funzione è disponibile solo nel piano Pro", "remove_cal_branding_description": "Al fine di rimuovere il marchio Cal dalle pagine di prenotazione, è necessario acquistare un account Pro.", - "to_upgrade_go_to": "Per aggiornare vai a", "edit_profile_info_description": "Modifica le informazioni del tuo profilo, che verranno visualizzate sul tuo link di pianificazione.", "little_something_about": "Qualcosa su di te.", "profile_updated_successfully": "Profilo aggiornato con successo", diff --git a/public/static/locales/ja/common.json b/public/static/locales/ja/common.json index cc27634f..ef2d5eda 100644 --- a/public/static/locales/ja/common.json +++ b/public/static/locales/ja/common.json @@ -413,7 +413,6 @@ "hidden": "隠れている", "readonly": "読み込み専用", "plan_upgrade": "複数の有効なイベントタイプを持つには、プランをアップグレードする必要があります。", - "plan_upgrade_instructions": "アップグレードするには、 https://cal.com/upgrade に進んでください。", "event_types_page_title": "イベント種別", "event_types_page_subtitle": "人々があなたのカレンダーを予約するために共有するイベントを作成します。", "new_event_type_btn": "新しいイベントの種類", @@ -446,7 +445,6 @@ "create_manage_teams_collaborative": "共同作業機能を使用するチームを作成および管理します。", "only_available_on_pro_plan": "この機能はProプランでのみ利用できます。", "remove_cal_branding_description": "予約ページからカルブランディングを削除するには、Proアカウントにアップグレードする必要があります。", - "to_upgrade_go_to": "アップグレードするには", "edit_profile_info_description": "スケジューリングリンクに表示されるプロフィール情報を編集します。", "little_something_about": "あなた自身につい何か少し。", "profile_updated_successfully": "プロフィールが正常に更新されました", diff --git a/public/static/locales/ko/common.json b/public/static/locales/ko/common.json index c66128eb..bfc3c572 100644 --- a/public/static/locales/ko/common.json +++ b/public/static/locales/ko/common.json @@ -435,7 +435,6 @@ "readonly": "읽기 전용", "plan_upgrade": "활성 이벤트 타입이 두 개 이상 있도록 요금제를 업그레이드해야 합니다.", "plan_upgrade_teams": "팀을 만들려면 요금제를 업그레이드해야 합니다.", - "plan_upgrade_instructions": "업그레이드하려면 https://cal.com/upgrade로 이동하십시오.", "event_types_page_title": "이벤트 타입", "event_types_page_subtitle": "사람들이 캘린더에서 예약할 수 있도록 공유할 이벤트를 만드세요.", "new_event_type_btn": "새 이벤트 타입", @@ -469,7 +468,6 @@ "create_manage_teams_collaborative": "협업 기능을 사용할 팀을 만들고 관리합니다.", "only_available_on_pro_plan": "이 기능은 Pro 요금제에서만 사용할 수 있습니다.", "remove_cal_branding_description": "예약 페이지에서 Cal 브랜드를 제거하려면 Pro 계정으로 업그레이드해야 합니다.", - "to_upgrade_go_to": "업그레이드하려면 다음으로 이동하십시오.", "edit_profile_info_description": "일정 링크에 표시되는 프로필 정보를 수정합니다.", "little_something_about": "자신에 대해 조금 알려주세요.", "profile_updated_successfully": "프로필이 업데이트되었습니다.", diff --git a/public/static/locales/nl/common.json b/public/static/locales/nl/common.json index 207f8718..29b4b3d6 100644 --- a/public/static/locales/nl/common.json +++ b/public/static/locales/nl/common.json @@ -406,7 +406,6 @@ "hidden": "Verborgen", "readonly": "Enkel-lezen", "plan_upgrade": "U moet uw abonnement upgraden om meer dan één actief afspraaktype te hebben.", - "plan_upgrade_instructions": "Om te upgraden, ga naar https://cal.com/upgrade", "event_types_page_title": "Evenementen", "event_types_page_subtitle": "Maak deelbare evenementen die bezoekers kunnen gebruiken om afspraken in uw agenda te boeken.", "new_event_type_btn": "Nieuw evenement", @@ -439,7 +438,6 @@ "create_manage_teams_collaborative": "Maak en beheer teams om gezamenlijke functies te gebruiken.", "only_available_on_pro_plan": "Deze functie is alleen beschikbaar in het Pro-pakket", "remove_cal_branding_description": "Om de Cal branding van uw boekpagina's te verwijderen, moet u upgraden naar een Pro-account.", - "to_upgrade_go_to": "Ga voor upgraden naar", "edit_profile_info_description": "Bewerk profielgegevens die worden weergegeven op uw boekpagina.", "little_something_about": "Een introductie over uzelf.", "profile_updated_successfully": "Profiel bijgewerkt", diff --git a/public/static/locales/pl/common.json b/public/static/locales/pl/common.json index 3b35b41a..0f07e7d9 100644 --- a/public/static/locales/pl/common.json +++ b/public/static/locales/pl/common.json @@ -450,7 +450,6 @@ "readonly": "Tylko do odczytu", "plan_upgrade": "Musisz ulepszyć swój plan, aby mieć więcej niż jeden aktywny typ zdarzeń.", "plan_upgrade_teams": "Musisz ulepszyć swój plan, aby utworzyć drużynę.", - "plan_upgrade_instructions": "Aby zaktualizować, przejdź do https://cal.com/upgrade", "event_types_page_title": "Typy wydarzeń", "event_types_page_subtitle": "Twórz wydarzenia, aby udostępnić ludziom możliwość rezerwacji w Twoim kalendarzu.", "new_event_type_btn": "Nowy typ wydarzenia", @@ -484,7 +483,6 @@ "create_manage_teams_collaborative": "Tworzenie drużyn i zarządzanie nimi, aby korzystać z funkcji współpracy.", "only_available_on_pro_plan": "Ta funkcja jest dostępna tylko w planie Pro", "remove_cal_branding_description": "Aby usunąć markę Cal ze stron rezerwacji, musisz zaktualizować do konta Pro.", - "to_upgrade_go_to": "Aby ulepszyć przejdź do", "edit_profile_info_description": "Edytuj dane swojego profilu, które pokazują się na linku do planowania.", "change_email_tip": "Może być konieczne wylogowanie się i ponownie, aby zobaczyć efekt wprowadzania zmian.", "little_something_about": "Trochę o sobie.", diff --git a/public/static/locales/pt-BR/common.json b/public/static/locales/pt-BR/common.json index 0df0cf99..d5cc0aad 100644 --- a/public/static/locales/pt-BR/common.json +++ b/public/static/locales/pt-BR/common.json @@ -450,7 +450,6 @@ "readonly": "Somente leitura", "plan_upgrade": "Você precisa fazer um upgrade do seu plano para ter mais de um tipo de evento ativo.", "plan_upgrade_teams": "Você precisa fazer upgrade do seu plano para criar um time.", - "plan_upgrade_instructions": "Para atualizar, acesse https://cal.com/upgrade", "event_types_page_title": "Tipos de Eventos", "event_types_page_subtitle": "Crie eventos para que as pessoas possam fazer agendamentos em seu calendário.", "new_event_type_btn": "Novo tipo de evento", @@ -484,7 +483,6 @@ "create_manage_teams_collaborative": "Criar e gerenciar times para usar recursos de colaboração.", "only_available_on_pro_plan": "Este recurso só está disponível no plano Pro", "remove_cal_branding_description": "Para remover a marca Cal das suas páginas de reservas, você precisar fazer o upgrade para uma conta Pro.", - "to_upgrade_go_to": "Para fazer upgrade, vá para", "edit_profile_info_description": "Edite as informações do seu perfil, que aparecem na sua página de reservas.", "change_email_tip": "Você precisa sair e entrar novamente para as alterações surtirem efeito.", "little_something_about": "Fale um pouco mais sobre você.", diff --git a/public/static/locales/pt/common.json b/public/static/locales/pt/common.json index 6e3334ea..8fb247b3 100644 --- a/public/static/locales/pt/common.json +++ b/public/static/locales/pt/common.json @@ -450,7 +450,6 @@ "readonly": "Somente Leitura", "plan_upgrade": "Tem de atualizar o seu plano para ter mais de um tipo de evento ativo.", "plan_upgrade_teams": "Tem de actualizar o seu plano para poder criar uma equipa.", - "plan_upgrade_instructions": "Para atualizar, aceda a https://cal.com/upgrade", "event_types_page_title": "Tipos de evento", "event_types_page_subtitle": "Crie eventos para partilhar, para que as pessoas façam reservas no seu calendário.", "new_event_type_btn": "Novo tipo de evento", @@ -484,7 +483,6 @@ "create_manage_teams_collaborative": "Criar e gerir equipas para usar recursos colaborativos.", "only_available_on_pro_plan": "Este recurso só está disponível no plano Pro", "remove_cal_branding_description": "Para remover a marca Cal das suas páginas de reservas, tem de atualizar para uma conta Pro.", - "to_upgrade_go_to": "Para atualizar, aceda a", "edit_profile_info_description": "Edite as informações do seu perfil, que mostram a sua ligação de agendamento.", "change_email_tip": "Poderá ter de terminar sessão e voltar a iniciar para a alteração ter efeito.", "little_something_about": "Um pouco sobre si.", diff --git a/public/static/locales/ro/common.json b/public/static/locales/ro/common.json index fda5bbbe..3895cfaf 100644 --- a/public/static/locales/ro/common.json +++ b/public/static/locales/ro/common.json @@ -413,7 +413,6 @@ "hidden": "Ascuns", "readonly": "Needitabil", "plan_upgrade": "Trebuie actualizat planul pentru a avea mai mult de un tip de eveniment activ.", - "plan_upgrade_instructions": "Pentru upgrade, accesați https://cal.com/upgrade", "event_types_page_title": "Tipuri de evenimente", "event_types_page_subtitle": "Creează evenimente de împărtășire pentru oameni să facă rezervări pe calendarul tău.", "new_event_type_btn": "Nou tip de eveniment", @@ -446,7 +445,6 @@ "create_manage_teams_collaborative": "Creați și gestionați echipe pentru a utiliza funcții colaborative.", "only_available_on_pro_plan": "Această caracteristică este disponibilă doar în planul Pro", "remove_cal_branding_description": "Pentru a elimina branding Cal din paginile dvs. de rezervare, trebuie să faceți upgrade la un cont Pro.", - "to_upgrade_go_to": "Pentru a face upgrade mergi la", "edit_profile_info_description": "Editați informațiile de profil, care sunt afișate pe link-ul dvs. de programare.", "little_something_about": "Un pic despre tine.", "profile_updated_successfully": "Profil actualizat cu succes", diff --git a/public/static/locales/ru/common.json b/public/static/locales/ru/common.json index 00be99be..f57868d4 100644 --- a/public/static/locales/ru/common.json +++ b/public/static/locales/ru/common.json @@ -450,7 +450,6 @@ "readonly": "Только для чтения", "plan_upgrade": "Необходимо обновить тарифный план, чтобы иметь более одного активного типа события.", "plan_upgrade_teams": "Вам нужно обновить тарифный план для создания команды.", - "plan_upgrade_instructions": "Для повышения перейдите на https://cal.com/upgrade", "event_types_page_title": "Типы мероприятий", "event_types_page_subtitle": "Создайте мероприятие, чтобы поделиться с людьми для бронирования в вашем календаре.", "new_event_type_btn": "Новый тип мероприятия", @@ -484,7 +483,6 @@ "create_manage_teams_collaborative": "Создавайте и управляйте командами для использования совместных функций.", "only_available_on_pro_plan": "Эта функция доступна только в Pro тарифе", "remove_cal_branding_description": "Чтобы удалить брендинг Cal со страниц бронирования, необходимо перейти на Pro аккаунт.", - "to_upgrade_go_to": "Для обновления перейдите на", "edit_profile_info_description": "Отредактируйте информацию своего профиля, она будет отображаться на вашей публичной странице.", "change_email_tip": "Вам может потребоваться выйти из системы, чтобы изменения вступили в силу.", "little_something_about": "Немного о вас.", diff --git a/public/static/locales/zh-CN/common.json b/public/static/locales/zh-CN/common.json index 828e79ad..6578eda6 100644 --- a/public/static/locales/zh-CN/common.json +++ b/public/static/locales/zh-CN/common.json @@ -352,7 +352,6 @@ "readonly": "只读", "plan_upgrade": "您需要升级您的套餐才能有多个事件类型.", "plan_upgrade_teams": "您需要升级您的套餐才能创建一个团队。", - "plan_upgrade_instructions": "升级请访问 https://cal.com/upgrade", "event_types_page_title": "事件类型", "event_types_page_subtitle": "创建事件,让人们在您的日历上预约。", "new_event_type_btn": "新事件类型",