This repository has been archived on 2026-11-17. You can view files and clone it, but cannot push or open issues or pull requests.
gitgram-ai/gitgram/mobile/app/subscription.tsx
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

80 lines
3.2 KiB
TypeScript

import React, { useState, useEffect } from 'react';
import { View, Text, TouchableOpacity, ScrollView, ActivityIndicator } from 'react-native';
import { subscriptionService } from '../services/subscriptionService';
export default function SubscriptionScreen() {
const [subscription, setSubscription] = useState<any>(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
loadSubscription();
}, []);
const loadSubscription = async () => {
const data = await subscriptionService.getSubscription();
setSubscription(data);
setLoading(false);
};
const handleUpgrade = async (plan: string) => {
const { url } = await subscriptionService.createCheckout(plan);
// Open Polar checkout in browser
};
if (loading) return <ActivityIndicator />;
return (
<ScrollView className="flex-1 bg-white dark:bg-gray-900 p-4">
<Text className="text-3xl font-bold mb-6">Subscription</Text>
<View className="space-y-4">
<View className="border border-gray-200 rounded-lg p-4">
<Text className="text-xl font-bold mb-2">Free</Text>
<Text className="text-3xl font-bold mb-4">$0<Text className="text-sm">/mo</Text></Text>
<Text className="mb-2">✓ Basic features</Text>
<Text className="mb-2">✓ 100 posts/month</Text>
<Text className="mb-4">✓ 1GB storage</Text>
{subscription?.plan === 'free' && (
<View className="bg-gray-300 py-2 rounded items-center">
<Text>Current Plan</Text>
</View>
)}
</View>
<View className="border-2 border-blue-500 rounded-lg p-4">
<View className="bg-blue-500 px-2 py-1 rounded self-start mb-2">
<Text className="text-white text-xs">POPULAR</Text>
</View>
<Text className="text-xl font-bold mb-2">Premium</Text>
<Text className="text-3xl font-bold mb-4">$9<Text className="text-sm">/mo</Text></Text>
<Text className="mb-2">✓ Verified badge</Text>
<Text className="mb-2">✓ Custom themes</Text>
<Text className="mb-2">✓ Ad-free</Text>
<Text className="mb-4">✓ 10GB storage</Text>
<TouchableOpacity
onPress={() => handleUpgrade('premium')}
className="bg-blue-500 py-3 rounded items-center"
>
<Text className="text-white font-bold">Upgrade</Text>
</TouchableOpacity>
</View>
<View className="border border-gray-200 rounded-lg p-4">
<Text className="text-xl font-bold mb-2">Creator</Text>
<Text className="text-3xl font-bold mb-4">$29<Text className="text-sm">/mo</Text></Text>
<Text className="mb-2">✓ All Premium features</Text>
<Text className="mb-2">✓ Advanced analytics</Text>
<Text className="mb-2">✓ Content scheduling</Text>
<Text className="mb-4">✓ 100GB storage</Text>
<TouchableOpacity
onPress={() => handleUpgrade('creator')}
className="bg-blue-500 py-3 rounded items-center"
>
<Text className="text-white font-bold">Upgrade</Text>
</TouchableOpacity>
</View>
</View>
</ScrollView>
);
}