Visual edit in Lovable
Edited UI in Lovable
This commit is contained in:
@@ -1,68 +1,58 @@
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import NavBar from '@/components/NavBar';
|
||||
import TransactionCard, { Transaction } from '@/components/TransactionCard';
|
||||
import AddTransactionButton from '@/components/AddTransactionButton';
|
||||
import { Calendar, Search, ChevronLeft, ChevronRight } from 'lucide-react';
|
||||
|
||||
const Transactions = () => {
|
||||
const [selectedMonth, setSelectedMonth] = useState('8월');
|
||||
|
||||
|
||||
// Sample data - in a real app, this would come from a data source
|
||||
const transactions: Transaction[] = [
|
||||
{
|
||||
id: '1',
|
||||
title: '식료품 구매',
|
||||
amount: 25000,
|
||||
date: '8월 25일, 12:30 PM',
|
||||
category: 'shopping',
|
||||
type: 'expense'
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
title: '주유소',
|
||||
amount: 50000,
|
||||
date: '8월 24일, 3:45 PM',
|
||||
category: 'transportation',
|
||||
type: 'expense'
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
title: '월급',
|
||||
amount: 2500000,
|
||||
date: '8월 20일, 9:00 AM',
|
||||
category: 'income',
|
||||
type: 'income'
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
title: '아마존 프라임',
|
||||
amount: 9900,
|
||||
date: '8월 18일, 6:00 AM',
|
||||
category: 'entertainment',
|
||||
type: 'expense'
|
||||
},
|
||||
{
|
||||
id: '5',
|
||||
title: '집세',
|
||||
amount: 650000,
|
||||
date: '8월 15일, 10:00 AM',
|
||||
category: 'housing',
|
||||
type: 'expense'
|
||||
},
|
||||
{
|
||||
id: '6',
|
||||
title: '카페',
|
||||
amount: 5500,
|
||||
date: '8월 12일, 2:15 PM',
|
||||
category: 'food',
|
||||
type: 'expense'
|
||||
},
|
||||
];
|
||||
const transactions: Transaction[] = [{
|
||||
id: '1',
|
||||
title: '식료품 구매',
|
||||
amount: 25000,
|
||||
date: '8월 25일, 12:30 PM',
|
||||
category: 'shopping',
|
||||
type: 'expense'
|
||||
}, {
|
||||
id: '2',
|
||||
title: '주유소',
|
||||
amount: 50000,
|
||||
date: '8월 24일, 3:45 PM',
|
||||
category: 'transportation',
|
||||
type: 'expense'
|
||||
}, {
|
||||
id: '3',
|
||||
title: '월급',
|
||||
amount: 2500000,
|
||||
date: '8월 20일, 9:00 AM',
|
||||
category: 'income',
|
||||
type: 'income'
|
||||
}, {
|
||||
id: '4',
|
||||
title: '아마존 프라임',
|
||||
amount: 9900,
|
||||
date: '8월 18일, 6:00 AM',
|
||||
category: 'entertainment',
|
||||
type: 'expense'
|
||||
}, {
|
||||
id: '5',
|
||||
title: '집세',
|
||||
amount: 650000,
|
||||
date: '8월 15일, 10:00 AM',
|
||||
category: 'housing',
|
||||
type: 'expense'
|
||||
}, {
|
||||
id: '6',
|
||||
title: '카페',
|
||||
amount: 5500,
|
||||
date: '8월 12일, 2:15 PM',
|
||||
category: 'food',
|
||||
type: 'expense'
|
||||
}];
|
||||
|
||||
// Group transactions by date
|
||||
const groupedTransactions: Record<string, Transaction[]> = {};
|
||||
|
||||
transactions.forEach(transaction => {
|
||||
const datePart = transaction.date.split(',')[0];
|
||||
if (!groupedTransactions[datePart]) {
|
||||
@@ -70,22 +60,16 @@ const Transactions = () => {
|
||||
}
|
||||
groupedTransactions[datePart].push(transaction);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-neuro-background pb-24">
|
||||
return <div className="min-h-screen bg-neuro-background pb-24">
|
||||
<div className="max-w-md mx-auto px-6">
|
||||
{/* Header */}
|
||||
<header className="py-8">
|
||||
<h1 className="text-2xl font-bold neuro-text mb-5">거래 내역</h1>
|
||||
<h1 className="text-2xl font-bold neuro-text mb-5">지출 내역</h1>
|
||||
|
||||
{/* Search */}
|
||||
<div className="neuro-pressed mb-5 flex items-center px-4 py-3 rounded-xl">
|
||||
<Search size={18} className="text-gray-500 mr-2" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="거래 검색..."
|
||||
className="bg-transparent flex-1 outline-none text-sm"
|
||||
/>
|
||||
<input type="text" placeholder="거래 검색..." className="bg-transparent flex-1 outline-none text-sm" />
|
||||
</div>
|
||||
|
||||
{/* Month Selector */}
|
||||
@@ -119,8 +103,7 @@ const Transactions = () => {
|
||||
|
||||
{/* Transactions By Date */}
|
||||
<div className="space-y-6">
|
||||
{Object.entries(groupedTransactions).map(([date, transactions]) => (
|
||||
<div key={date}>
|
||||
{Object.entries(groupedTransactions).map(([date, transactions]) => <div key={date}>
|
||||
<div className="flex items-center gap-2 mb-3">
|
||||
<div className="h-1 flex-1 neuro-pressed"></div>
|
||||
<h2 className="text-sm font-medium text-gray-500">{date}</h2>
|
||||
@@ -128,19 +111,14 @@ const Transactions = () => {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-3">
|
||||
{transactions.map(transaction => (
|
||||
<TransactionCard key={transaction.id} transaction={transaction} />
|
||||
))}
|
||||
{transactions.map(transaction => <TransactionCard key={transaction.id} transaction={transaction} />)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AddTransactionButton />
|
||||
<NavBar />
|
||||
</div>
|
||||
);
|
||||
</div>;
|
||||
};
|
||||
|
||||
export default Transactions;
|
||||
export default Transactions;
|
||||
Reference in New Issue
Block a user