diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 32eac83..b176178 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -42,7 +42,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + @@ -161,7 +161,7 @@ export default function RootLayout({ }} /> - +
diff --git a/src/app/new-match/profile/page.tsx b/src/app/new-match/profile/page.tsx index 5dccf83..9f6af22 100644 --- a/src/app/new-match/profile/page.tsx +++ b/src/app/new-match/profile/page.tsx @@ -143,6 +143,76 @@ function MatchPublicProfileFields({ ); } +function NewMatchProfileSkeleton() { + const { dictionary: t } = useI18n(); + + return ( + <> + +
+ +
+ +

+ {t.match.title} +

+
+
+ + +
+
+
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + ); +} + export default function NewMatchProfilePage() { const { dictionary: t, locale } = useI18n(); const router = useRouter(); @@ -151,7 +221,7 @@ export default function NewMatchProfilePage() { const [isRejectSheetOpen, setIsRejectSheetOpen] = useState(false); const [isDismissReasonSheetOpen, setIsDismissReasonSheetOpen] = useState(false); - const { data: profile, refetch: refetchProfile } = useMarriageProfileQuery(); + const { data: profile, isLoading, refetch: refetchProfile } = useMarriageProfileQuery(); useEffect(() => { if (!profile) { @@ -195,6 +265,10 @@ export default function NewMatchProfilePage() { return formatFieldValue(firstVal) || "نامشخص"; }, [profile?.match_summary?.public_info]); + if (isLoading || !profile) { + return ; + } + const isSubmitting = respondMutation.isPending; const isAcceptProfileEnabled = Boolean(caseId) && diff --git a/src/translations/locales/en.json b/src/translations/locales/en.json index b6db13b..6c21687 100644 --- a/src/translations/locales/en.json +++ b/src/translations/locales/en.json @@ -64,6 +64,7 @@ "match": { "title": "New Match", "goBack": "Go back", + "loadingProfile": "Loading match profile...", "acceptProfile": "Accept Profile", "requestProceedTitle": "Request to Proceed", "requestProceedDescription": "With your approval, we will approach their family on your behalf to propose marriage. After their family agrees, you will be introduced to each other for further acquaintance.",