diff --git a/src/pages/client/ClientDashboard.jsx b/src/pages/client/ClientDashboard.jsx index 6328233..77972cb 100644 --- a/src/pages/client/ClientDashboard.jsx +++ b/src/pages/client/ClientDashboard.jsx @@ -82,7 +82,7 @@ export default function ClientDashboard() { const pendingReview = projectTasks.filter(t => t.status === 'client_review').length; const active = projectTasks.filter(t => ['in_progress', 'on_hold', 'not_started'].includes(t.status)).length; return ( - +
0 ? 'var(--accent)' : 'var(--border)'}`, diff --git a/src/pages/client/MyProjectDetail.jsx b/src/pages/client/MyProjectDetail.jsx index aa82929..521d548 100644 --- a/src/pages/client/MyProjectDetail.jsx +++ b/src/pages/client/MyProjectDetail.jsx @@ -16,7 +16,10 @@ export default function MyProjectDetail() { const [tasks, setTasks] = useState([]); const [submissions, setSubmissions] = useState([]); const [loading, setLoading] = useState(true); - const [filter, setFilter] = useState('all'); // 'all' | 'mine' + const [filter, setFilter] = useState('all'); + const [editingName, setEditingName] = useState(false); + const [nameVal, setNameVal] = useState(''); + const [savingName, setSavingName] = useState(false); useEffect(() => { async function load() { @@ -42,6 +45,16 @@ export default function MyProjectDetail() { load(); }, [id]); + const handleSaveName = async (e) => { + e.preventDefault(); + if (!nameVal.trim()) return; + setSavingName(true); + await supabase.from('projects').update({ name: nameVal.trim() }).eq('id', id); + setProject(p => ({ ...p, name: nameVal.trim() })); + setEditingName(false); + setSavingName(false); + }; + if (loading) return

Loading...

; if (!project) return

Project not found.

; @@ -58,16 +71,37 @@ export default function MyProjectDetail() {
-
{project.name}
+ {editingName ? ( +
+ setNameVal(e.target.value)} + autoFocus + required + style={{ fontSize: 22, fontWeight: 700, padding: '4px 10px', margin: 0, width: 260 }} + /> + + +
+ ) : ( +
+
{project.name}
+ +
+ )}
{tasks.length} request{tasks.length !== 1 ? 's' : ''} ยท Started {new Date(project.created_at).toLocaleDateString()}
-
- - + Add Request - -
+ + + Add Request +
{/* Filter toggle */} diff --git a/src/pages/client/MyProjects.jsx b/src/pages/client/MyProjects.jsx index f23d498..4493814 100755 --- a/src/pages/client/MyProjects.jsx +++ b/src/pages/client/MyProjects.jsx @@ -33,9 +33,13 @@ function ProjectGroup({ project, tasks, submissions, currentUserId, filter }) { }} >
- + e.stopPropagation()} + style={{ fontSize: 14, fontWeight: 700, color: 'var(--text-primary)', textDecoration: 'none' }} + > {project.name} - + {filteredTasks.length} request{filteredTasks.length !== 1 ? 's' : ''}