From 8a19fc67676a05aa7585632e7f7bc58626b6b91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=99=8D=EB=AF=BC?= Date: Wed, 26 Mar 2025 12:35:53 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=EC=A7=81=EC=A0=91=EC=82=AC=EC=A7=84?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ChoiceCard.tsx | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/pages/ChoiceCard.tsx b/src/pages/ChoiceCard.tsx index e03e5f5..aeab20c 100644 --- a/src/pages/ChoiceCard.tsx +++ b/src/pages/ChoiceCard.tsx @@ -47,21 +47,34 @@ const ChoiceCard: React.FC = () => { const frontProp = isDesktop || isTablet ? "다음" : Top.NullFront; - // 컴포넌트 마운트 시 Birthday1을 기본값으로 설정 useEffect(() => { const setDefaultImage = async () => { try { - const response = await fetch(Birthday1); - const blob = await response.blob(); - const file = new File([blob], "Birthday1.png", { type: "image/png" }); - setSelectedImage(file); - setCardImage(file); + const savedImages = JSON.parse(localStorage.getItem("myImages") || "[]"); + + if (savedImages.length > 0) { + const res = await fetch(savedImages[0]); + const blob = await res.blob(); + const file = new File([blob], "MyImage.png", { type: blob.type }); + + setSelectedImage(file); + setCardImage(file); + } else { + const response = await fetch(Birthday1); + const blob = await response.blob(); + const file = new File([blob], "Birthday1.png", { type: "image/png" }); + + setSelectedImage(file); + setCardImage(file); + } } catch (error) { console.error("기본 이미지 설정 오류:", error); } }; + setDefaultImage(); - }, [setSelectedImage, setCardImage]); + }, [setSelectedImage, setCardImage]); //경고회피용 + const handleSBToggle = (index: number) => { setActiveIndex(index); From 8bec99ec0b6e03ee78d25327bcfe591cdb3034b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=ED=99=8D=EB=AF=BC?= Date: Sun, 30 Mar 2025 20:13:06 +0900 Subject: [PATCH 2/2] =?UTF-8?q?seo=EC=B5=9C=EC=A0=81=ED=99=94=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ImgContentCut.tsx | 33 +++++++---- src/components/choiceCard/Modal.tsx | 4 +- src/components/choiceCard/Rectangle.tsx | 8 +-- src/components/choiceCard/Wrap.tsx | 8 +-- src/components/login/FeatureBoxEmpty.tsx | 25 ++++----- src/components/login/FeatureBoxFull.tsx | 52 ++++++----------- src/components/login/GoogleLogin.tsx | 12 ++-- src/components/login/GreetingMessage.tsx | 2 +- src/components/login/LoginBoxColumn.tsx | 14 ++--- src/components/login/LoginSection.tsx | 11 ++-- .../myInvitation/LetterContainer.tsx | 20 +++---- src/components/myInvitation/MenuContainer.tsx | 56 +++++++------------ src/components/myInvitation/ReviewModal.tsx | 23 +++----- src/components/myInvitation/SlideBar.tsx | 9 +-- src/pages/ChoiceCard.tsx | 48 +++++++++++----- src/pages/LoginScreen.tsx | 8 ++- src/pages/MyInvitation.tsx | 10 ++-- 17 files changed, 161 insertions(+), 182 deletions(-) diff --git a/src/components/ImgContentCut.tsx b/src/components/ImgContentCut.tsx index e525ca7..c17c0b6 100644 --- a/src/components/ImgContentCut.tsx +++ b/src/components/ImgContentCut.tsx @@ -8,19 +8,20 @@ import * as style from "@/styles/choiceCard/ImgContentCut"; import { CropperContainer } from "@/styles/choiceCard/ChoiceCardStyle"; const ImgContentCut: React.FC = () => { - const location = useLocation(); const navigate = useNavigate(); const cropperRef = useRef(null); const image = location.state?.image || ""; // 선택된 이미지 가져오기 + // Cropper.js의 초기 상태로 리셋 const handleReset = () => { if (cropperRef.current) { const cropper = (cropperRef.current as any).cropper; - cropper.reset(); // Cropper.js의 초기 상태로 리셋 + cropper.reset(); } }; + // 자른 이미지 저장 후 이동 const handleNext = () => { if (cropperRef.current) { const cropper = (cropperRef.current as any).cropper; @@ -30,14 +31,19 @@ const ImgContentCut: React.FC = () => { navigate("/choicecard"); } }; - return ( <> - navigate("/choicecard")} onFrontClick={handleReset} /> - - - navigate("/choicecard")} + onFrontClick={handleReset} + /> + + + { scalable={true} // 이미지 비율 변경 가능 cropBoxResizable={true} // 크롭 박스 크기 조정 가능 background={false} // 배경 제거 - /> + aria-label="이미지 자르기 도구" + /> - - + + ); diff --git a/src/components/choiceCard/Modal.tsx b/src/components/choiceCard/Modal.tsx index 13d8484..587a9a1 100644 --- a/src/components/choiceCard/Modal.tsx +++ b/src/components/choiceCard/Modal.tsx @@ -8,10 +8,10 @@ interface ModalProps { const Modal: React.FC = ({ onClose }) => { return ( - + 로그인 후 사진을 추가할 수 있어요! - + ); diff --git a/src/components/choiceCard/Rectangle.tsx b/src/components/choiceCard/Rectangle.tsx index 78a3b04..52aa548 100644 --- a/src/components/choiceCard/Rectangle.tsx +++ b/src/components/choiceCard/Rectangle.tsx @@ -4,19 +4,19 @@ import * as style from '@/styles/choiceCard/RectangleStyle'; type RectangleProps = { toggled: boolean; onClick: () => void; - children?: React.ReactNode; // children 속성 추가 + children?: React.ReactNode; }; const Rectangle: React.FC = ({ toggled, onClick, children }) => { return toggled ? ( - + {children} ) : ( - + {children} ); }; -export default Rectangle; +export default Rectangle; \ No newline at end of file diff --git a/src/components/choiceCard/Wrap.tsx b/src/components/choiceCard/Wrap.tsx index 15d3196..9aa7bb4 100644 --- a/src/components/choiceCard/Wrap.tsx +++ b/src/components/choiceCard/Wrap.tsx @@ -15,9 +15,9 @@ const Wrap: React.FC = ({ Title, SubText, WrapBool }) => { const navigate = useNavigate(); return ( - - { Title } - + + { Title } + {lines.map((line, index) => { if (line.includes(targetWord)) { const parts = line.split(targetWord); @@ -31,7 +31,7 @@ const Wrap: React.FC = ({ Title, SubText, WrapBool }) => { })} {WrapBool ? (
- navigate('/choicecard')} /> + navigate('/choicecard')} aria-label='초대장 만들기 페이지로 이동' />
) : null}
diff --git a/src/components/login/FeatureBoxEmpty.tsx b/src/components/login/FeatureBoxEmpty.tsx index 2d7a654..ff389c4 100644 --- a/src/components/login/FeatureBoxEmpty.tsx +++ b/src/components/login/FeatureBoxEmpty.tsx @@ -5,30 +5,27 @@ interface FeatureBoxEmptyProps { title: string; } -const FeatureBoxEmpty: React.FC = ({title}) => { - +const FeatureBoxEmpty: React.FC = ({ title }) => { switch (title) { case "Rectangle1": - return ; + return