diff --git a/public/Flower.svg b/public/Flower.svg new file mode 100644 index 0000000..59bf622 --- /dev/null +++ b/public/Flower.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/component/template/TemplateComponent.tsx b/src/component/template/TemplateComponent.tsx index fd7f78c..7539233 100644 --- a/src/component/template/TemplateComponent.tsx +++ b/src/component/template/TemplateComponent.tsx @@ -108,7 +108,7 @@ function TemplateComponent( weddingPlace={wedding.weddingPlace} /> - + - {baseInfo.groomFatherName}·{baseInfo.groomMotherName}의 {baseInfo.groomFamilyName} + + {first.fatherStatus && ( + + )} + {first.fatherName}· + {first.motherStatus && ( + + )} + {first.motherName}의 {first.familyName} + - 신랑  + {first.korean}  - {baseInfo.groomName} + {first.name} - {baseInfo.brideFatherName}·{baseInfo.brideMotherName}의 {baseInfo.brideFamilyName} + + {second.fatherStatus && ( + + )} + {second.fatherName}· + {second.motherStatus && ( + + )} + {second.motherName}의 {second.familyName} + - 신부  + {second.korean}  - {baseInfo.brideName} + {second.name} diff --git a/src/component/template/component/GuestCommentsTemplate.tsx b/src/component/template/component/GuestCommentsTemplate.tsx index 822d04e..74488b0 100644 --- a/src/component/template/component/GuestCommentsTemplate.tsx +++ b/src/component/template/component/GuestCommentsTemplate.tsx @@ -10,7 +10,7 @@ import Design from "@remote/enumeration/Design"; import {trimArray} from "@util/array.util"; import {trimString} from "@util/string.util"; import Button from "@designsystem/component/button"; -import BaseInfo from "@remote/value/BaseInfo"; +import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo"; import GuestComment from "@remote/value/GuestComment"; import RemoveGuestCommentDialog from "@src/component/template/dialog/guestcomment/RemoveGuestCommentDialog"; import GuestCommentsDetailDialog from "@src/component/template/dialog/guestcomment/GuestCommentsDetailDialog"; @@ -39,6 +39,8 @@ function GuestCommentsTemplate( const [showCreateGuestCommentDialog, setShowCreateGuestCommentDialog] = useState(false); const [showRemoveGuestCommentDialog, setShowRemoveGuestCommentDialog] = useState(false); const [showGuestCommentsDetailDialog, setShowGuestCommentsDetailDialog] = useState(false); + + const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo); return ( @@ -46,7 +48,7 @@ function GuestCommentsTemplate( 방명록 - {baseInfo.groomName}, {baseInfo.brideName}에게 하고 싶은 말을 남겨주세요 + {first.name}, {second.name}에게 하고 싶은 말을 남겨주세요 diff --git a/src/component/template/component/InvitationLetterTemplate.tsx b/src/component/template/component/InvitationLetterTemplate.tsx index dd4ac37..07b2b89 100644 --- a/src/component/template/component/InvitationLetterTemplate.tsx +++ b/src/component/template/component/InvitationLetterTemplate.tsx @@ -4,7 +4,7 @@ import HorizontalDivider from "@designsystem/component/horizontalDivider"; import colors from "@designsystem/foundation/colors"; import Text from "@designsystem/component/text"; import Greeting from "@remote/value/Greeting"; -import BaseInfo from "@remote/value/BaseInfo"; +import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo"; export type InvitationLetterStyle = 'style1' | 'style2' | 'style3'; @@ -21,6 +21,8 @@ function InvitationLetterTemplate( invitationLetterStyle }: InvitationLetterTemplateProps ) { + const {first, second} = getBaseInfoByBrideMarkFirst(baseInfo); + return ( {invitationLetterStyle === 'style1' ? ( @@ -36,7 +38,7 @@ function InvitationLetterTemplate( - 신랑 {baseInfo.groomName}신부 {baseInfo.brideName} + {first.korean} {first.name}{second.korean} {second.name} diff --git a/src/component/template/component/MoneyInfoTemplate.tsx b/src/component/template/component/MoneyInfoTemplate.tsx index ca982c8..9c24271 100644 --- a/src/component/template/component/MoneyInfoTemplate.tsx +++ b/src/component/template/component/MoneyInfoTemplate.tsx @@ -1,18 +1,21 @@ import React, {useState} from 'react'; import styled from "styled-components"; -import MoneyInfo from "@remote/value/MoneyInfo"; +import MoneyInfo, {getMoneyInfoByBrideMarkFirst} from "@remote/value/MoneyInfo"; import colors from "@designsystem/foundation/colors"; import Spacer from "@designsystem/component/spacer"; import Icon, {IconType} from "@designsystem/foundation/icon"; import {Column, Row} from "@designsystem/component/flexLayout"; import Text from "@designsystem/component/text"; +import BaseInfo, {getBaseInfoByBrideMarkFirst} from "@remote/value/BaseInfo"; interface MoneyInfoTemplateProps { + baseInfo: BaseInfo; moneyInfo: MoneyInfo; } function MoneyInfoTemplate( { + baseInfo, moneyInfo }: MoneyInfoTemplateProps ) { @@ -20,47 +23,55 @@ function MoneyInfoTemplate( 마음 전하실 곳 - + ); } interface MoneyInfoProps { + baseInfo: BaseInfo; moneyInfo: MoneyInfo; } function MoneyInfoComponent( { + baseInfo, moneyInfo }: MoneyInfoProps ) { const [clickedGroom, setClickedGroom] = useState(false); const [clickedBride, setClickedBride] = useState(false); + const {first: firstBaseInfo, second: secondBaseInfo} = getBaseInfoByBrideMarkFirst(baseInfo); + const { + first: firstMoneyInfo, + second: secondMoneyInfo + } = getMoneyInfoByBrideMarkFirst(moneyInfo, baseInfo.brideMarkFirst); + return (
setClickedGroom(i => !i)}> - 신랑측 + {firstBaseInfo.korean}측
{clickedGroom && ( <> - - - + + + )}
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