From 89f31521db9962626d917a6c0c96581597406f7b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 06:12:54 +0000 Subject: [PATCH] Visual edit in Lovable Edited UI in Lovable --- src/components/onboarding/WelcomeDialog.tsx | 57 ++++++--------------- 1 file changed, 17 insertions(+), 40 deletions(-) diff --git a/src/components/onboarding/WelcomeDialog.tsx b/src/components/onboarding/WelcomeDialog.tsx index 572f662..c219265 100644 --- a/src/components/onboarding/WelcomeDialog.tsx +++ b/src/components/onboarding/WelcomeDialog.tsx @@ -1,25 +1,18 @@ - import React, { useState, useEffect } from "react"; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; +import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@/components/ui/dialog"; import { Button } from "@/components/ui/button"; import { Separator } from "@/components/ui/separator"; import { ArrowRight, Wallet, PieChart, LineChart } from "lucide-react"; import { Checkbox } from "@/components/ui/checkbox"; import { toast } from "sonner"; - interface WelcomeDialogProps { open: boolean; onClose: (dontShowAgain: boolean) => void; } - -const WelcomeDialog: React.FC = ({ open, onClose }) => { +const WelcomeDialog: React.FC = ({ + open, + onClose +}) => { const [dontShowAgain, setDontShowAgain] = useState(false); // 다이얼로그 열릴 때 localStorage 값 확인 @@ -34,7 +27,6 @@ const WelcomeDialog: React.FC = ({ open, onClose }) => { } } }, [open]); - const handleClose = () => { try { // 체크박스가 체크되어 있으면 localStorage에 저장 @@ -43,11 +35,11 @@ const WelcomeDialog: React.FC = ({ open, onClose }) => { localStorage.setItem('dontShowWelcome', 'true'); sessionStorage.setItem('dontShowWelcome', 'true'); console.log('WelcomeDialog - dontShowWelcome 값이 true로 저장되었습니다'); - + // 확인을 위한 즉시 재확인 const savedValue = localStorage.getItem('dontShowWelcome'); console.log('WelcomeDialog - 저장 직후 확인된 값:', savedValue); - + // 토스트 메시지로 사용자에게 알림 toast.success('환영 메시지가 다시 표시되지 않도록 설정되었습니다'); } else { @@ -59,18 +51,16 @@ const WelcomeDialog: React.FC = ({ open, onClose }) => { } catch (error) { console.error('WelcomeDialog - localStorage 저장 중 오류 발생:', error); } - + // 부모 컴포넌트에 상태 전달 onClose(dontShowAgain); }; - - return ( - { - if (!isOpen) handleClose(); - }}> + return { + if (!isOpen) handleClose(); + }}> - + 젤리의 적자탈출에 오신 것을 환영합니다! @@ -121,31 +111,18 @@ const WelcomeDialog: React.FC = ({ open, onClose }) => {
- setDontShowAgain(checked === true)} - className="focus:outline-none focus:ring-0 focus:ring-offset-0" - /> -
-
-
- ); +
; }; - -export default WelcomeDialog; +export default WelcomeDialog; \ No newline at end of file