Fixed missing link on upgrade modals (#19237)

refs PROD-5
This commit is contained in:
Jono M 2023-12-05 14:59:49 +00:00 committed by GitHub
parent 40c486702c
commit 960fde80db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 5 deletions

View File

@ -20,7 +20,8 @@ const AddIntegrationModal: React.FC<RoutingModalProps> = () => {
limiter.errorIfWouldGoOverLimit('customIntegrations').catch((error) => {
if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more custom integrations.`
prompt: error.message || `Your current plan doesn't support more custom integrations.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
});
modal.remove();
updateRoute('integrations');

View File

@ -53,7 +53,8 @@ const AddNewsletterModal: React.FC<RoutingModalProps> = () => {
limiter?.errorIfWouldGoOverLimit('newsletters').catch((error) => {
if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more newsletters.`
prompt: error.message || `Your current plan doesn't support more newsletters.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
});
modal.remove();
updateRoute('newsletters');

View File

@ -102,6 +102,7 @@ const Sidebar: React.FC<{
errors: ErrorMessages;
clearError: (field: string) => void;
}> = ({newsletter, onlyOne, updateNewsletter, validate, errors, clearError}) => {
const {updateRoute} = useRouting();
const {mutateAsync: editNewsletter} = useEditNewsletter();
const limiter = useLimiter();
const {settings, siteData, config} = useGlobalData();
@ -159,7 +160,8 @@ const Sidebar: React.FC<{
} catch (error) {
if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, {
prompt: error.message || `Your current plan doesn't support more newsletters.`
prompt: error.message || `Your current plan doesn't support more newsletters.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
});
return;
} else {

View File

@ -157,7 +157,8 @@ const UserDetailModalContent: React.FC<{user: User}> = ({user}) => {
if (error instanceof HostLimitError) {
NiceModal.show(LimitModal, {
formSheet: true,
prompt: error.message || `Your current plan doesn't support more users.`
prompt: error.message || `Your current plan doesn't support more users.`,
onOk: () => updateRoute({route: '/pro', isExternal: true})
});
return;
} else {

View File

@ -221,7 +221,8 @@ const ThemeToolbar: React.FC<ThemeToolbarProps> = ({
} else {
NiceModal.show(LimitModal, {
title: 'Upgrade to enable custom themes',
prompt: uploadConfig?.error || <>Your current plan only supports official themes. You can install them from the <a href="https://ghost.org/marketplace/">Ghost theme marketplace</a>.</>
prompt: uploadConfig?.error || <>Your current plan only supports official themes. You can install them from the <a href="https://ghost.org/marketplace/">Ghost theme marketplace</a>.</>,
onOk: () => updateRoute({route: '/pro', isExternal: true})
});
}
};