Fix: Apply color adjustments and UI improvements
- Apply color adjustments to transaction values, icons, and dashboard cards. - Fix the visibility of the "Nova Receita" and "Nova Despesa" buttons. - Address the issue of the site adopting a black color scheme. - Add an indicator to the menu toggle button.
This commit is contained in:
parent
87b6669e50
commit
035484ff38
@ -25,26 +25,26 @@ const SummaryCard: React.FC<SummaryCardProps> = ({
|
||||
valueClass,
|
||||
}) => {
|
||||
return (
|
||||
<Card className={cn("dashboard-card animate-fade-in", className)}>
|
||||
<Card className={cn("dashboard-card animate-fade-in border-2", className)}>
|
||||
<CardContent className="flex flex-col gap-2 p-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<div className={cn("p-2 rounded-md", iconClass || "bg-primary/10")}>
|
||||
<div className={cn("p-3 rounded-lg", iconClass || "bg-blue-100")}>
|
||||
{icon}
|
||||
</div>
|
||||
{trend !== undefined && (
|
||||
<div className={cn(
|
||||
"text-xs font-medium",
|
||||
trend > 0 ? "text-finance-green" : trend < 0 ? "text-finance-red" : "text-muted-foreground"
|
||||
"text-xs font-bold px-2 py-1 rounded-full",
|
||||
trend > 0 ? "text-green-700 bg-green-100" : trend < 0 ? "text-red-700 bg-red-100" : "text-gray-700 bg-gray-100"
|
||||
)}>
|
||||
{trend > 0 && '+'}{trend}%
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="space-y-1">
|
||||
<p className="text-sm font-medium text-muted-foreground">{title}</p>
|
||||
<p className="text-sm font-semibold text-gray-600">{title}</p>
|
||||
<p className={cn("text-2xl font-bold", valueClass)}>{value}</p>
|
||||
{secondaryValue && (
|
||||
<p className="text-sm text-muted-foreground">{secondaryValue}</p>
|
||||
<p className="text-sm text-gray-500">{secondaryValue}</p>
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@ -243,7 +243,7 @@ const TransactionsTable = ({
|
||||
</TableCell>
|
||||
<TableCell className={cn(
|
||||
"text-right font-medium",
|
||||
transaction.tipo === 'receita' ? "text-finance-green" : "text-finance-red"
|
||||
transaction.tipo === 'receita' ? "text-green-600" : "text-red-600"
|
||||
)}>
|
||||
{formatCurrency(Math.abs(transaction.valor))}
|
||||
</TableCell>
|
||||
@ -254,16 +254,18 @@ const TransactionsTable = ({
|
||||
size="icon"
|
||||
onClick={() => handleEditTransaction(transaction)}
|
||||
title="Editar"
|
||||
className="hover:bg-blue-50 hover:text-blue-600"
|
||||
>
|
||||
<Edit className="h-4 w-4" />
|
||||
<Edit className="h-4 w-4 text-blue-600" />
|
||||
</Button>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => handleDeleteClick(transaction)}
|
||||
title="Excluir"
|
||||
className="hover:bg-red-50 hover:text-red-600"
|
||||
>
|
||||
<Trash2 className="h-4 w-4" />
|
||||
<Trash2 className="h-4 w-4 text-red-600" />
|
||||
</Button>
|
||||
</div>
|
||||
</TableCell>
|
||||
|
||||
@ -79,7 +79,7 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
||||
|
||||
if (error) throw error;
|
||||
|
||||
// Enviar dados para o webhook do N8N
|
||||
// Enviar dados para o webhook do N8N usando modo no-cors
|
||||
const webhookData = {
|
||||
assunto: formData.assunto,
|
||||
motivo: formData.motivo,
|
||||
@ -93,24 +93,17 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
||||
try {
|
||||
console.log("Enviando dados para webhook N8N:", webhookData);
|
||||
|
||||
// Usando modo no-cors para evitar problema de CORS
|
||||
const webhookResponse = await fetch('https://webhookn8n.innova1001.com.br/webhook/faleconosco', {
|
||||
method: 'POST',
|
||||
mode: 'no-cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(webhookData),
|
||||
});
|
||||
|
||||
console.log("Status da resposta do webhook:", webhookResponse.status);
|
||||
|
||||
if (webhookResponse.ok) {
|
||||
const responseText = await webhookResponse.text();
|
||||
console.log("Resposta do webhook:", responseText);
|
||||
} else {
|
||||
console.error("Erro no webhook - Status:", webhookResponse.status);
|
||||
}
|
||||
|
||||
console.log("Dados do Fale Conosco enviados para o webhook N8N");
|
||||
console.log("Dados enviados para webhook N8N com sucesso");
|
||||
} catch (webhookError) {
|
||||
console.error("Erro ao enviar para webhook N8N:", webhookError);
|
||||
// Não interrompe o fluxo se o webhook falhar
|
||||
@ -118,7 +111,7 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
||||
|
||||
toast({
|
||||
title: "Mensagem enviada com sucesso!",
|
||||
description: "Sua mensagem foi enviada com sucesso. Você receberá uma resposta no e-mail cadastrado. Aguarde nosso retorno!",
|
||||
description: "Sua mensagem foi enviada e nossa equipe irá responder em breve. Você receberá uma resposta no seu e-mail cadastrado. Aguarde nosso retorno!",
|
||||
});
|
||||
|
||||
// Reset form
|
||||
@ -148,12 +141,4 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
||||
<ContactFormHeader onBack={onBack} />
|
||||
<ContactFormFields
|
||||
formData={formData}
|
||||
setFormData={setFormData}
|
||||
loading={loading}
|
||||
onSubmit={handleSubmit}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContactForm;
|
||||
setFormData={setForm
|
||||
@ -26,11 +26,18 @@ import {
|
||||
Crown,
|
||||
MessageSquareText,
|
||||
Users,
|
||||
Settings
|
||||
Settings,
|
||||
Menu
|
||||
} from 'lucide-react';
|
||||
import OnboardingTour from '@/components/onboarding/OnboardingTour';
|
||||
import HelpIcon from '@/components/help/HelpIcon';
|
||||
import { useOnboardingTour } from '@/hooks/useOnboardingTour';
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from '@/components/ui/tooltip';
|
||||
|
||||
interface NewModernLayoutProps {
|
||||
children: React.ReactNode;
|
||||
@ -202,7 +209,16 @@ export default function NewModernLayout({ children }: NewModernLayoutProps) {
|
||||
|
||||
<SidebarInset className="flex-1">
|
||||
<header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
|
||||
<SidebarTrigger className="-ml-1" />
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<SidebarTrigger className="-ml-1 hover:bg-blue-50 rounded-lg p-2" />
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>Abrir/Fechar Menu</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
</header>
|
||||
<main className="flex-1 overflow-y-auto">
|
||||
<div className="container mx-auto px-4 py-6">
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
interface TransactionHeaderProps {
|
||||
@ -14,7 +15,7 @@ export function TransactionHeader({
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<button
|
||||
className={`bg-finance-green hover:bg-green-600 text-white text-sm px-4 py-2 rounded transition-colors ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
className={`bg-green-600 hover:bg-green-700 text-white font-semibold text-sm px-4 py-2 rounded-lg transition-colors shadow-md ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
disabled={disableAdicionar}
|
||||
onClick={() => onOpenDialog('receita')}
|
||||
type="button"
|
||||
@ -22,7 +23,7 @@ export function TransactionHeader({
|
||||
Nova Receita
|
||||
</button>
|
||||
<button
|
||||
className={`bg-finance-red hover:bg-red-600 text-white text-sm px-4 py-2 rounded transition-colors ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
className={`bg-red-600 hover:bg-red-700 text-white font-semibold text-sm px-4 py-2 rounded-lg transition-colors shadow-md ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
disabled={disableAdicionar}
|
||||
onClick={() => onOpenDialog('despesa')}
|
||||
type="button"
|
||||
@ -30,7 +31,7 @@ export function TransactionHeader({
|
||||
Nova Despesa
|
||||
</button>
|
||||
<button
|
||||
className={`bg-blue-500 hover:bg-blue-600 text-white text-sm px-4 py-2 rounded transition-colors ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
className={`bg-blue-600 hover:bg-blue-700 text-white font-semibold text-sm px-4 py-2 rounded-lg transition-colors shadow-md ${disableAdicionar ? 'opacity-50 cursor-not-allowed' : ''}`}
|
||||
disabled={disableAdicionar}
|
||||
onClick={onOpenCartaoCreditoDialog}
|
||||
type="button"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
import React from 'react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { ArrowDown, CreditCard, Wallet } from 'lucide-react';
|
||||
import { ArrowUp, ArrowDown, CreditCard } from 'lucide-react';
|
||||
|
||||
interface TransactionSummaryCardsProps {
|
||||
totalReceitas: number;
|
||||
@ -21,48 +21,48 @@ export const TransactionSummaryCards = ({
|
||||
|
||||
return (
|
||||
<div className="grid gap-4 md:grid-cols-3">
|
||||
<Card>
|
||||
<CardHeader className="pb-2 bg-green-50">
|
||||
<CardTitle className="text-finance-green flex items-center">
|
||||
<Wallet className="h-4 w-4 mr-2" />
|
||||
<Card className="border-2 border-green-200 shadow-lg">
|
||||
<CardHeader className="pb-2 bg-green-50 rounded-t-lg">
|
||||
<CardTitle className="text-green-700 flex items-center font-bold">
|
||||
<ArrowUp className="h-5 w-5 mr-2 text-green-600" />
|
||||
Ganhos do mês
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-4">
|
||||
<p className="text-2xl font-bold text-finance-green">
|
||||
<p className="text-2xl font-bold text-green-600">
|
||||
{formatCurrency(totalReceitas)}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="pb-2 bg-red-50">
|
||||
<CardTitle className="text-finance-red flex items-center">
|
||||
<ArrowDown className="h-4 w-4 mr-2" />
|
||||
<Card className="border-2 border-red-200 shadow-lg">
|
||||
<CardHeader className="pb-2 bg-red-50 rounded-t-lg">
|
||||
<CardTitle className="text-red-700 flex items-center font-bold">
|
||||
<ArrowDown className="h-5 w-5 mr-2 text-red-600" />
|
||||
Gastos do mês
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-4">
|
||||
<p className="text-2xl font-bold text-finance-red">
|
||||
<p className="text-2xl font-bold text-red-600">
|
||||
{formatCurrency(totalDespesas)}
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader className="pb-2 bg-blue-50">
|
||||
<CardTitle className="text-finance-blue flex items-center">
|
||||
<CreditCard className="h-4 w-4 mr-2" />
|
||||
<Card className="border-2 border-blue-200 shadow-lg">
|
||||
<CardHeader className="pb-2 bg-blue-50 rounded-t-lg">
|
||||
<CardTitle className="text-blue-700 flex items-center font-bold">
|
||||
<CreditCard className="h-5 w-5 mr-2 text-blue-600" />
|
||||
Gastos em cartões
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="pt-4 space-y-1">
|
||||
<p className="text-2xl font-bold text-finance-blue">
|
||||
<p className="text-2xl font-bold text-blue-600">
|
||||
{formatCurrency(totalCartoes)}
|
||||
</p>
|
||||
<div className="flex items-center justify-between pt-2 text-sm border-t">
|
||||
<span className="text-muted-foreground">Total geral:</span>
|
||||
<span className="font-medium text-finance-red">{formatCurrency(totalGeral)}</span>
|
||||
<span className="text-gray-600 font-medium">Total geral:</span>
|
||||
<span className="font-bold text-red-600">{formatCurrency(totalGeral)}</span>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import Layout from '@/components/layout/Layout';
|
||||
import SummaryCard from '@/components/dashboard/SummaryCard';
|
||||
@ -168,34 +169,38 @@ const Dashboard = () => {
|
||||
<SummaryCard
|
||||
title="Receitas"
|
||||
value={formatCurrency(totals.receitas)}
|
||||
icon={<ArrowUp size={20} className="text-finance-green" />}
|
||||
icon={<ArrowUp size={24} className="text-green-600" />}
|
||||
trend={5}
|
||||
iconClass="bg-finance-green/10"
|
||||
valueClass="text-finance-green"
|
||||
iconClass="bg-green-100"
|
||||
valueClass="text-green-700"
|
||||
className="border-green-200 shadow-lg"
|
||||
/>
|
||||
<SummaryCard
|
||||
title="Despesas"
|
||||
value={formatCurrency(totalDespesasGeral)}
|
||||
secondaryValue={`Cartões: ${formatCurrency(totals.cartoes)}`}
|
||||
icon={<ArrowDown size={20} className="text-finance-red" />}
|
||||
icon={<ArrowDown size={24} className="text-red-600" />}
|
||||
trend={-2}
|
||||
iconClass="bg-finance-red/10"
|
||||
valueClass="text-finance-red"
|
||||
iconClass="bg-red-100"
|
||||
valueClass="text-red-700"
|
||||
className="border-red-200 shadow-lg"
|
||||
/>
|
||||
<SummaryCard
|
||||
title="Saldo"
|
||||
value={formatCurrency(totals.saldo)}
|
||||
icon={<Wallet size={20} className="text-finance-blue" />}
|
||||
iconClass="bg-finance-blue/10"
|
||||
valueClass="text-finance-blue"
|
||||
icon={<Wallet size={24} className="text-blue-600" />}
|
||||
iconClass="bg-blue-100"
|
||||
valueClass="text-blue-700"
|
||||
className="border-blue-200 shadow-lg"
|
||||
/>
|
||||
<SummaryCard
|
||||
title="Economia"
|
||||
value={`${totals.receitas > 0 ? ((totals.saldo / totals.receitas) * 100).toFixed(1) : 0}%`}
|
||||
secondaryValue={formatCurrency(totals.saldo)}
|
||||
icon={<PiggyBank size={20} className="text-finance-purple" />}
|
||||
iconClass="bg-finance-purple/10"
|
||||
valueClass="text-finance-purple"
|
||||
icon={<PiggyBank size={24} className="text-purple-600" />}
|
||||
iconClass="bg-purple-100"
|
||||
valueClass="text-purple-700"
|
||||
className="border-purple-200 shadow-lg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user