feat: [US-013] - Create new project

Add NewProjectButton component with modal dialog for creating new projects:
- Button displays on dashboard with plus icon
- Modal with project name input
- Creates project in Supabase with empty flowchart_data
- Redirects to /editor/[projectId] on success
- Error handling with user feedback

Also fixes lint error in signup page (setState in effect).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2026-01-21 04:16:05 -03:00
co-authored by Claude Opus 4.5
parent 5b87af6244
commit 10ac9fe1e0
3 changed files with 169 additions and 14 deletions
+2 -7
View File
@@ -8,19 +8,14 @@ import { createClient } from '@/lib/supabase/client'
export default function SignupPage() {
const router = useRouter()
const searchParams = useSearchParams()
const [email, setEmail] = useState('')
// Pre-fill email if provided in URL (from invite link)
const [email, setEmail] = useState(searchParams.get('email') ?? '')
const [password, setPassword] = useState('')
const [confirmPassword, setConfirmPassword] = useState('')
const [error, setError] = useState<string | null>(null)
const [loading, setLoading] = useState(false)
useEffect(() => {
// Pre-fill email if provided in URL (from invite link)
const emailParam = searchParams.get('email')
if (emailParam) {
setEmail(emailParam)
}
// Handle invite/signup token from URL hash
// Supabase adds tokens to the URL hash after redirect
const handleTokenFromUrl = async () => {