diff --git a/src/App.tsx b/src/App.tsx index 19bec43..2f6c12b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -65,7 +65,7 @@ function App() { }/> - + )}/> diff --git a/src/component/template/TemplateComponent.tsx b/src/component/template/TemplateComponent.tsx index 6730e31..fd7f78c 100644 --- a/src/component/template/TemplateComponent.tsx +++ b/src/component/template/TemplateComponent.tsx @@ -1,4 +1,4 @@ -import React, {useRef} from 'react'; +import React, {useRef, useState} from 'react'; import Wedding from "@remote/value/Wedding"; import * as S from '@src/component/template/TemplateComponent.style'; import MoneyInfoTemplate from "@src/component/template/component/MoneyInfoTemplate"; @@ -16,24 +16,34 @@ import {DDayStyle} from "@src/component/template/component/weddingday/DDay"; import InvitationLetterTemplate, { InvitationLetterStyle } from "@src/component/template/component/InvitationLetterTemplate"; +import RsvpDialog from "@src/component/template/dialog/rsvp/RsvpDialog"; +import Cookies from "js-cookie"; +import CreateRsvpDialog from "@src/component/template/dialog/rsvp/CreateRsvpDialog"; interface Template1Props { wedding: Wedding; + isPreview?: boolean; onRefresh?: () => void; } function TemplateComponent( { wedding, + isPreview = false, onRefresh }: Template1Props ) { + const [showRsvpDialog, setShowRsvpDialog] = useState( + isPreview ? false : Cookies.get(`hide_RsvpDialog_${wedding.url}`) === undefined + ); + const [showCreateRsvpDialog, setShowCreateRsvpDialog] = useState(false); const {templateColor, templateFont, templateFontSize} = wedding.template; const rootRef = useRef(null); (() => { const addFontSize = templateFontSizeRecord[templateFontSize].addFontSize; increaseFontSize(rootRef, addFontSize); + Cookies.remove('hide_RsvpDialog') })(); const slideStyle: Record = { @@ -53,7 +63,7 @@ function TemplateComponent( 템플릿5: 'style2', 템플릿6: 'style1', } - + const invitationLetterStyle: Record = { 템플릿1: 'style1', 템플릿2: 'style1', @@ -105,9 +115,31 @@ function TemplateComponent( baseInfo={wedding.baseInfo} guestComments={wedding.guestCommentList} guestComment={wedding.guestComment} - onRefresh={onRefresh ?? (() => {})} + onRefresh={onRefresh ?? (() => { + })} /> + {showRsvpDialog && ( + { + setShowRsvpDialog(false); + setShowCreateRsvpDialog(true); + }} + dismiss={() => setShowRsvpDialog(false)} + /> + )} + {showCreateRsvpDialog && ( + setShowCreateRsvpDialog(false)} + /> + )} ); } diff --git a/src/component/template/component/GuestCommentsTemplate.tsx b/src/component/template/component/GuestCommentsTemplate.tsx index b13cd5f..822d04e 100644 --- a/src/component/template/component/GuestCommentsTemplate.tsx +++ b/src/component/template/component/GuestCommentsTemplate.tsx @@ -12,9 +12,9 @@ import {trimString} from "@util/string.util"; import Button from "@designsystem/component/button"; import BaseInfo from "@remote/value/BaseInfo"; import GuestComment from "@remote/value/GuestComment"; -import RemoveGuestCommentDialog from "@src/component/template/dialog/RemoveGuestCommentDialog"; -import GuestCommentsDetailDialog from "@src/component/template/dialog/GuestCommentsDetailDialog"; -import CreateGuestCommentDialog from "@src/component/template/dialog/CreateGuestCommentDialog"; +import RemoveGuestCommentDialog from "@src/component/template/dialog/guestcomment/RemoveGuestCommentDialog"; +import GuestCommentsDetailDialog from "@src/component/template/dialog/guestcomment/GuestCommentsDetailDialog"; +import CreateGuestCommentDialog from "@src/component/template/dialog/guestcomment/CreateGuestCommentDialog"; interface GuestCommentsTemplateProps { templateColor: string; diff --git a/src/component/template/dialog/CreateGuestCommentDialog.tsx b/src/component/template/dialog/guestcomment/CreateGuestCommentDialog.tsx similarity index 100% rename from src/component/template/dialog/CreateGuestCommentDialog.tsx rename to src/component/template/dialog/guestcomment/CreateGuestCommentDialog.tsx diff --git a/src/component/template/dialog/GuestCommentsDetailDialog.tsx b/src/component/template/dialog/guestcomment/GuestCommentsDetailDialog.tsx similarity index 100% rename from src/component/template/dialog/GuestCommentsDetailDialog.tsx rename to src/component/template/dialog/guestcomment/GuestCommentsDetailDialog.tsx diff --git a/src/component/template/dialog/RemoveGuestCommentDialog.tsx b/src/component/template/dialog/guestcomment/RemoveGuestCommentDialog.tsx similarity index 100% rename from src/component/template/dialog/RemoveGuestCommentDialog.tsx rename to src/component/template/dialog/guestcomment/RemoveGuestCommentDialog.tsx diff --git a/src/component/template/dialog/rsvp/ConfirmCreateRsvpDialog.tsx b/src/component/template/dialog/rsvp/ConfirmCreateRsvpDialog.tsx new file mode 100644 index 0000000..9927852 --- /dev/null +++ b/src/component/template/dialog/rsvp/ConfirmCreateRsvpDialog.tsx @@ -0,0 +1,51 @@ +import React from 'react'; +import styled from "styled-components"; +import BaseDialog, {applyBaseDialogContent} from "@designsystem/component/dialog/baseDialog"; +import colors from "@designsystem/foundation/colors"; +import {Column, Row} from "@designsystem/component/flexLayout"; +import Text from "@designsystem/component/text"; +import Button from "@designsystem/component/button"; + +interface ConfirmRsvpDialogProps { + dismiss: () => void; + onConfirm: () => void; +} + +function ConfirmCreateRsvpDialog( + { + dismiss, + onConfirm + }: ConfirmRsvpDialogProps +) { + return ( + + + + 참석의사 전달 + 참석의사 전달시 수정이 불가능합니다 + + +