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.
caelum0x 64fbe9f474 feat: round-3 deep product build-out (69 gaps closed, all 7 products green)
Deep-audit + build-out across all products to fully-usable state; all typecheck clean.

- gitgram-web (99): wire Store feature to real endpoints, close 9 gaps
- gitgram-backend (100): close 8 flow gaps, document infra-provisioning items
- gitgram-mobile (90): fix API base-URL/path mismatch (404s) + copy proximity
  components into components/proximity wired to real screens; 15 gaps, +react-native-svg
- aitm-core (95): wire natural-language CLI flow end-to-end; 11 gaps
- aitm-api (97): fix teams metadata runtime bug; copy a2a-js server/client/grpc
  into src/a2a and wire A2A route; crates.io package search; 8 gaps
- aitm-mcp (100): fix A2A client/server card mismatch; 9 gaps
- aitm-website (95): build missing docs routes; 9 gaps

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 13:54:57 +03:00

189 lines
4.1 KiB
TypeScript

import React from 'react';
import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { useRouter } from 'expo-router';
const LANGUAGE_COLORS: Record<string, string> = {
TypeScript: '#3178C6',
JavaScript: '#F7DF1E',
Python: '#3776AB',
Go: '#00ADD8',
Rust: '#DEA584',
Java: '#B07219',
'C++': '#F34B7D',
C: '#555555',
Ruby: '#CC342D',
Swift: '#F05138',
Kotlin: '#A97BFF',
PHP: '#777BB4',
Shell: '#89E051',
Dart: '#00B4AB',
};
interface TrendingRepoProps {
repo: {
fullName: string;
description?: string;
language?: string;
stars: number;
forks: number;
htmlUrl: string;
};
}
function formatCount(n: number): string {
if (n >= 1_000) return `${(n / 1_000).toFixed(1)}k`;
return String(n);
}
export default function TrendingRepoCard({ repo }: TrendingRepoProps) {
const router = useRouter();
const slashIdx = repo.fullName.indexOf('/');
const owner = slashIdx >= 0 ? repo.fullName.slice(0, slashIdx) : repo.fullName;
const name = slashIdx >= 0 ? repo.fullName.slice(slashIdx + 1) : '';
const langColor = repo.language
? (LANGUAGE_COLORS[repo.language] ?? '#8B949E')
: undefined;
const handlePress = () => {
router.push(`/repo/${owner}/${name}`);
};
return (
<TouchableOpacity
style={styles.container}
onPress={handlePress}
activeOpacity={0.85}
>
<View style={styles.header}>
<View style={styles.repoIcon}>
<Text style={styles.repoIconText}>📦</Text>
</View>
<View style={styles.nameBlock}>
<Text style={styles.ownerText} numberOfLines={1}>
{owner}
<Text style={styles.slash}>/</Text>
<Text style={styles.repoName}>{name}</Text>
</Text>
</View>
</View>
{repo.description ? (
<Text style={styles.description} numberOfLines={2}>
{repo.description}
</Text>
) : (
<Text style={styles.descriptionEmpty} numberOfLines={1}>
No description provided
</Text>
)}
<View style={styles.meta}>
{repo.language && langColor && (
<View style={styles.langBadge}>
<View style={[styles.langDot, { backgroundColor: langColor }]} />
<Text style={styles.langText}>{repo.language}</Text>
</View>
)}
<View style={styles.statBadge}>
<Text style={styles.statIcon}>⭐</Text>
<Text style={styles.statText}>{formatCount(repo.stars)}</Text>
</View>
<View style={styles.statBadge}>
<Text style={styles.statIcon}>🍴</Text>
<Text style={styles.statText}>{formatCount(repo.forks)}</Text>
</View>
</View>
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
container: {
backgroundColor: '#16213E',
borderRadius: 14,
padding: 14,
marginHorizontal: 16,
marginVertical: 6,
borderWidth: 1,
borderColor: '#0F3460',
},
header: {
flexDirection: 'row',
alignItems: 'center',
marginBottom: 8,
},
repoIcon: {
width: 36,
height: 36,
borderRadius: 8,
backgroundColor: '#0F3460',
alignItems: 'center',
justifyContent: 'center',
marginRight: 10,
},
repoIconText: {
fontSize: 18,
},
nameBlock: {
flex: 1,
},
ownerText: {
color: '#94A3B8',
fontSize: 14,
fontWeight: '500',
},
slash: {
color: '#475569',
},
repoName: {
color: '#E2E8F0',
fontWeight: '700',
fontSize: 14,
},
description: {
color: '#94A3B8',
fontSize: 13,
lineHeight: 19,
marginBottom: 12,
},
descriptionEmpty: {
color: '#475569',
fontSize: 13,
fontStyle: 'italic',
marginBottom: 12,
},
meta: {
flexDirection: 'row',
alignItems: 'center',
gap: 12,
},
langBadge: {
flexDirection: 'row',
alignItems: 'center',
gap: 5,
},
langDot: {
width: 10,
height: 10,
borderRadius: 5,
},
langText: {
color: '#94A3B8',
fontSize: 12,
},
statBadge: {
flexDirection: 'row',
alignItems: 'center',
gap: 4,
},
statIcon: {
fontSize: 12,
},
statText: {
color: '#94A3B8',
fontSize: 12,
},
});