Prepare for Capacitor integration
This commit prepares the codebase for potential integration with Capacitor to build a mobile application.
This commit is contained in:
@@ -2,9 +2,25 @@
|
||||
import React, { useState } from 'react';
|
||||
import { PlusIcon, MinusIcon, X } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const AddTransactionButton = () => {
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleAddExpense = () => {
|
||||
// 여기에 지출 추가 로직을 구현할 수 있습니다
|
||||
setIsOpen(false);
|
||||
// 향후 트랜잭션 추가 페이지로 이동할 수 있습니다
|
||||
// navigate('/add-transaction', { state: { type: 'expense' } });
|
||||
};
|
||||
|
||||
const handleAddIncome = () => {
|
||||
// 여기에 수입 추가 로직을 구현할 수 있습니다
|
||||
setIsOpen(false);
|
||||
// 향후 트랜잭션 추가 페이지로 이동할 수 있습니다
|
||||
// navigate('/add-transaction', { state: { type: 'income' } });
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="fixed bottom-24 right-6 z-20">
|
||||
@@ -12,14 +28,14 @@ const AddTransactionButton = () => {
|
||||
<div className="absolute bottom-16 right-0 flex flex-col gap-3 items-end animate-slide-up">
|
||||
<button
|
||||
className="neuro-flat p-4 text-neuro-expense flex items-center gap-2"
|
||||
onClick={() => setIsOpen(false)}
|
||||
onClick={handleAddExpense}
|
||||
>
|
||||
<span className="text-sm font-medium">지출</span>
|
||||
<MinusIcon size={18} />
|
||||
</button>
|
||||
<button
|
||||
className="neuro-flat p-4 text-neuro-income flex items-center gap-2"
|
||||
onClick={() => setIsOpen(false)}
|
||||
onClick={handleAddIncome}
|
||||
>
|
||||
<span className="text-sm font-medium">수입</span>
|
||||
<PlusIcon size={18} />
|
||||
@@ -35,6 +51,7 @@ const AddTransactionButton = () => {
|
||||
: "bg-neuro-accent shadow-neuro-flat hover:shadow-neuro-convex animate-pulse-subtle"
|
||||
)}
|
||||
onClick={() => setIsOpen(!isOpen)}
|
||||
aria-label={isOpen ? "닫기" : "거래 추가"}
|
||||
>
|
||||
{isOpen ? <X size={24} /> : <PlusIcon size={24} />}
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user