-
Notifications
You must be signed in to change notification settings - Fork 963
feat(paywall): add visual demos and polish billing UI #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2f49498
WIP
saddlepaddle 67aa55f
WIP
saddlepaddle 85a8cba
WIP
saddlepaddle 39c265b
feat(paywall): add visual demos and polish billing UI
saddlepaddle 1d416b7
WIP
saddlepaddle 846225a
feat(paywall): add PostHog tracking for paywall events
saddlepaddle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
apps/desktop/src/renderer/components/Paywall/components/FeaturePreview/FeaturePreview.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { Badge } from "@superset/ui/badge"; | ||
| import { MeshGradient } from "@superset/ui/mesh-gradient"; | ||
| import { cn } from "@superset/ui/utils"; | ||
| import type { ComponentType } from "react"; | ||
| import type { ProFeature } from "../../constants"; | ||
| import { PRO_FEATURES } from "../../constants"; | ||
| import { CloudWorkspacesDemo } from "./components/CloudWorkspacesDemo"; | ||
| import { IntegrationsDemo } from "./components/IntegrationsDemo"; | ||
| import { MobileAppDemo } from "./components/MobileAppDemo"; | ||
| import { TasksDemo } from "./components/TasksDemo"; | ||
| import { TeamCollaborationDemo } from "./components/TeamCollaborationDemo"; | ||
|
|
||
| const DEMO_COMPONENTS: Record<string, ComponentType> = { | ||
| "team-collaboration": TeamCollaborationDemo, | ||
| integrations: IntegrationsDemo, | ||
| tasks: TasksDemo, | ||
| "cloud-workspaces": CloudWorkspacesDemo, | ||
| "mobile-app": MobileAppDemo, | ||
| }; | ||
|
|
||
| interface FeaturePreviewProps { | ||
| selectedFeature: ProFeature; | ||
| } | ||
|
|
||
| export function FeaturePreview({ selectedFeature }: FeaturePreviewProps) { | ||
| const DemoComponent = DEMO_COMPONENTS[selectedFeature.id]; | ||
|
|
||
| return ( | ||
| <div className="flex w-[495px] flex-col"> | ||
| <div className="relative h-[346px] overflow-hidden"> | ||
| {PRO_FEATURES.map((proFeature) => ( | ||
| <div | ||
| key={`gradient-${proFeature.id}`} | ||
| className={cn( | ||
| "absolute inset-0 transition-opacity duration-1000 ease-in-out", | ||
| selectedFeature.id === proFeature.id | ||
| ? "opacity-100" | ||
| : "opacity-0", | ||
| )} | ||
| > | ||
| <MeshGradient | ||
| colors={proFeature.gradientColors} | ||
| className="absolute inset-0 w-full h-full" | ||
| /> | ||
| </div> | ||
| ))} | ||
|
|
||
| <div className="absolute inset-0 flex items-center justify-center"> | ||
| {DemoComponent ? <DemoComponent /> : null} | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className="flex w-full flex-col border-t bg-background px-6 py-4 items-center justify-center"> | ||
| <div className="mb-2 flex w-full items-center justify-center gap-2"> | ||
| <span className="text-lg font-semibold text-foreground"> | ||
| {selectedFeature.title} | ||
| </span> | ||
| <Badge variant="default">PRO</Badge> | ||
| {selectedFeature.comingSoon && ( | ||
| <Badge variant="secondary" className="text-[10px]"> | ||
| Coming Soon | ||
| </Badge> | ||
| )} | ||
| </div> | ||
| <span className="text-center text-sm font-normal text-muted-foreground"> | ||
| {selectedFeature.description} | ||
| </span> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
85 changes: 85 additions & 0 deletions
85
.../Paywall/components/FeaturePreview/components/CloudWorkspacesDemo/CloudWorkspacesDemo.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| import { | ||
| HiArrowPath, | ||
| HiCloud, | ||
| HiComputerDesktop, | ||
| HiDeviceTablet, | ||
| } from "react-icons/hi2"; | ||
|
|
||
| const WORKSPACES = [ | ||
| { id: "1", name: "superset-app", branch: "main", synced: true }, | ||
| { id: "2", name: "api-server", branch: "feature/auth", synced: true }, | ||
| { id: "3", name: "mobile-app", branch: "dev", synced: false }, | ||
| ]; | ||
|
|
||
| export function CloudWorkspacesDemo() { | ||
| return ( | ||
| <div className="w-full h-full flex items-center justify-center"> | ||
| <div className="w-[300px] bg-[#1a1a1a]/90 backdrop-blur-sm rounded-lg border border-white/10 shadow-2xl overflow-hidden"> | ||
| {/* Header */} | ||
| <div className="flex items-center justify-between px-4 py-3 bg-[#2a2a2a]/80 border-b border-white/5"> | ||
| <div className="flex items-center gap-2"> | ||
| <div className="flex gap-1.5"> | ||
| <div className="w-2.5 h-2.5 rounded-full bg-[#ff5f57]" /> | ||
| <div className="w-2.5 h-2.5 rounded-full bg-[#febc2e]" /> | ||
| <div className="w-2.5 h-2.5 rounded-full bg-[#28c840]" /> | ||
| </div> | ||
| <span className="text-xs text-white/60 ml-1">Cloud</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Cloud sync visual */} | ||
| <div className="p-4"> | ||
| <div className="flex items-center justify-center gap-3 mb-4 py-3"> | ||
| <div className="flex flex-col items-center gap-1"> | ||
| <HiComputerDesktop className="w-6 h-6 text-white/50" /> | ||
| <span className="text-[9px] text-white/40">Desktop</span> | ||
| </div> | ||
| <div className="flex flex-col items-center"> | ||
| <div className="flex items-center gap-1"> | ||
| <div className="w-4 h-px bg-white/20" /> | ||
| <HiArrowPath className="w-3 h-3 text-white/30" /> | ||
| <div className="w-4 h-px bg-white/20" /> | ||
| </div> | ||
| </div> | ||
| <div className="flex flex-col items-center gap-1"> | ||
| <div className="w-10 h-10 rounded-full bg-amber-500/20 flex items-center justify-center"> | ||
| <HiCloud className="w-5 h-5 text-amber-400" /> | ||
| </div> | ||
| <span className="text-[9px] text-white/40">Cloud</span> | ||
| </div> | ||
| <div className="flex flex-col items-center"> | ||
| <div className="flex items-center gap-1"> | ||
| <div className="w-4 h-px bg-white/20" /> | ||
| <HiArrowPath className="w-3 h-3 text-white/30" /> | ||
| <div className="w-4 h-px bg-white/20" /> | ||
| </div> | ||
| </div> | ||
| <div className="flex flex-col items-center gap-1"> | ||
| <HiDeviceTablet className="w-6 h-6 text-white/50" /> | ||
| <span className="text-[9px] text-white/40">Tablet</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Synced workspaces */} | ||
| <div className="text-[10px] uppercase text-white/40 font-medium tracking-wider mb-2"> | ||
| Synced Workspaces | ||
| </div> | ||
| <div className="space-y-1.5"> | ||
| {WORKSPACES.map((ws) => ( | ||
| <div | ||
| key={ws.id} | ||
| className="flex items-center gap-2 px-2 py-1.5 rounded bg-white/5 text-xs" | ||
| > | ||
| <div | ||
| className={`w-1.5 h-1.5 rounded-full ${ws.synced ? "bg-emerald-400" : "bg-amber-400"}`} | ||
| /> | ||
| <span className="text-white/70 truncate flex-1">{ws.name}</span> | ||
| <span className="text-white/30 text-[10px]">{ws.branch}</span> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
1 change: 1 addition & 0 deletions
1
...erer/components/Paywall/components/FeaturePreview/components/CloudWorkspacesDemo/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { CloudWorkspacesDemo } from "./CloudWorkspacesDemo"; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add
contextto PostHog payloads to meet analytics requirements.PaywallOptions.contextis defined but never sent. If the intent is to capture feature context, it should be included in all paywall events.✅ Example change (apply to all captures)
posthog.capture("paywall_opened", { trigger_source: paywallOptions.feature, feature_id: initialFeatureId, feature_title: feature?.title, + context: paywallOptions.context, });Also applies to: 75-80, 91-96, 112-118
🤖 Prompt for AI Agents