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>
525 lines
24 KiB
TypeScript
525 lines
24 KiB
TypeScript
'use client'
|
|
|
|
import { useState, useEffect } from 'react'
|
|
import { motion } from 'framer-motion'
|
|
import Link from 'next/link'
|
|
import Navigation from '@/components/Navigation'
|
|
import CreatePost from '@/components/CreatePost'
|
|
import Feed from '@/components/Feed'
|
|
import LandingNavbar from '@/components/LandingNavbar'
|
|
import { useAuthStore } from '@/store/authStore'
|
|
|
|
const features = [
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4" />
|
|
<path d="M9 18c-4.51 2-5-2-7-2" />
|
|
</svg>
|
|
),
|
|
title: 'GitHub Integration',
|
|
description: 'Connect your GitHub account and share repositories, code snippets, and contributions as social posts.',
|
|
},
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" />
|
|
<circle cx="9" cy="7" r="4" />
|
|
<path d="M23 21v-2a4 4 0 0 0-3-3.87" />
|
|
<path d="M16 3.13a4 4 0 0 1 0 7.75" />
|
|
</svg>
|
|
),
|
|
title: 'Developer Community',
|
|
description: 'Follow developers, join conversations, and build meaningful connections with peers worldwide.',
|
|
},
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<polyline points="22 12 18 12 15 21 9 3 6 12 2 12" />
|
|
</svg>
|
|
),
|
|
title: 'Trending Projects',
|
|
description: 'Discover trending repositories and the hottest open-source projects in your technology stack.',
|
|
},
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
<line x1="3" y1="9" x2="21" y2="9" />
|
|
<line x1="9" y1="21" x2="9" y2="9" />
|
|
</svg>
|
|
),
|
|
title: 'Developer Portfolio',
|
|
description: 'Build a beautiful portfolio that showcases your projects, contributions, and coding journey.',
|
|
},
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
</svg>
|
|
),
|
|
title: 'Real-time Messaging',
|
|
description: 'Chat with developers in real time, share code blocks, and collaborate on ideas instantly.',
|
|
},
|
|
{
|
|
icon: (
|
|
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
<line x1="18" y1="20" x2="18" y2="10" />
|
|
<line x1="12" y1="20" x2="12" y2="4" />
|
|
<line x1="6" y1="20" x2="6" y2="14" />
|
|
</svg>
|
|
),
|
|
title: 'Analytics Dashboard',
|
|
description: 'Track your profile views, post engagement, and repository reach with detailed analytics.',
|
|
},
|
|
]
|
|
|
|
const stats = [
|
|
{ value: '10K+', label: 'Developers' },
|
|
{ value: '50K+', label: 'Posts Shared' },
|
|
{ value: '25K+', label: 'Repos Connected' },
|
|
{ value: '100+', label: 'Countries' },
|
|
]
|
|
|
|
const pricingPreview = [
|
|
{ name: 'Free', price: '$0', period: 'forever', features: ['Basic profile', 'Post updates', 'Follow developers', 'Basic analytics'], highlighted: false },
|
|
{ name: 'Premium', price: '$9.99', period: '/month', features: ['Verified badge', 'Advanced analytics', 'Custom themes', 'Priority support'], highlighted: true },
|
|
{ name: 'Creator', price: '$19.99', period: '/month', features: ['Gold badge', 'Monetization', 'API access', 'Custom domain'], highlighted: false },
|
|
]
|
|
|
|
function LandingPage() {
|
|
return (
|
|
<div className="min-h-screen bg-background overflow-hidden">
|
|
<LandingNavbar />
|
|
|
|
{/* Animated Background */}
|
|
<div className="fixed inset-0 pointer-events-none">
|
|
<div className="absolute inset-0 opacity-20">
|
|
<div className="absolute inset-0" style={{
|
|
backgroundImage: `linear-gradient(rgba(88, 166, 255, 0.1) 1px, transparent 1px),
|
|
linear-gradient(90deg, rgba(88, 166, 255, 0.1) 1px, transparent 1px)`,
|
|
backgroundSize: '50px 50px'
|
|
}} />
|
|
</div>
|
|
<div className="absolute top-20 left-20 w-72 h-72 bg-primary/20 rounded-full blur-3xl animate-pulse" />
|
|
<div className="absolute bottom-20 right-20 w-96 h-96 bg-accent/20 rounded-full blur-3xl animate-pulse" style={{ animationDelay: '1s' }} />
|
|
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[600px] h-[600px] bg-primary/5 rounded-full blur-3xl" />
|
|
</div>
|
|
|
|
{/* Hero Section */}
|
|
<section className="relative pt-32 pb-20 px-4">
|
|
<div className="max-w-7xl mx-auto text-center">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6 }}
|
|
>
|
|
<div className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/10 border border-primary/20 mb-8">
|
|
<span className="w-2 h-2 bg-accent rounded-full animate-pulse" />
|
|
<span className="text-sm text-foreground-secondary">Join 10,000+ developers</span>
|
|
</div>
|
|
</motion.div>
|
|
|
|
<motion.h1
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6, delay: 0.1 }}
|
|
className="text-5xl md:text-7xl font-bold text-foreground leading-tight mb-6"
|
|
>
|
|
Where Code
|
|
<br />
|
|
Becomes{' '}
|
|
<span className="bg-gradient-to-r from-primary via-accent to-primary bg-clip-text text-transparent">
|
|
Community
|
|
</span>
|
|
</motion.h1>
|
|
|
|
<motion.p
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6, delay: 0.2 }}
|
|
className="text-lg md:text-xl text-foreground-secondary max-w-2xl mx-auto mb-10"
|
|
>
|
|
Showcase your projects, discover new tools, and connect with developers from around the world. The social platform built for people who build.
|
|
</motion.p>
|
|
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6, delay: 0.3 }}
|
|
className="flex flex-col sm:flex-row items-center justify-center gap-4"
|
|
>
|
|
<Link
|
|
href="/register"
|
|
className="px-8 py-3 bg-primary text-white rounded-lg font-semibold hover:bg-primary/90 transition-colors text-lg"
|
|
>
|
|
Get Started Free
|
|
</Link>
|
|
<Link
|
|
href="/login"
|
|
className="px-8 py-3 border border-border text-foreground rounded-lg font-semibold hover:bg-muted transition-colors text-lg"
|
|
>
|
|
Sign In
|
|
</Link>
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Stats Section */}
|
|
<section className="relative py-16 px-4">
|
|
<div className="max-w-4xl mx-auto">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ duration: 0.6 }}
|
|
className="grid grid-cols-2 md:grid-cols-4 gap-8"
|
|
>
|
|
{stats.map((stat, i) => (
|
|
<motion.div
|
|
key={stat.label}
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ delay: i * 0.1 }}
|
|
className="text-center"
|
|
>
|
|
<div className="text-3xl md:text-4xl font-bold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
|
{stat.value}
|
|
</div>
|
|
<div className="text-sm text-foreground-secondary mt-1">{stat.label}</div>
|
|
</motion.div>
|
|
))}
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Features Section */}
|
|
<section className="relative py-20 px-4">
|
|
<div className="max-w-7xl mx-auto">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
className="text-center mb-16"
|
|
>
|
|
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-4">
|
|
Everything Developers Need
|
|
</h2>
|
|
<p className="text-lg text-foreground-secondary max-w-2xl mx-auto">
|
|
Built from the ground up for developers who want to share their work and grow their network.
|
|
</p>
|
|
</motion.div>
|
|
|
|
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
{features.map((feature, i) => (
|
|
<motion.div
|
|
key={feature.title}
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ delay: i * 0.1 }}
|
|
className="p-6 bg-card/50 backdrop-blur-sm border border-border rounded-xl hover:border-primary/30 transition-all group"
|
|
>
|
|
<div className="w-12 h-12 rounded-lg bg-primary/10 flex items-center justify-center text-primary mb-4 group-hover:bg-primary/20 transition-colors">
|
|
{feature.icon}
|
|
</div>
|
|
<h3 className="text-lg font-semibold text-foreground mb-2">{feature.title}</h3>
|
|
<p className="text-sm text-foreground-secondary">{feature.description}</p>
|
|
</motion.div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* GitHub Integration Showcase */}
|
|
<section className="relative py-20 px-4">
|
|
<div className="max-w-7xl mx-auto">
|
|
<div className="grid lg:grid-cols-2 gap-12 items-center">
|
|
<motion.div
|
|
initial={{ opacity: 0, x: -20 }}
|
|
whileInView={{ opacity: 1, x: 0 }}
|
|
viewport={{ once: true }}
|
|
>
|
|
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-6">
|
|
Powered by{' '}
|
|
<span className="bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
|
GitHub
|
|
</span>
|
|
</h2>
|
|
<p className="text-lg text-foreground-secondary mb-8">
|
|
Connect your GitHub account and turn your repositories into engaging social content. Share your latest commits, showcase your projects, and let your code speak for itself.
|
|
</p>
|
|
<div className="space-y-4">
|
|
{[
|
|
'Auto-import repositories as shareable posts',
|
|
'Display live contribution graphs on your profile',
|
|
'Discover projects from developers you follow',
|
|
'One-click sharing of code snippets and PRs',
|
|
].map((item, i) => (
|
|
<motion.div
|
|
key={i}
|
|
initial={{ opacity: 0, x: -10 }}
|
|
whileInView={{ opacity: 1, x: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ delay: 0.2 + i * 0.1 }}
|
|
className="flex items-center gap-3"
|
|
>
|
|
<div className="w-5 h-5 rounded-full bg-accent/20 flex items-center justify-center flex-shrink-0">
|
|
<svg className="w-3 h-3 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={3} d="M5 13l4 4L19 7" />
|
|
</svg>
|
|
</div>
|
|
<span className="text-foreground-secondary">{item}</span>
|
|
</motion.div>
|
|
))}
|
|
</div>
|
|
</motion.div>
|
|
|
|
<motion.div
|
|
initial={{ opacity: 0, x: 20 }}
|
|
whileInView={{ opacity: 1, x: 0 }}
|
|
viewport={{ once: true }}
|
|
className="relative"
|
|
>
|
|
{/* Mock GitHub Card */}
|
|
<div className="bg-card border border-border rounded-xl p-6 shadow-2xl shadow-primary/5">
|
|
<div className="flex items-center gap-3 mb-4">
|
|
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-accent" />
|
|
<div>
|
|
<div className="font-semibold text-foreground text-sm">developer</div>
|
|
<div className="text-xs text-foreground-secondary">shared a repository</div>
|
|
</div>
|
|
</div>
|
|
<div className="bg-background rounded-lg border border-border p-4 mb-4">
|
|
<div className="flex items-center gap-2 mb-2">
|
|
<svg className="w-4 h-4 text-foreground-secondary" viewBox="0 0 16 16" fill="currentColor">
|
|
<path d="M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z" />
|
|
</svg>
|
|
<span className="text-sm font-mono text-primary">awesome-project</span>
|
|
</div>
|
|
<p className="text-xs text-foreground-secondary mb-3">A full-stack developer tool with real-time collaboration features</p>
|
|
<div className="flex items-center gap-4 text-xs text-foreground-secondary">
|
|
<span className="flex items-center gap-1">
|
|
<span className="w-3 h-3 rounded-full bg-yellow-400" />
|
|
TypeScript
|
|
</span>
|
|
<span className="flex items-center gap-1">
|
|
<svg className="w-3 h-3" fill="currentColor" viewBox="0 0 16 16">
|
|
<path d="M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z" />
|
|
</svg>
|
|
2.4k
|
|
</span>
|
|
<span className="flex items-center gap-1">
|
|
<svg className="w-3 h-3" fill="currentColor" viewBox="0 0 16 16">
|
|
<path d="M5 5.372v.878c0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75v-.878a2.25 2.25 0 1 1 1.5 0v.878a2.25 2.25 0 0 1-2.25 2.25h-1.5v2.128a2.251 2.251 0 1 1-1.5 0V8.5h-1.5A2.25 2.25 0 0 1 3.5 6.25v-.878a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm-3 8.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z" />
|
|
</svg>
|
|
183
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div className="flex items-center gap-4 text-foreground-secondary">
|
|
<button className="flex items-center gap-1 text-sm hover:text-primary transition-colors">
|
|
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" />
|
|
</svg>
|
|
128
|
|
</button>
|
|
<button className="flex items-center gap-1 text-sm hover:text-primary transition-colors">
|
|
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" />
|
|
</svg>
|
|
34
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</motion.div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Pricing Preview */}
|
|
<section className="relative py-20 px-4">
|
|
<div className="max-w-5xl mx-auto">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
className="text-center mb-16"
|
|
>
|
|
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-4">
|
|
Simple, Transparent Pricing
|
|
</h2>
|
|
<p className="text-lg text-foreground-secondary">
|
|
Start free. Upgrade when you need more.
|
|
</p>
|
|
</motion.div>
|
|
|
|
<div className="grid md:grid-cols-3 gap-6">
|
|
{pricingPreview.map((plan, i) => (
|
|
<motion.div
|
|
key={plan.name}
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
transition={{ delay: i * 0.1 }}
|
|
className={`p-6 rounded-xl border transition-all ${
|
|
plan.highlighted
|
|
? 'bg-card border-primary shadow-lg shadow-primary/10 scale-105'
|
|
: 'bg-card/50 border-border hover:border-primary/30'
|
|
}`}
|
|
>
|
|
{plan.highlighted && (
|
|
<div className="text-xs font-semibold text-primary mb-4">MOST POPULAR</div>
|
|
)}
|
|
<h3 className="text-xl font-bold text-foreground">{plan.name}</h3>
|
|
<div className="flex items-baseline gap-1 mt-2 mb-6">
|
|
<span className="text-3xl font-bold text-foreground">{plan.price}</span>
|
|
<span className="text-foreground-secondary">{plan.period}</span>
|
|
</div>
|
|
<ul className="space-y-3 mb-6">
|
|
{plan.features.map((feature) => (
|
|
<li key={feature} className="flex items-center gap-2 text-sm text-foreground-secondary">
|
|
<svg className={`w-4 h-4 flex-shrink-0 ${plan.highlighted ? 'text-primary' : 'text-accent'}`} fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M5 13l4 4L19 7" />
|
|
</svg>
|
|
{feature}
|
|
</li>
|
|
))}
|
|
</ul>
|
|
<Link
|
|
href="/pricing"
|
|
className={`block text-center py-2.5 rounded-lg font-semibold text-sm transition-colors ${
|
|
plan.highlighted
|
|
? 'bg-primary text-white hover:bg-primary/90'
|
|
: 'border border-border text-foreground hover:bg-muted'
|
|
}`}
|
|
>
|
|
{plan.name === 'Free' ? 'Get Started' : 'View Details'}
|
|
</Link>
|
|
</motion.div>
|
|
))}
|
|
</div>
|
|
|
|
<motion.div
|
|
initial={{ opacity: 0 }}
|
|
whileInView={{ opacity: 1 }}
|
|
viewport={{ once: true }}
|
|
className="text-center mt-8"
|
|
>
|
|
<Link href="/pricing" className="text-sm text-primary hover:underline">
|
|
Compare all features →
|
|
</Link>
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* CTA Section */}
|
|
<section className="relative py-20 px-4">
|
|
<div className="max-w-3xl mx-auto text-center">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true }}
|
|
className="p-12 rounded-2xl bg-gradient-to-r from-primary/10 to-accent/10 border border-primary/20"
|
|
>
|
|
<h2 className="text-3xl md:text-4xl font-bold text-foreground mb-4">
|
|
Ready to Join?
|
|
</h2>
|
|
<p className="text-lg text-foreground-secondary mb-8 max-w-xl mx-auto">
|
|
Join thousands of developers who are already using Gitgram to showcase their work and grow their network.
|
|
</p>
|
|
<Link
|
|
href="/register"
|
|
className="inline-block px-8 py-3 bg-primary text-white rounded-lg font-semibold hover:bg-primary/90 transition-colors text-lg"
|
|
>
|
|
Create Free Account
|
|
</Link>
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Footer */}
|
|
<footer className="relative border-t border-border py-12 px-4">
|
|
<div className="max-w-7xl mx-auto">
|
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-8 mb-8">
|
|
<div>
|
|
<h4 className="font-semibold text-foreground mb-4">Product</h4>
|
|
<ul className="space-y-2">
|
|
<li><Link href="/pricing" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">Pricing</Link></li>
|
|
<li><Link href="/register" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">Sign Up</Link></li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<h4 className="font-semibold text-foreground mb-4">Resources</h4>
|
|
<ul className="space-y-2">
|
|
<li><Link href="/login" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">Sign In</Link></li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<h4 className="font-semibold text-foreground mb-4">Legal</h4>
|
|
<ul className="space-y-2">
|
|
<li><Link href="/terms" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">Terms of Service</Link></li>
|
|
<li><Link href="/privacy-policy" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">Privacy Policy</Link></li>
|
|
</ul>
|
|
</div>
|
|
<div>
|
|
<h4 className="font-semibold text-foreground mb-4">Connect</h4>
|
|
<ul className="space-y-2">
|
|
<li><a href="https://github.com/gitgram" target="_blank" rel="noopener noreferrer" className="text-sm text-foreground-secondary hover:text-foreground transition-colors">GitHub</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div className="pt-8 border-t border-border flex flex-col md:flex-row justify-between items-center gap-4">
|
|
<p className="text-sm text-foreground-secondary">
|
|
© {new Date().getFullYear()} Gitgram. All rights reserved.
|
|
</p>
|
|
<p className="text-sm text-foreground-secondary">
|
|
Built for developers, by developers.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
function AuthenticatedHome() {
|
|
const [refreshKey, setRefreshKey] = useState(0)
|
|
|
|
return (
|
|
<div className="min-h-screen bg-gray-50 dark:bg-gray-900">
|
|
<Navigation />
|
|
<div className="max-w-2xl mx-auto px-4 py-8">
|
|
<CreatePost onPostCreated={() => setRefreshKey(k => k + 1)} />
|
|
<div className="mt-6">
|
|
<Feed key={refreshKey} />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default function HomePage() {
|
|
const { isAuthenticated, isInitialized, initialize } = useAuthStore()
|
|
|
|
useEffect(() => {
|
|
initialize()
|
|
}, [initialize])
|
|
|
|
// Show nothing while auth state is loading to avoid flash
|
|
if (!isInitialized) {
|
|
return (
|
|
<div className="min-h-screen bg-background flex items-center justify-center">
|
|
<div className="w-8 h-8 border-2 border-primary border-t-transparent rounded-full animate-spin" />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
if (isAuthenticated) {
|
|
return <AuthenticatedHome />
|
|
}
|
|
|
|
return <LandingPage />
|
|
}
|