Skip to content

Commit 95e6625

Browse files
Merge pull request #2989 from appwrite/promo/claude-plugin
2 parents 3fcf1d8 + 6625ae4 commit 95e6625

4 files changed

Lines changed: 36 additions & 3 deletions

File tree

src/lib/components/bottomModalAlert.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,12 @@
141141
// the button component cannot have both href and on:click!
142142
function triggerWindowLink(alert: BottomModalAlertItem, event?: string) {
143143
const alertAction = alert.cta;
144-
const shouldShowUpgrade = canUpgrade($organization?.billingPlanDetails);
144+
const shouldShowUpgrade =
145+
!alertAction.skipUpgradeRedirect && canUpgrade($organization?.billingPlanDetails);
145146
146147
// for correct event tracking after removal
147148
const currentModalId = currentModalAlert.id;
148-
const organizationId = $project.teamId ?? $organization.$id;
149+
const organizationId = $project?.teamId ?? $organization?.$id;
149150
150151
const url = shouldShowUpgrade
151152
? getChangePlanUrl(organizationId)
515 KB
Loading

src/lib/stores/bottom-alerts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export type BottomModalAlertAction = {
1111
hideOnClick?: boolean;
1212
link: (ctx: { organization: Models.Organization; project: Models.Project }) => string;
1313
external?: boolean;
14+
skipUpgradeRedirect?: boolean;
1415
};
1516

1617
/**

src/routes/(console)/bottomAlerts.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
1+
import { isCloud } from '$lib/system';
12
import { isSameDay } from '$lib/helpers/date';
3+
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
4+
import ClaudeCodePlugin from '$lib/images/promos/claude-code-plugin.png';
25

3-
export function addBottomModalAlerts() {}
6+
const listOfPromotions: BottomModalAlertItem[] = [];
7+
8+
if (isCloud) {
9+
const claudePluginPromo: BottomModalAlertItem = {
10+
id: 'modal:claude_plugin_announcement',
11+
src: {
12+
dark: ClaudeCodePlugin,
13+
light: ClaudeCodePlugin
14+
},
15+
title: 'Announcing the Appwrite Claude plugin',
16+
message: 'Build, manage, and ship Appwrite projects without leaving Claude Code.',
17+
plan: 'free',
18+
importance: 8,
19+
scope: 'everywhere',
20+
cta: {
21+
text: 'Read announcement',
22+
link: () => 'https://appwrite.io/blog/post/announcing-appwrite-claude-code-plugin',
23+
external: true,
24+
hideOnClick: true,
25+
skipUpgradeRedirect: true
26+
},
27+
show: true
28+
};
29+
listOfPromotions.push(claudePluginPromo);
30+
}
31+
32+
export function addBottomModalAlerts() {
33+
listOfPromotions.forEach((promotion) => showBottomModalAlert(promotion));
34+
}
435

536
// use this for time based promo handling
637
// noinspection JSUnusedGlobalSymbols

0 commit comments

Comments
 (0)