feat: add i18n and avatar upload

This commit is contained in:
Vaka.pro
2026-04-26 22:16:59 +03:00
parent db41d4a246
commit 1b23097b18
22 changed files with 750 additions and 145 deletions

View File

@@ -12,8 +12,10 @@ import {
} from '@/features/wishes/wishes.hooks';
import { useAuthStore } from '@/features/auth/authStore';
import { Link } from 'react-router-dom';
import { useI18n } from '@/i18n/i18n';
export function DashboardPage() {
const { t } = useI18n();
const { data, isLoading } = useWishes('active');
const [creating, setCreating] = useState(false);
const [editing, setEditing] = useState<Wish | null>(null);
@@ -26,9 +28,9 @@ export function DashboardPage() {
<div className="grid gap-6">
<section className="flex flex-wrap items-end justify-between gap-4">
<div>
<h1 className="font-display text-3xl">Your wishlist</h1>
<h1 className="font-display text-3xl">{t('dashboard.title')}</h1>
<p className="text-sm text-muted">
Add things you dream of. Share your public page at{' '}
{t('dashboard.description')}
{user && (
<Link
to={`/u/${user.slug}`}
@@ -42,7 +44,7 @@ export function DashboardPage() {
</div>
<Button size="lg" onClick={() => setCreating(true)}>
<Plus className="h-4 w-4" />
Add wish
{t('dashboard.addWish')}
</Button>
</section>
@@ -62,14 +64,14 @@ export function DashboardPage() {
<div className="flex flex-col items-center gap-4 rounded-xl border border-border bg-surface/80 p-10 text-center shadow-card">
<img src="/empty-state.svg" alt="" className="h-40 w-40 opacity-90" />
<div>
<h2 className="text-xl font-semibold">No wishes yet</h2>
<h2 className="text-xl font-semibold">{t('dashboard.emptyTitle')}</h2>
<p className="mt-1 text-sm text-muted">
Start by adding something you'd love to receive.
{t('dashboard.emptyText')}
</p>
</div>
<Button onClick={() => setCreating(true)}>
<Sparkles className="h-4 w-4" />
Add your first wish
{t('dashboard.addFirstWish')}
</Button>
</div>
)}