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