From 77a966c87c8bc654693974839e8b4732338b1b89 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 03:02:01 +0000 Subject: [PATCH] Show expense dialog directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modify the AddTransactionButton component to directly show the expense input dialog when the button is clicked, instead of showing the "지출" option first. --- src/components/AddTransactionButton.tsx | 33 ++++--------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/src/components/AddTransactionButton.tsx b/src/components/AddTransactionButton.tsx index 6c6681a..1a0f477 100644 --- a/src/components/AddTransactionButton.tsx +++ b/src/components/AddTransactionButton.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; -import { PlusIcon, MinusIcon, X } from 'lucide-react'; +import { PlusIcon, X } from 'lucide-react'; import { cn } from '@/lib/utils'; import { useNavigate } from 'react-router-dom'; import { Dialog, DialogContent, DialogHeader, DialogTitle } from './ui/dialog'; @@ -16,7 +16,6 @@ interface ExpenseFormValues { } const AddTransactionButton = () => { - const [isOpen, setIsOpen] = useState(false); const [showExpenseDialog, setShowExpenseDialog] = useState(false); const navigate = useNavigate(); @@ -28,11 +27,6 @@ const AddTransactionButton = () => { } }); - const handleAddExpense = () => { - setIsOpen(false); - setShowExpenseDialog(true); - }; - const onSubmit = (data: ExpenseFormValues) => { console.log('Expense data:', data); setShowExpenseDialog(false); @@ -42,29 +36,12 @@ const AddTransactionButton = () => { return ( <>
- {isOpen && ( -
- -
- )} -