Skip to content

Commit ae73c99

Browse files
committed
chore: remove patron page
1 parent 2058e87 commit ae73c99

File tree

27 files changed

+23
-1129
lines changed

27 files changed

+23
-1129
lines changed

packages/app/src/app/overmind/internalActions.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
TabType,
88
} from '@codesandbox/common/lib/types';
99
import history from 'app/utils/history';
10-
import { patronUrl } from '@codesandbox/common/lib/utils/url-generator';
1110
import { NotificationMessage } from '@codesandbox/notifications/lib/state';
1211
import { NotificationStatus } from '@codesandbox/notifications';
1312
import { hasPermission } from '@codesandbox/common/lib/utils/permission';
@@ -492,32 +491,6 @@ export const handleError = (
492491
state.signInModalOpen = true;
493492
},
494493
};
495-
} else if (error.message.startsWith('You reached the maximum of')) {
496-
effects.analytics.track('Non-Patron Sandbox Limit Reached', {
497-
errorMessage: error.message,
498-
});
499-
500-
notificationActions.primary = {
501-
label: 'Open Patron Page',
502-
run: () => {
503-
window.open(patronUrl(), '_blank');
504-
},
505-
};
506-
} else if (
507-
error.message.startsWith(
508-
'You reached the limit of server sandboxes, you can create more server sandboxes as a patron.'
509-
)
510-
) {
511-
effects.analytics.track('Non-Patron Server Sandbox Limit Reached', {
512-
errorMessage: error.message,
513-
});
514-
515-
notificationActions.primary = {
516-
label: 'Open Patron Page',
517-
run: () => {
518-
window.open(patronUrl(), '_blank');
519-
},
520-
};
521494
} else if (
522495
error.message.startsWith(
523496
'You reached the limit of server sandboxes, we will increase the limit in the future. Please contact support@codesandbox.io for more server sandboxes.'

packages/app/src/app/overmind/namespaces/patron/actions.ts

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,100 +1,6 @@
11
import { Context } from 'app/overmind';
2-
import { withLoadApp } from 'app/overmind/factories';
3-
import { StripeErrorCode } from '@codesandbox/common/lib/types';
42
import { NotificationStatus } from '@codesandbox/notifications';
53

6-
export const patronMounted = withLoadApp();
7-
8-
export const priceChanged = (
9-
{ state }: Context,
10-
{ price }: { price: number }
11-
) => {
12-
state.patron.price = price;
13-
};
14-
15-
export const createSubscriptionClicked = async (
16-
{ state, effects, actions }: Context,
17-
{
18-
token,
19-
coupon,
20-
duration,
21-
}: {
22-
token: string;
23-
coupon: string;
24-
duration: 'yearly' | 'monthly';
25-
}
26-
) => {
27-
effects.analytics.track('Create Patron Subscription', { duration });
28-
state.patron.error = null;
29-
state.patron.isUpdatingSubscription = true;
30-
try {
31-
state.user = await effects.api.createPatronSubscription(
32-
token,
33-
state.patron.price,
34-
duration,
35-
coupon
36-
);
37-
effects.notificationToast.success('Thank you very much for your support!');
38-
} catch (error) {
39-
if (
40-
error.error_code &&
41-
error.error_code === StripeErrorCode.REQUIRES_ACTION
42-
) {
43-
try {
44-
await effects.stripe.handleCardPayment(error.data.client_secret);
45-
state.user = await effects.api.getCurrentUser();
46-
state.patron.error = null;
47-
} catch (e) {
48-
actions.internal.handleError({
49-
message: 'Could not create subscription',
50-
error: e,
51-
});
52-
53-
state.patron.error = e.message;
54-
55-
effects.analytics.track('Create Subscription Error', {
56-
error: e.message,
57-
});
58-
}
59-
} else {
60-
actions.internal.handleError({
61-
message: 'Could not create subscription',
62-
error,
63-
});
64-
65-
state.patron.error = error.message;
66-
67-
effects.analytics.track('Create Subscription Error', {
68-
error: error.message,
69-
});
70-
}
71-
}
72-
state.patron.isUpdatingSubscription = false;
73-
};
74-
75-
export const updateSubscriptionClicked = async (
76-
{ state, effects }: Context,
77-
{
78-
coupon,
79-
}: {
80-
coupon: string;
81-
}
82-
) => {
83-
effects.analytics.track('Update Patron Subscription');
84-
state.patron.error = null;
85-
state.patron.isUpdatingSubscription = true;
86-
try {
87-
state.user = await effects.api.updatePatronSubscription(
88-
state.patron.price,
89-
coupon
90-
);
91-
effects.notificationToast.success('Subscription updated!');
92-
} catch (error) {
93-
state.patron.error = error.message;
94-
}
95-
state.patron.isUpdatingSubscription = false;
96-
};
97-
984
export const cancelSubscriptionClicked = async ({
995
state,
1006
effects,

packages/app/src/app/pages/Patron/PricingModal/Badge/Particles/elements.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

packages/app/src/app/pages/Patron/PricingModal/Badge/Particles/index.tsx

Lines changed: 0 additions & 98 deletions
This file was deleted.

packages/app/src/app/pages/Patron/PricingModal/Badge/animations.css

Lines changed: 0 additions & 88 deletions
This file was deleted.

packages/app/src/app/pages/Patron/PricingModal/Badge/elements.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)