Browse Source

feat: add new-match and request-sent pages with support for localized profile summaries

front-test-2
ghorbani 4 weeks ago
parent
commit
a76358d789
  1. 20
      src/app/new-match/page.tsx
  2. 18
      src/app/request-sent/page.tsx
  3. 7
      src/lib/get-submit-path.ts
  4. 6
      src/translations/locales/en.json
  5. 6
      src/translations/locales/fa.json

20
src/app/new-match/page.tsx

@ -24,10 +24,10 @@ const advisorAvatars = [
const fieldCandidates = { const fieldCandidates = {
name: ["name", "full_name", "fullname", "first_name", "display_name"], name: ["name", "full_name", "fullname", "first_name", "display_name"],
occupation: ["occupation", "job", "profession", "career", "work"],
occupation: ["occupation", "job", "profession", "career", "work", "education", "highest_level_of_education"],
age: ["age"], age: ["age"],
city: ["city", "current_city", "residence_city", "location", "residence"],
maritalStatus: ["marital_status", "maritalstatus", "relationship_status"],
city: ["city", "current_city", "residence_city", "location", "residence", "birth_city"],
maritalStatus: ["marital_status", "maritalstatus", "relationship_status", "current_marital_status"],
cityPreference: [ cityPreference: [
"city_preference", "city_preference",
"citypreference", "citypreference",
@ -192,6 +192,14 @@ export default function NewMatchPage() {
(field): field is DisplayField => Boolean(field), (field): field is DisplayField => Boolean(field),
); );
const isFemaleProfile = profile?.gender === "female";
const matchHeadingTitle = isFemaleProfile
? "پیشنهاد ازدواج جدید"
: "YOU HAVE A NEW MATCH!";
const matchHeadingDescription = isFemaleProfile
? "یک گزینه‌ی مناسب برای شما پیدا شده است. در صورت تایید، مشخصات شما جهت ادامه فرآیند معرفی ارزیابی خواهد شد."
: "A matching profile has been found. Information is provided by the candidate's family or introducers. If you approve, we'll share your profile with her family.";
return ( return (
<> <>
<PageBackground /> <PageBackground />
@ -219,11 +227,9 @@ export default function NewMatchPage() {
alt="notification" alt="notification"
/> />
</div> </div>
<h2 className="text-[22px] font-bold mt-3.5">YOU HAVE A NEW MATCH!</h2>
<h2 className="text-[22px] font-bold mt-3.5">{matchHeadingTitle}</h2>
<p className="mt-[11px] max-w-[322px] text-[12px] leading-[1.35] font-semibold text-[#7C7C7C]"> <p className="mt-[11px] max-w-[322px] text-[12px] leading-[1.35] font-semibold text-[#7C7C7C]">
A matching profile has been found. Information is provided by the
girl&apos;s family or introducers. If you approve, we&apos;ll
share your profile with her family
{matchHeadingDescription}
</p> </p>
</section> </section>
<div className="flex h-full flex-col justify-between"> <div className="flex h-full flex-col justify-between">

18
src/app/request-sent/page.tsx

@ -37,6 +37,12 @@ export default function RequestSentPage() {
}, [profile, locale, router]); }, [profile, locale, router]);
const copy = t.findingMatch; const copy = t.findingMatch;
const requestSentCopy = (t as any).requestSent ?? {
title: "درخواست ارسال شد",
description: "درخواست معرفی شما از طرف ما به خانواده طرف مقابل ارسال شد. در صورت تایید ایشان، اطلاعات تماس به اطلاع شما خواهد رسید.",
matchProfile: "مشاهده پروفایل گزینه",
profileLocked: "پروفایل قفل است",
};
return ( return (
<> <>
@ -48,8 +54,8 @@ export default function RequestSentPage() {
> >
<header className="-mx-[6px] flex items-center justify-between pb-3"> <header className="-mx-[6px] flex items-center justify-between pb-3">
<NavigationButton icon="back" /> <NavigationButton icon="back" />
<h1 className="font-faminela group-16">Habib Marriage</h1>
<NavigationButton icon="support" iconLabel="Support" />
<h1 className="font-faminela group-16">{t.common.appName}</h1>
<NavigationButton icon="support" iconLabel={t.common.support} />
</header> </header>
<div className="flex flex-1 flex-col justify-between gap-20 pt-[109px]"> <div className="flex flex-1 flex-col justify-between gap-20 pt-[109px]">
@ -66,16 +72,16 @@ export default function RequestSentPage() {
</div> </div>
<h1 className="mt-11 group-16 leading-none font-black tracking-[0.02em] text-[#171717] uppercase"> <h1 className="mt-11 group-16 leading-none font-black tracking-[0.02em] text-[#171717] uppercase">
Request Sent
{requestSentCopy.title}
</h1> </h1>
<p className="mt-4 max-w-[315px] group-12 leading-[1.45] font-semibold text-[#777777]"> <p className="mt-4 max-w-[315px] group-12 leading-[1.45] font-semibold text-[#777777]">
We will propose marriage on your behalf. If they accept, their contact details will be shared with you.
{requestSentCopy.description}
</p> </p>
<Link href={"/new-match/profile"} className="mt-9 w-full max-w-[212px]"> <Link href={"/new-match/profile"} className="mt-9 w-full max-w-[212px]">
<div className="bg-[#F5F5F5] px-4 py-2 rounded-[15px] shadow group-14 text-center font-semibold text-[#36363C]"> <div className="bg-[#F5F5F5] px-4 py-2 rounded-[15px] shadow group-14 text-center font-semibold text-[#36363C]">
Match Profile
{requestSentCopy.matchProfile}
</div> </div>
</Link > </Link >
</section> </section>
@ -100,7 +106,7 @@ export default function RequestSentPage() {
/> />
<h2 className="group-14 leading-none font-semibold text-[#747474]"> <h2 className="group-14 leading-none font-semibold text-[#747474]">
Profile is locked
{requestSentCopy.profileLocked}
</h2> </h2>
</div> </div>
</section> </section>

7
src/lib/get-submit-path.ts

@ -15,12 +15,19 @@ export function getSubmitPath(profile: MarriageProfileResponse | undefined) {
if (isInCase && activeCase) { if (isInCase && activeCase) {
const caseStatus = activeCase.status; const caseStatus = activeCase.status;
const myAction = activeCase.my_action; const myAction = activeCase.my_action;
const isFemale = profile.gender === "female";
if (caseStatus === "payment_done" || caseStatus === "finalized") { if (caseStatus === "payment_done" || caseStatus === "finalized") {
if (isFemale) {
return "/candidate-contact"; return "/candidate-contact";
} }
return "/request-accepted";
}
if (caseStatus === "payment_pending" || caseStatus === "female_accepted") { if (caseStatus === "payment_pending" || caseStatus === "female_accepted") {
if (isFemale) {
return "/candidate-contact";
}
return "/request-accepted"; return "/request-accepted";
} }

6
src/translations/locales/en.json

@ -137,5 +137,11 @@
"dismissReasons": "Dismiss reasons", "dismissReasons": "Dismiss reasons",
"dismissDescription": "Please provide the full reason for rejecting the submitted item", "dismissDescription": "Please provide the full reason for rejecting the submitted item",
"dismissPlaceholder": "Your explanatory text ..." "dismissPlaceholder": "Your explanatory text ..."
},
"requestSent": {
"title": "Request Sent",
"description": "We will propose marriage on your behalf. If they accept, their contact details will be shared with you.",
"matchProfile": "Match Profile",
"profileLocked": "Profile is locked"
} }
} }

6
src/translations/locales/fa.json

@ -119,5 +119,11 @@
"dismissReasons": "دلایل رد کردن", "dismissReasons": "دلایل رد کردن",
"dismissDescription": "لطفا دلیل کامل رد کردن مورد ارسال‌شده را بنویسید", "dismissDescription": "لطفا دلیل کامل رد کردن مورد ارسال‌شده را بنویسید",
"dismissPlaceholder": "متن توضیحی شما ..." "dismissPlaceholder": "متن توضیحی شما ..."
},
"requestSent": {
"title": "درخواست ارسال شد",
"description": "درخواست معرفی شما از طرف ما به خانواده طرف مقابل ارسال شد. در صورت تایید ایشان، اطلاعات تماس به اطلاع شما خواهد رسید.",
"matchProfile": "مشاهده پروفایل گزینه",
"profileLocked": "پروفایل قفل است"
} }
} }
Loading…
Cancel
Save