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