Ship Novya PWA with backend for deployable production use.
Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useAuth } from '@/hooks/useAuth';
|
||||
import { useLearningJourney } from '@/hooks/useLearningJourney';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Home, User, MessageSquare, FileText } from 'lucide-react';
|
||||
import { Home, User, MessageSquare, FileText, ClipboardCheck } from 'lucide-react';
|
||||
|
||||
export default function MainPage() {
|
||||
const { user, isAuthenticated } = useAuth();
|
||||
const { progress, permissions } = useLearningJourney(user?.id);
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
@@ -15,7 +17,7 @@ export default function MainPage() {
|
||||
<h1 className="text-2xl font-bold mb-2">خوش آمدید</h1>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{isAuthenticated && user
|
||||
? `سلام ${user.email || user.phone || 'کاربر'}`
|
||||
? `سلام ${user.email || 'کاربر'}`
|
||||
: 'به اپلیکیشن پیشرفته PWA خوش آمدید'}
|
||||
</p>
|
||||
</div>
|
||||
@@ -59,6 +61,19 @@ export default function MainPage() {
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="cursor-pointer transition-all hover:shadow-lg" onClick={() => navigate('/assessment/pre')}>
|
||||
<CardHeader>
|
||||
<ClipboardCheck className="mb-2 h-7 w-7 text-primary" />
|
||||
<CardTitle className="text-lg">آزمونها</CardTitle>
|
||||
<CardDescription className="text-sm">اجرای پیشآزمون و پسآزمون</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button variant="outline" className="w-full">
|
||||
شروع
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
|
||||
<Card className="mt-6">
|
||||
@@ -83,6 +98,16 @@ export default function MainPage() {
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">وضعیت ورود</div>
|
||||
</div>
|
||||
<div className="rounded-lg border p-4">
|
||||
<div className="text-sm font-semibold">
|
||||
{permissions.isCompleted
|
||||
? 'تکمیلشده'
|
||||
: progress?.pre_test_completed_at
|
||||
? 'در حال آموزش'
|
||||
: 'آماده پیشآزمون'}
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground">وضعیت مسیر آموزشی</div>
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
Reference in New Issue
Block a user