-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathpatch.py
More file actions
65 lines (63 loc) · 3.88 KB
/
Copy pathpatch.py
File metadata and controls
65 lines (63 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import sys
# AmountInput.tsx
content = open("src/components/AmountInput.tsx").read()
content = content.replace(
' <span className="font-semibold text-foreground">\n {formatMoney(creditLine.available)}',
' <span className="font-semibold text-foreground tabular-nums">\n {formatMoney(creditLine.available)}'
)
content = content.replace(
'className="text-2xl font-bold bg-transparent outline-none flex-1 text-foreground placeholder:text-muted/50 min-w-0"',
'className="text-2xl font-bold bg-transparent outline-none flex-1 text-foreground placeholder:text-muted/50 min-w-0 tabular-nums"'
)
content = content.replace(
'<p className="text-sm font-semibold text-foreground">\n {formatMoney(validation.minAmount)}',
'<p className="text-sm font-semibold text-foreground tabular-nums">\n {formatMoney(validation.minAmount)}'
)
content = content.replace(
'<p className="text-sm font-semibold text-foreground">\n {formatMoney(validation.maxAmount)}',
'<p className="text-sm font-semibold text-foreground tabular-nums">\n {formatMoney(validation.maxAmount)}'
)
content = content.replace(
'<p className="text-sm font-semibold text-foreground">\n {formatMoney(validation.recommendedReserve)}',
'<p className="text-sm font-semibold text-foreground tabular-nums">\n {formatMoney(validation.recommendedReserve)}'
)
content = content.replace(
'<span className="font-semibold text-foreground">\n {formatMoney(numAmount)}',
'<span className="font-semibold text-foreground tabular-nums">\n {formatMoney(numAmount)}'
)
content = content.replace(
'className={`font-semibold ${validation.remainingCredit < validation.recommendedReserve && numAmount > 0 ? "text-amber-400" : "text-foreground"}`}',
'className={`font-semibold tabular-nums ${validation.remainingCredit < validation.recommendedReserve && numAmount > 0 ? "text-amber-400" : "text-foreground"}`}'
)
open("src/components/AmountInput.tsx", "w").write(content)
# ConfirmationStep.tsx
content = open("src/components/ConfirmationStep.tsx").read()
content = content.replace(
'<p className="mt-1 text-3xl font-bold text-foreground">\n {formatMoney(safeAmount)}',
'<p className="mt-1 text-3xl font-bold text-foreground tabular-nums">\n {formatMoney(safeAmount)}'
)
content = content.replace(
'<p className="mt-1 font-semibold text-foreground">\n {formatMoney(fee)}',
'<p className="mt-1 font-semibold text-foreground tabular-nums">\n {formatMoney(fee)}'
)
content = content.replace(
'<p className="mt-1 font-semibold text-foreground">\n {formatMoney(estimatedMonthlyInterest)}',
'<p className="mt-1 font-semibold text-foreground tabular-nums">\n {formatMoney(estimatedMonthlyInterest)}'
)
content = content.replace(
'<p className="mt-1 font-semibold text-foreground">\n {formatMoney(newBalance)}',
'<p className="mt-1 font-semibold text-foreground tabular-nums">\n {formatMoney(newBalance)}'
)
content = content.replace(
'<p className="mt-1 font-semibold text-foreground">\n {formatMoney(remainingAvailable)}',
'<p className="mt-1 font-semibold text-foreground tabular-nums">\n {formatMoney(remainingAvailable)}'
)
content = content.replace(
'<span className="font-semibold text-foreground">\n {creditLine.utilization}%',
'<span className="font-semibold text-foreground tabular-nums">\n {creditLine.utilization}%'
)
content = content.replace(
'className={`font-semibold ${newUtilization > 80 ? "text-yellow-500" : "text-foreground"}`}',
'className={`font-semibold tabular-nums ${newUtilization > 80 ? "text-yellow-500" : "text-foreground"}`}'
)
open("src/components/ConfirmationStep.tsx", "w").write(content)