Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/components/bottomModalAlert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,12 @@
// the button component cannot have both href and on:click!
function triggerWindowLink(alert: BottomModalAlertItem, event?: string) {
const alertAction = alert.cta;
const shouldShowUpgrade = canUpgrade($organization?.billingPlanDetails);
const shouldShowUpgrade =
!alertAction.skipUpgradeRedirect && canUpgrade($organization?.billingPlanDetails);

// for correct event tracking after removal
const currentModalId = currentModalAlert.id;
const organizationId = $project.teamId ?? $organization.$id;
const organizationId = $project?.teamId ?? $organization?.$id;

const url = shouldShowUpgrade
? getChangePlanUrl(organizationId)
Expand Down
Binary file added src/lib/images/promos/claude-code-plugin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/lib/stores/bottom-alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type BottomModalAlertAction = {
hideOnClick?: boolean;
link: (ctx: { organization: Models.Organization; project: Models.Project }) => string;
external?: boolean;
skipUpgradeRedirect?: boolean;
};

/**
Expand Down
33 changes: 32 additions & 1 deletion src/routes/(console)/bottomAlerts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
import { isCloud } from '$lib/system';
import { isSameDay } from '$lib/helpers/date';
import { type BottomModalAlertItem, showBottomModalAlert } from '$lib/stores/bottom-alerts';
import ClaudeCodePlugin from '$lib/images/promos/claude-code-plugin.png';

export function addBottomModalAlerts() {}
const listOfPromotions: BottomModalAlertItem[] = [];

if (isCloud) {
const claudePluginPromo: BottomModalAlertItem = {
id: 'modal:claude_plugin_announcement',
src: {
dark: ClaudeCodePlugin,
light: ClaudeCodePlugin
},
title: 'Announcing the Appwrite Claude plugin',
message: 'Build, manage, and ship Appwrite projects without leaving Claude Code.',
plan: 'free',
importance: 8,
scope: 'everywhere',
cta: {
text: 'Read announcement',
link: () => 'https://appwrite.io/blog/post/announcing-appwrite-claude-code-plugin',
external: true,
hideOnClick: true,
skipUpgradeRedirect: true
},
show: true
};
listOfPromotions.push(claudePluginPromo);
}

export function addBottomModalAlerts() {
listOfPromotions.forEach((promotion) => showBottomModalAlert(promotion));
}

// use this for time based promo handling
// noinspection JSUnusedGlobalSymbols
Expand Down
Loading