setClickedBride(i => !i)}>
- 신부측
+ {secondBaseInfo.korean}측
@@ -68,12 +79,12 @@ function MoneyInfoComponent(
{clickedBride && (
<>
-
-
-
+
+
+
>
)}
diff --git a/src/component/template/component/PreviewTemplate.tsx b/src/component/template/component/PreviewTemplate.tsx
index bb337cb..8640a13 100644
--- a/src/component/template/component/PreviewTemplate.tsx
+++ b/src/component/template/component/PreviewTemplate.tsx
@@ -6,7 +6,7 @@ import colors from "@designsystem/foundation/colors";
import styled from "styled-components";
import WeddingSchedule from "@remote/value/WeddingSchedule";
import WeddingPlace from "@remote/value/WeddingPlace";
-import BaseInfo from "@remote/value/BaseInfo";
+import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo";
import Template from "@remote/value/Template";
import Spacer from "@designsystem/component/spacer";
import {format, parse} from "date-fns";
@@ -32,6 +32,7 @@ function PreviewTemplate(
const dateString = `${weddingSchedule.weddingDate} ${weddingSchedule.weddingTime}`;
const date = parse(dateString, 'yyyy-MM-dd HH:mm', new Date());
const isValidDate = !isNaN(date.getTime());
+ const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo);
switch (template.templateName) {
case '템플릿1':
@@ -47,9 +48,9 @@ function PreviewTemplate(
- 신랑 {baseInfo.groomName}
+ {first.korean} {first.name}
- 신부 {baseInfo.brideName}
+ {second.korean} {second.name}
@@ -63,9 +64,9 @@ function PreviewTemplate(
- {baseInfo.groomName}
+ {first.name}
&
- {baseInfo.brideName}
+ {second.name}
);
@@ -79,9 +80,9 @@ function PreviewTemplate(
- 신랑 {baseInfo.groomName}
+ {first.korean} {first.name}
- 신부 {baseInfo.brideName}
+ {second.korean} {second.name}
@@ -91,7 +92,7 @@ function PreviewTemplate(
return (
- {baseInfo.groomName} & {baseInfo.brideName}
+ {first.name} & {second.name}
{isValidDate && format(date, 'yyyy.MM.dd a h시', {locale: ko})}
@@ -109,9 +110,9 @@ function PreviewTemplate(
- {baseInfo.groomName}
+ {first.name}
and
- {baseInfo.brideName}
+ {second.name}
);
@@ -121,9 +122,9 @@ function PreviewTemplate(
{isValidDate && format(date, 'MM / dd')}
- {baseInfo.groomName}
+ {first.name}
그리고
- {baseInfo.brideName}
+ {second.name}
diff --git a/src/component/template/component/weddingday/DDay.tsx b/src/component/template/component/weddingday/DDay.tsx
index b0324be..4dfe4ea 100644
--- a/src/component/template/component/weddingday/DDay.tsx
+++ b/src/component/template/component/weddingday/DDay.tsx
@@ -5,7 +5,7 @@ import colors from "@designsystem/foundation/colors";
import Icon, {IconType} from "@designsystem/foundation/icon";
import styled from "styled-components";
import WeddingSchedule from "@remote/value/WeddingSchedule";
-import BaseInfo from "@remote/value/BaseInfo";
+import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo";
export type DDayStyle = 'style1' | 'style2';
type RemainTime = {
@@ -67,6 +67,8 @@ function DDay(
};
}, [weddingDate]);
+ const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo);
+
return (
- {baseInfo.groomName}
+ {first.name}
- {baseInfo.brideName}의 결혼식이
+ {second.name}의 결혼식이
{remainingTime.days}
일 남았습니다.
diff --git a/src/component/template/dialog/ContactingCongratulationDialog.tsx b/src/component/template/dialog/ContactingCongratulationDialog.tsx
index 614844a..46cf506 100644
--- a/src/component/template/dialog/ContactingCongratulationDialog.tsx
+++ b/src/component/template/dialog/ContactingCongratulationDialog.tsx
@@ -6,7 +6,7 @@ import {Column, Row} from "@designsystem/component/flexLayout";
import Text from "@designsystem/component/text";
import makeText from "@designsystem/foundation/text/textType";
import Phone from "@remote/value/Phone";
-import BaseInfo from "@remote/value/BaseInfo";
+import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo";
import Spacer from "@designsystem/component/spacer";
import Icon, {IconType} from "@designsystem/foundation/icon";
@@ -16,6 +16,12 @@ interface ContactTemplateDialogProps {
dismiss: () => void;
}
+interface Tel {
+ name: string;
+ familyName: string;
+ tel: string;
+}
+
function ContactingCongratulationDialog(
{
baseInfo,
@@ -24,12 +30,10 @@ function ContactingCongratulationDialog(
}: ContactTemplateDialogProps
) {
const [selectedIndex, setSelectedIndex] = useState(0);
- const tels: {
- name: string,
- familyName: string,
- tel: string;
- }[] = selectedIndex === 0
- ? [
+
+ const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo);
+ const tels = ((): Tel[] => {
+ const groomTels: Tel[] = [
{
name: baseInfo.groomName,
familyName: '신랑',
@@ -45,8 +49,9 @@ function ContactingCongratulationDialog(
familyName: '어머니',
tel: phone.groomMotherTel
}
- ]
- : [
+ ];
+
+ const brideTels: Tel[] = [
{
name: baseInfo.brideName,
familyName: '신부',
@@ -64,6 +69,11 @@ function ContactingCongratulationDialog(
}
];
+ const firstTels = baseInfo.brideMarkFirst ? brideTels : groomTels;
+ const secondTels = baseInfo.brideMarkFirst ? groomTels : brideTels
+ return selectedIndex === 0 ? firstTels : secondTels;
+ })();
+
return (
@@ -72,8 +82,8 @@ function ContactingCongratulationDialog(
축하의 마음을 전하세요
- setSelectedIndex(0)}>신랑측
- setSelectedIndex(1)}>신부측
+ setSelectedIndex(0)}>{first.korean}측
+ setSelectedIndex(1)}>{second.korean}측
{tels.map(tel => (
diff --git a/src/component/template/dialog/rsvp/RsvpDialog.tsx b/src/component/template/dialog/rsvp/RsvpDialog.tsx
index a26dc4f..4d41754 100644
--- a/src/component/template/dialog/rsvp/RsvpDialog.tsx
+++ b/src/component/template/dialog/rsvp/RsvpDialog.tsx
@@ -5,7 +5,7 @@ import colors from "@designsystem/foundation/colors";
import {Column} from "@designsystem/component/flexLayout";
import HorizontalDivider from "@designsystem/component/horizontalDivider";
import Text from "@designsystem/component/text";
-import BaseInfo from "@remote/value/BaseInfo";
+import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo";
import WeddingSchedule from "@remote/value/WeddingSchedule";
import WeddingPlace from "@remote/value/WeddingPlace";
import {format, parse} from "date-fns";
@@ -38,6 +38,7 @@ function RsvpDialog(
const dateString = `${weddingSchedule.weddingDate} ${weddingSchedule.weddingTime}`;
const date = parse(dateString, 'yyyy-MM-dd HH:mm', new Date());
const isValidDate = !isNaN(date.getTime());
+ const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo);
return (
@@ -50,7 +51,7 @@ function RsvpDialog(
- 신랑 {baseInfo.groomName} & 신부 {baseInfo.brideName}
+ {first.korean} {first.name} & {second.korean} {second.name}
{isValidDate && (
{format(date, 'yyyy년 M월 d일 EEEE a h시', {locale: ko})}
)}
diff --git a/src/remote/value/BaseInfo.ts b/src/remote/value/BaseInfo.ts
index 34d7fb4..20efd03 100644
--- a/src/remote/value/BaseInfo.ts
+++ b/src/remote/value/BaseInfo.ts
@@ -74,4 +74,51 @@ export const dummyBaseInfo: BaseInfo = {
brideFamilyName: "딸",
statusFlower: true,
brideMarkFirst: false,
+}
+
+type InfoByBrideMarkFirst = {
+ name: string;
+ fatherName: string;
+ fatherStatus: boolean;
+ motherName: string;
+ motherStatus: boolean;
+ familyName: string;
+ korean: string;
+}
+
+export function getBaseInfoByBrideMarkFirst(baseInfo: BaseInfo): {
+ first: InfoByBrideMarkFirst;
+ second: InfoByBrideMarkFirst;
+} {
+ const groomInfo: InfoByBrideMarkFirst = {
+ name: baseInfo.groomName,
+ fatherName: baseInfo.groomFatherName,
+ fatherStatus: baseInfo.groomFatherStatus,
+ motherName: baseInfo.groomMotherName,
+ motherStatus: baseInfo.groomMotherStatus,
+ familyName: baseInfo.groomFamilyName,
+ korean: '신랑'
+ };
+
+ const brideInfo: InfoByBrideMarkFirst = {
+ name: baseInfo.brideName,
+ fatherName: baseInfo.brideFatherName,
+ fatherStatus: baseInfo.brideFatherStatus,
+ motherName: baseInfo.brideMotherName,
+ motherStatus: baseInfo.brideMotherStatus,
+ familyName: baseInfo.brideFamilyName,
+ korean: '신부'
+ };
+
+ if (baseInfo.brideMarkFirst) {
+ return {
+ first: brideInfo,
+ second: groomInfo,
+ }
+ } else {
+ return {
+ first: groomInfo,
+ second: brideInfo
+ }
+ }
}
\ No newline at end of file
diff --git a/src/remote/value/MoneyInfo.ts b/src/remote/value/MoneyInfo.ts
index 334e0ab..8d55c8f 100644
--- a/src/remote/value/MoneyInfo.ts
+++ b/src/remote/value/MoneyInfo.ts
@@ -139,4 +139,66 @@ export const dummyMoneyInfo: MoneyInfo = {
infoContent: "그래영",
infoTitle: "돈주세영",
kakaoStatus: true
+}
+
+type MoneyInfoByBrideMarkFirst = {
+ bankName: string;
+ bankNumber: string;
+ fatherBankName: string;
+ fatherBankNumber: string;
+ fatherKakaoUrl?: string;
+ fatherNameMoneyInfo: string;
+ kakaoUrl?: string;
+ motherBankName: string;
+ motherBankNumber: string;
+ motherKakaoUrl?: string;
+ motherNameMoneyInfo: string;
+ nameMoneyInfo: string;
+}
+
+export function getMoneyInfoByBrideMarkFirst(moneyInfo: MoneyInfo, brideMarkFirst: boolean): {
+ first: MoneyInfoByBrideMarkFirst;
+ second: MoneyInfoByBrideMarkFirst;
+} {
+ const groomMoneyInfo: MoneyInfoByBrideMarkFirst = {
+ bankName: moneyInfo.groomBankName,
+ bankNumber: moneyInfo.groomBankNumber,
+ fatherBankName: moneyInfo.groomFatherBankName,
+ fatherBankNumber: moneyInfo.groomFatherBankNumber,
+ fatherKakaoUrl: moneyInfo.groomFatherKakaoUrl,
+ fatherNameMoneyInfo: moneyInfo.groomFatherNameMoneyInfo,
+ kakaoUrl: moneyInfo.groomKakaoUrl,
+ motherBankName: moneyInfo.groomMotherBankName,
+ motherBankNumber: moneyInfo.groomMotherBankNumber,
+ motherKakaoUrl: moneyInfo.groomMotherKakaoUrl,
+ motherNameMoneyInfo: moneyInfo.groomMotherNameMoneyInfo,
+ nameMoneyInfo: moneyInfo.groomNameMoneyInfo,
+ }
+
+ const brideMoneyInfo: MoneyInfoByBrideMarkFirst = {
+ bankName: moneyInfo.brideBankName,
+ bankNumber: moneyInfo.brideBankNumber,
+ fatherBankName: moneyInfo.brideFatherBankName,
+ fatherBankNumber: moneyInfo.brideFatherBankNumber,
+ fatherKakaoUrl: moneyInfo.brideFatherKakaoUrl,
+ fatherNameMoneyInfo: moneyInfo.brideFatherNameMoneyInfo,
+ kakaoUrl: moneyInfo.brideKakaoUrl,
+ motherBankName: moneyInfo.brideMotherBankName,
+ motherBankNumber: moneyInfo.brideMotherBankNumber,
+ motherKakaoUrl: moneyInfo.brideMotherKakaoUrl,
+ motherNameMoneyInfo: moneyInfo.brideMotherNameMoneyInfo,
+ nameMoneyInfo: moneyInfo.brideNameMoneyInfo,
+ }
+
+ if (brideMarkFirst) {
+ return {
+ first: brideMoneyInfo,
+ second: groomMoneyInfo
+ }
+ } else {
+ return {
+ first: groomMoneyInfo,
+ second: brideMoneyInfo
+ }
+ }
}
\ No newline at end of file