Fix: Calendar transaction color
Corrects the transaction color in the calendar view. Expenses are now displayed in red, and income is displayed in green.
This commit is contained in:
parent
98fb2f72ec
commit
0a14aec425
@ -123,15 +123,15 @@ const CalendarioPage = () => {
|
|||||||
<div key={transaction.id} className="p-4 border rounded-md hover:bg-muted/50 transition-colors">
|
<div key={transaction.id} className="p-4 border rounded-md hover:bg-muted/50 transition-colors">
|
||||||
<div className="flex justify-between items-center mb-1">
|
<div className="flex justify-between items-center mb-1">
|
||||||
<div className="font-medium">{transaction.estabelecimento}</div>
|
<div className="font-medium">{transaction.estabelecimento}</div>
|
||||||
<Badge variant={transaction.tipo === 'entrada' ? "success" : "destructive"}>
|
<Badge variant={transaction.tipo.toLowerCase() === 'entrada' ? "success" : "destructive"}>
|
||||||
{transaction.tipo === 'entrada' ? 'Receita' : 'Despesa'}
|
{transaction.tipo.toLowerCase() === 'entrada' ? 'Receita' : 'Despesa'}
|
||||||
</Badge>
|
</Badge>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-sm text-muted-foreground mb-2">{transaction.detalhes}</div>
|
<div className="text-sm text-muted-foreground mb-2">{transaction.detalhes}</div>
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<Badge variant="outline">{transaction.categoria}</Badge>
|
<Badge variant="outline">{transaction.categoria}</Badge>
|
||||||
<span className={transaction.tipo === 'entrada' ? "text-finance-green font-medium" : "text-finance-red font-medium"}>
|
<span className={transaction.tipo.toLowerCase() === 'entrada' ? "text-finance-green font-medium" : "text-finance-red font-medium"}>
|
||||||
{transaction.tipo === 'entrada' ? '+' : '-'}{formatCurrency(Math.abs(transaction.valor))}
|
{transaction.tipo.toLowerCase() === 'entrada' ? '+' : '-'}{formatCurrency(Math.abs(transaction.valor))}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user