diff --git a/client/src/App.jsx b/client/src/App.jsx index f511618..231e2ec 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -1,4 +1,4 @@ -import { BrowserRouter as Router, Routes, Route, useLocation } from 'react-router-dom'; +import { BrowserRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom'; import { HelmetProvider } from 'react-helmet-async'; import { AuthProvider } from './context/AuthContext'; import { SocketProvider } from './context/SocketContext'; @@ -25,8 +25,10 @@ import ExplorePage from './pages/ExplorePage'; import UploadPage from './pages/UploadPage'; import CreatorDashboard from './pages/CreatorDashboard'; import BrandDashboard from './pages/BrandDashboard'; +import MessagingPage from './pages/MessagingPage'; import DirectMessagePage from './pages/DirectMessagePage'; +// MessagingPage removed — use DirectMessagePage at /dm/:id import CheckoutPage from './pages/CheckoutPage'; import ProjectProgressPage from './pages/ProjectProgressPage'; @@ -36,6 +38,7 @@ import NotFoundPage from './pages/NotFoundPage'; // Footer Pages - Product import FeaturesPage from './pages/FeaturesPage'; import PricingPage from './pages/PricingPage'; +import CreatorPricingPage from './pages/CreatorPricingPage'; import IntegrationsPage from './pages/IntegrationsPage'; import ChangelogPage from './pages/ChangelogPage'; @@ -54,9 +57,20 @@ import ContactPage from './pages/ContactPage'; import PrivacyPage from './pages/PrivacyPage'; import TermsPage from './pages/TermsPage'; +import { useAuth } from './context/AuthContext'; + +/** Redirects /profile/me → /profile/:userId, or /auth if not logged in */ +function ProfileMeRedirect() { + const { user, loading } = useAuth(); + if (loading) return
; + if (!user) return ; + return ; +} + const AppLayout = () => { const location = useLocation(); const isDriplens = location.pathname.startsWith('/driplens'); + const isDM = location.pathname.startsWith('/dm'); return ( @@ -101,12 +115,12 @@ const AppLayout = () => { } /> {/* Protected — any logged-in user */} - - } /> } /> + } /> + } /> } /> } /> + } /> } /> @@ -153,6 +167,7 @@ function App() { } /> } /> } /> + } /> } /> } /> @@ -178,9 +193,13 @@ function App() { } /> {/* Protected — any logged-in user */} - - } /> + + } /> + } /> + } /> + } /> + } /> + } /> } /> @@ -189,6 +208,9 @@ function App() { } /> + + } /> } /> diff --git a/client/src/components/EditProjectModal.jsx b/client/src/components/EditProjectModal.jsx new file mode 100644 index 0000000..48e369f --- /dev/null +++ b/client/src/components/EditProjectModal.jsx @@ -0,0 +1,151 @@ +import { useState, useEffect } from 'react'; +import { motion, AnimatePresence } from 'framer-motion'; +import { X, Save, Loader2 } from 'lucide-react'; +import { api } from '../lib/api'; + +const CATEGORIES = [ + 'Cinematography', 'Photography', '3D Motion', 'Design', + 'Illustration', 'Animation', 'Graphic Design', 'VFX' +]; + +export default function EditProjectModal({ project, isOpen, onClose, onSave }) { + const [formData, setFormData] = useState({ + title: '', + description: '', + category: '' + }); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + + useEffect(() => { + if (project) { + setFormData({ + title: project.title || '', + description: project.description || '', + category: project.category || CATEGORIES[0] + }); + } + }, [project]); + + const handleSubmit = async (e) => { + e.preventDefault(); + setLoading(true); + setError(null); + + try { + const res = await api.patch(`/upload/projects/${project.id}`, { + ...formData, + description: formData.description || null + }); + onSave(res.data); + onClose(); + } catch (err) { + setError(err.message || 'Failed to update project'); + } finally { + setLoading(false); + } + }; + + return ( + + {isOpen && ( + + e.stopPropagation()} + > +
+
+
+

Edit Project

+

Refine your showcase details

+
+ +
+ +
+
+ + setFormData({ ...formData, title: e.target.value })} + className="w-full px-4 py-3 bg-[#F8F9FC] border border-[#F0F0F0] focus:border-[#3B50E0] focus:ring-1 focus:ring-[#3B50E0] outline-none transition-all font-medium text-[#0D1033]" + style={{ borderRadius: '0px' }} + placeholder="Enter project title" + /> +
+ +
+ + +
+ +
+ +