Skip to content

Commit e459aaf

Browse files
committed
Update transaction type labels to use consistent casing and adjust styling logic
1 parent 71f5031 commit e459aaf

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed
Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FrontEnd/dist/index.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<!doctype html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<link rel="icon" href="/assets/CroppedImage-BxF6_1jf.png" type="image/png" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>PennyTracker</title>
8-
<script type="module" crossorigin src="/assets/index-bG1cR5qt.js"></script>
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/assets/CroppedImage-BxF6_1jf.png" type="image/png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>PennyTracker</title>
8+
<script type="module" crossorigin src="/assets/index-BlZ77C3m.js"></script>
99
<link rel="stylesheet" crossorigin href="/assets/index-CZzhD3MO.css">
10-
</head>
11-
<body>
12-
<div id="root"></div>
13-
</body>
14-
</html>
10+
</head>
11+
<body>
12+
<div id="root"></div>
13+
</body>
14+
</html>

FrontEnd/src/pages/TransactionTable.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ const TransactionTable = () => {
149149
</div>
150150

151151
<div className="flex flex-wrap gap-2">
152-
{["all", "Credited", "Debited"].map(type => (
152+
{["all", "CREDIT", "Debited"].map(type => (
153153
<button
154154
key={type}
155155
onClick={() => setFilter(type)}
156156
className={`px-4 py-2 rounded-md ${
157157
filter === type
158-
? (type === "Credited"
158+
? (type === "CREDIT"
159159
? "bg-green-600"
160160
: type === "Debited"
161161
? "bg-red-600"
@@ -226,7 +226,7 @@ const TransactionTable = () => {
226226
</td>
227227
<td
228228
className={`px-4 py-3 font-medium ${
229-
transaction.type === "Credited"
229+
transaction.type === "CREDIT"
230230
? "text-green-400"
231231
: "text-red-400"
232232
}`}
@@ -236,7 +236,7 @@ const TransactionTable = () => {
236236
<td className="px-4 py-3">
237237
<span
238238
className={`px-2 py-1 rounded-full text-xs font-medium ${
239-
transaction.type === "Credited"
239+
transaction.type === "CREDIT"
240240
? "bg-green-900 text-green-300"
241241
: "bg-red-900 text-red-300"
242242
}`}

FrontEnd/src/pages/Yearly.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const Yearly = () => {
114114
key={type}
115115
onClick={() => setFilter(type)}
116116
className={`px-4 py-2 rounded-md ${filter === type
117-
? (type === "Credited" ? "bg-green-600" : "bg-red-600")
117+
? (type === "Debited" ? "bg-red-600" : "bg-green-600")
118118
: "bg-gray-700 text-gray-300 hover:bg-gray-600"
119119
}`}
120120
>
@@ -157,11 +157,11 @@ const Yearly = () => {
157157
<td className="px-4 py-3">
158158
{formatDate(transaction.date)}
159159
</td>
160-
<td className={`px-4 py-3 font-medium ${transaction.type === "Credited" ? "text-green-400" : "text-red-400"}`}>
160+
<td className={`px-4 py-3 font-medium ${transaction.type === "Debited" ? "text-red-400" : "text-green-400"}`}>
161161
{formatAmount(transaction.amount)}
162162
</td>
163163
<td className="px-4 py-3">
164-
<span className={`px-2 py-1 rounded-full text-xs font-medium ${transaction.type === "Credited" ? "bg-green-900 text-green-300" : "bg-red-900 text-red-300"}`}>
164+
<span className={`px-2 py-1 rounded-full text-xs font-medium ${transaction.type === "Debited" ? "bg-red-900 text-red-300" : "bg-green-900 text-green-300"}`}>
165165
{transaction.type}
166166
</span>
167167
</td>

0 commit comments

Comments
 (0)