Revert earlier commit sans re-using the prompt for onboarding.

This commit is contained in:
Chad Curtis committed 2025-07-28 08:26:25 +00:00
1 parent 944fee7256
commit 8c95f7c0b5
2 files changed
+40 -67

No files matched your search

+38 -63
View File
@@ -3,11 +3,9 @@ import { useNavigate } from 'react-router-dom';
import { type Project } from '@/lib/ProjectsManager';
import { useProjectsManager } from '@/hooks/useProjectsManager';
import { useOnboarding } from '@/hooks/useOnboarding';
import { useCurrentUser } from '@/hooks/useCurrentUser';
import { useLocalStorage } from '@/hooks/useLocalStorage';
import { ProjectSidebar } from '@/components/ProjectSidebar';
import { OnboardingDialog } from '@/components/onboarding';
import { LoginArea } from '@/components/auth/LoginArea';
import { Button } from '@/components/ui/button';
import { Textarea } from '@/components/ui/textarea';
@@ -36,7 +34,7 @@ export default function Index() {
handlePreviousStep,
handleCompleteOnboarding,
} = useOnboarding();
const { user } = useCurrentUser();
const [isSidebarVisible, setIsSidebarVisible] = useState(() => {
// Check if we're on mobile immediately to set correct initial state
if (typeof window !== 'undefined') {
@@ -66,12 +64,7 @@ export default function Index() {
loadProjects();
}, [loadProjects]);
// Restore prompt from storage when user logs in
useEffect(() => {
if (user && storedPrompt && !prompt) {
setPrompt(storedPrompt);
}
}, [user, storedPrompt, prompt]);
// Sync prompt with local storage
const handlePromptChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
@@ -202,33 +195,24 @@ export default function Index() {
className="min-h-[120px] touch-action-manipulation overscroll-contain text-base leading-relaxed"
disabled={isCreating}
/>
{user ? (
<Button
onClick={handleCreateProject}
disabled={!prompt.trim() || isCreating}
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
size="lg"
>
{isCreating ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
Creating Project...
</>
) : (
<>
<Plus className="mr-2 h-4 w-4" />
Create Project
</>
)}
</Button>
) : (
<div className="text-center space-y-4">
<p className="text-muted-foreground">
Log in or sign up to create your first project
</p>
<LoginArea className="max-w-xs mx-auto" />
</div>
)}
<Button
onClick={handleCreateProject}
disabled={!prompt.trim() || isCreating}
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
size="lg"
>
{isCreating ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
Creating Project...
</>
) : (
<>
<Plus className="mr-2 h-4 w-4" />
Create Project
</>
)}
</Button>
</CardContent>
</Card>
</div>
@@ -382,33 +366,24 @@ export default function Index() {
className="min-h-[120px] touch-action-manipulation overscroll-contain text-base leading-relaxed"
disabled={isCreating}
/>
{user ? (
<Button
onClick={handleCreateProject}
disabled={!prompt.trim() || isCreating}
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
size="lg"
>
{isCreating ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
Creating Project...
</>
) : (
<>
<Plus className="mr-2 h-4 w-4" />
Create Project
</>
)}
</Button>
) : (
<div className="text-center space-y-4">
<p className="text-muted-foreground">
Log in or sign up to create your first project
</p>
<LoginArea className="max-w-xs mx-auto" />
</div>
)}
<Button
onClick={handleCreateProject}
disabled={!prompt.trim() || isCreating}
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
size="lg"
>
{isCreating ? (
<>
<div className="animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"></div>
Creating Project...
</>
) : (
<>
<Plus className="mr-2 h-4 w-4" />
Create Project
</>
)}
</Button>
</CardContent>
</Card>
</div>