Skip to content

Commit b159dc9

Browse files
committed
fix: remove dead code and TODO comments in transaction purchase routes
The loader in dashboard.purchase.verify already redirects users away when their transaction status is VERIFIED, so the disabled prop on action buttons was unreachable dead code. Remove it and clean up TODO comments that are no longer relevant.
1 parent 81528aa commit b159dc9

4 files changed

Lines changed: 158 additions & 11 deletions

File tree

.zed/settings.json

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
// Kelas Rumah Berbagi - Remix + React + TypeScript + Tailwind
3+
"tab_size": 2,
4+
"hard_tabs": false,
5+
"format_on_save": "on",
6+
"preferred_line_length": 120,
7+
8+
"languages": {
9+
"TypeScript": {
10+
"tab_size": 2,
11+
"formatter": {
12+
"external": {
13+
"command": "npx",
14+
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
15+
}
16+
},
17+
"format_on_save": "on"
18+
},
19+
"TSX": {
20+
"tab_size": 2,
21+
"formatter": {
22+
"external": {
23+
"command": "npx",
24+
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
25+
}
26+
},
27+
"format_on_save": "on"
28+
},
29+
"JavaScript": {
30+
"tab_size": 2,
31+
"formatter": {
32+
"external": {
33+
"command": "npx",
34+
"arguments": ["prettier", "--stdin-filepath", "{buffer_path}"]
35+
}
36+
}
37+
},
38+
"CSS": {
39+
"tab_size": 2
40+
},
41+
"JSON": {
42+
"tab_size": 2
43+
},
44+
"YAML": {
45+
"tab_size": 2
46+
},
47+
"Prisma": {
48+
"format_on_save": "on",
49+
"formatter": "language_server"
50+
}
51+
},
52+
53+
"lsp": {
54+
"typescript-language-server": {
55+
"initialization_options": {
56+
"preferences": {
57+
"includeInlayParameterNameHints": "literals",
58+
"includeInlayFunctionParameterTypeHints": true,
59+
"includeInlayVariableTypeHints": false,
60+
"includeInlayPropertyDeclarationTypeHints": true,
61+
"includeInlayFunctionLikeReturnTypeHints": true
62+
}
63+
}
64+
},
65+
"eslint": {
66+
"settings": {
67+
"validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"]
68+
}
69+
},
70+
"tailwindcss-language-server": {
71+
"settings": {
72+
"includeLanguages": {
73+
"typescriptreact": "html",
74+
"javascriptreact": "html"
75+
}
76+
}
77+
}
78+
},
79+
80+
// Exclude from search (mirrors VS Code settings)
81+
"file_scan_exclusions": [
82+
".cache/**",
83+
"node_modules/**",
84+
"build/**",
85+
"public/build/**",
86+
".git/**"
87+
]
88+
}

.zed/tasks.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"label": "test: run all",
4+
"command": "npm",
5+
"args": ["test"],
6+
"tags": ["js-test"]
7+
},
8+
{
9+
"label": "test: watch",
10+
"command": "npm",
11+
"args": ["run", "test:watch"],
12+
"tags": ["js-test"]
13+
},
14+
{
15+
"label": "test: e2e",
16+
"command": "npm",
17+
"args": ["run", "test:e2e:run"],
18+
"tags": ["js-test"]
19+
},
20+
{
21+
"label": "dev: start server",
22+
"command": "npm",
23+
"args": ["run", "dev"],
24+
"tags": ["js-dev"]
25+
},
26+
{
27+
"label": "build: production",
28+
"command": "npm",
29+
"args": ["run", "build"],
30+
"tags": ["js-build"]
31+
},
32+
{
33+
"label": "lint: check",
34+
"command": "npm",
35+
"args": ["run", "lint"],
36+
"tags": ["js-lint"]
37+
},
38+
{
39+
"label": "lint: fix",
40+
"command": "npm",
41+
"args": ["run", "lint:fix"],
42+
"tags": ["js-lint"]
43+
},
44+
{
45+
"label": "format: all",
46+
"command": "npm",
47+
"args": ["run", "format"],
48+
"tags": ["js-format"]
49+
},
50+
{
51+
"label": "typecheck",
52+
"command": "npm",
53+
"args": ["run", "type-check"],
54+
"tags": ["js-typecheck"]
55+
},
56+
{
57+
"label": "prisma: migrate",
58+
"command": "npx",
59+
"args": ["prisma", "migrate", "dev"],
60+
"tags": ["prisma"]
61+
},
62+
{
63+
"label": "prisma: studio",
64+
"command": "npx",
65+
"args": ["prisma", "studio"],
66+
"tags": ["prisma"]
67+
}
68+
]

app/routes/dashboard.purchase.completed.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ export default function Completed() {
4343
}>()
4444
return (
4545
<>
46-
{/* TODO: Render action buttons conditionally */}
4746
<TransactionDetails transaction={transaction} user={user}>
4847
<SecondaryButtonLink to={getWhatsAppLink(authorPhoneNumber)} external>
4948
Kontak Admin

app/routes/dashboard.purchase.verify.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,11 @@ export default function Verify() {
3434
useLoaderData<{ transaction: Transaction; user: User }>()
3535
return (
3636
<>
37-
{/* TODO: Render action buttons conditionally */}
3837
<TransactionDetails transaction={transaction} user={user}>
39-
<SecondaryButtonLink
40-
to="/dashboard/purchase/confirm"
41-
disabled={transaction.status === TRANSACTION_STATUS.VERIFIED}
42-
>
38+
<SecondaryButtonLink to="/dashboard/purchase/confirm">
4339
Ubah Detail Transaksi
4440
</SecondaryButtonLink>
45-
<PrimaryButtonLink
46-
to={transaction.id}
47-
replace
48-
disabled={transaction.status === TRANSACTION_STATUS.VERIFIED}
49-
>
41+
<PrimaryButtonLink to={transaction.id} replace>
5042
Verifikasi Pembelian
5143
</PrimaryButtonLink>
5244
</TransactionDetails>

0 commit comments

Comments
 (0)