diff --git a/frontend/vizzy/app/dashboard/dashboard-page-client.tsx b/frontend/vizzy/app/dashboard/dashboard-page-client.tsx index 5f41adac..b6f2270c 100644 --- a/frontend/vizzy/app/dashboard/dashboard-page-client.tsx +++ b/frontend/vizzy/app/dashboard/dashboard-page-client.tsx @@ -110,6 +110,7 @@ export default function DashboardPageClient() { diff --git a/frontend/vizzy/components/listings/create-listing-dialog.tsx b/frontend/vizzy/components/listings/create-listing-dialog.tsx index 17954efd..99822694 100644 --- a/frontend/vizzy/components/listings/create-listing-dialog.tsx +++ b/frontend/vizzy/components/listings/create-listing-dialog.tsx @@ -45,6 +45,7 @@ import { updateListingImageUrl } from '@/lib/api/listings/update-listing-images- import { stripTimezone } from '@/lib/utils/dates'; import { getProductCategories } from '@/lib/api/listings/get-product-categories'; import { toast } from 'sonner'; +import { useTranslations } from 'next-intl'; type ListingType = 'sale' | 'swap' | 'rental' | 'giveaway'; @@ -59,6 +60,7 @@ export function ListingDialog({ onOpenChange, onListingCreated, }: ListingDialogProps) { + const t = useTranslations('createListingDialogs'); const [internalOpen, setInternalOpen] = useState(false); const isControlled = controlledOpen !== undefined; const open = isControlled ? controlledOpen : internalOpen; @@ -278,15 +280,15 @@ export function ListingDialog({ setImages([]); setPreviewUrls([]); - toast.success('Listing created successfully!', { - description: 'Your listing has been published.', + toast.success(t('common.createListingSuccess'), { + description: t('common.createListingSuccessDescription'), }); onListingCreated?.(); } catch (error) { console.error('Error submitting form:', error); - toast.error('Failed to create listing', { - description: 'Please try again later.', + toast.error(t('common.createListingError'), { + description: t('common.createListingErrorDescription'), }); } finally { setIsSubmitting(false); @@ -317,10 +319,8 @@ export function ListingDialog({ }} > - Create Listing - - Fill out the details for your new listing. - + {t('common.title')} + {t('common.titleDescription')}
@@ -332,40 +332,40 @@ export function ListingDialog({ name="listingType" render={({ field }) => ( - Listing Type + {t('common.listingType.label')} @@ -380,9 +380,12 @@ export function ListingDialog({ name="title" render={({ field }) => ( - Title + {t('common.titleLabel')} - + @@ -394,34 +397,38 @@ export function ListingDialog({ name="category" render={({ field }) => ( - Category + {t('common.category.categoryLabel')}