Improve MVP UX: Add CTA links, update header buttons, replace alerts with toasts
This commit is contained in:
parent
a9ba9fb111
commit
157e53af83
|
|
@ -4,8 +4,7 @@
|
|||
"description": "Create custom QR codes in seconds",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "node dev-server.js",
|
||||
"dev:local": "next dev -p 3050",
|
||||
"dev": "next dev -p 3050",
|
||||
"build": "prisma generate && next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { Button } from '@/components/ui/Button';
|
|||
import { Badge } from '@/components/ui/Badge';
|
||||
import { calculateContrast } from '@/lib/utils';
|
||||
import { useTranslation } from '@/hooks/useTranslation';
|
||||
import { showToast } from '@/components/ui/Toast';
|
||||
|
||||
export default function CreatePage() {
|
||||
const router = useRouter();
|
||||
|
|
@ -159,18 +160,20 @@ export default function CreatePage() {
|
|||
console.log('RESPONSE DATA:', responseData);
|
||||
|
||||
if (response.ok) {
|
||||
// Show what was saved
|
||||
alert(`QR Code saved!\n\nType: ${responseData.type}\nContent: ${JSON.stringify(responseData.content, null, 2)}`);
|
||||
showToast(`QR Code "${title}" created successfully!`, 'success');
|
||||
|
||||
// Wait a moment so user sees the toast, then redirect
|
||||
setTimeout(() => {
|
||||
router.push('/dashboard');
|
||||
router.refresh(); // Force refresh to get new data
|
||||
router.refresh();
|
||||
}, 1000);
|
||||
} else {
|
||||
console.error('Error creating QR code:', responseData);
|
||||
alert('Error creating QR code: ' + (responseData.error || 'Unknown error'));
|
||||
showToast(responseData.error || 'Error creating QR code', 'error');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error creating QR code:', error);
|
||||
alert('Error creating QR code');
|
||||
showToast('Error creating QR code. Please try again.', 'error');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ export default function MarketingLayout({
|
|||
<Button variant="outline">{t('nav.login')}</Button>
|
||||
</Link>
|
||||
|
||||
<Link href="/dashboard">
|
||||
<Button>{t('nav.dashboard')}</Button>
|
||||
<Link href="/signup">
|
||||
<Button>Get Started Free</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
|
|
@ -98,8 +98,8 @@ export default function MarketingLayout({
|
|||
<Link href="/login" onClick={() => setMobileMenuOpen(false)}>
|
||||
<Button variant="outline" className="w-full">{t('nav.login')}</Button>
|
||||
</Link>
|
||||
<Link href="/dashboard" onClick={() => setMobileMenuOpen(false)}>
|
||||
<Button className="w-full">{t('nav.dashboard')}</Button>
|
||||
<Link href="/signup" onClick={() => setMobileMenuOpen(false)}>
|
||||
<Button className="w-full">Get Started Free</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Badge } from '@/components/ui/Badge';
|
||||
import { Card } from '@/components/ui/Card';
|
||||
|
|
@ -50,12 +51,16 @@ export const Hero: React.FC<HeroProps> = ({ t }) => {
|
|||
</div>
|
||||
|
||||
<div className="flex flex-col sm:flex-row gap-4">
|
||||
<Button size="lg" className="text-lg px-8 py-4">
|
||||
<Link href="/signup">
|
||||
<Button size="lg" className="text-lg px-8 py-4 w-full sm:w-auto">
|
||||
{t('hero.cta_primary')}
|
||||
</Button>
|
||||
<Button variant="outline" size="lg" className="text-lg px-8 py-4">
|
||||
</Link>
|
||||
<Link href="/create">
|
||||
<Button variant="outline" size="lg" className="text-lg px-8 py-4 w-full sm:w-auto">
|
||||
{t('hero.cta_secondary')}
|
||||
</Button>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue