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,
|
valueClass,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
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">
|
<CardContent className="flex flex-col gap-2 p-6">
|
||||||
<div className="flex items-center justify-between">
|
<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}
|
{icon}
|
||||||
</div>
|
</div>
|
||||||
{trend !== undefined && (
|
{trend !== undefined && (
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
"text-xs font-medium",
|
"text-xs font-bold px-2 py-1 rounded-full",
|
||||||
trend > 0 ? "text-finance-green" : trend < 0 ? "text-finance-red" : "text-muted-foreground"
|
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}%
|
{trend > 0 && '+'}{trend}%
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1">
|
<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>
|
<p className={cn("text-2xl font-bold", valueClass)}>{value}</p>
|
||||||
{secondaryValue && (
|
{secondaryValue && (
|
||||||
<p className="text-sm text-muted-foreground">{secondaryValue}</p>
|
<p className="text-sm text-gray-500">{secondaryValue}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
@ -243,7 +243,7 @@ const TransactionsTable = ({
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell className={cn(
|
<TableCell className={cn(
|
||||||
"text-right font-medium",
|
"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))}
|
{formatCurrency(Math.abs(transaction.valor))}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
@ -254,16 +254,18 @@ const TransactionsTable = ({
|
|||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => handleEditTransaction(transaction)}
|
onClick={() => handleEditTransaction(transaction)}
|
||||||
title="Editar"
|
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>
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="icon"
|
size="icon"
|
||||||
onClick={() => handleDeleteClick(transaction)}
|
onClick={() => handleDeleteClick(transaction)}
|
||||||
title="Excluir"
|
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>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|||||||
@ -79,7 +79,7 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
|||||||
|
|
||||||
if (error) throw error;
|
if (error) throw error;
|
||||||
|
|
||||||
// Enviar dados para o webhook do N8N
|
// Enviar dados para o webhook do N8N usando modo no-cors
|
||||||
const webhookData = {
|
const webhookData = {
|
||||||
assunto: formData.assunto,
|
assunto: formData.assunto,
|
||||||
motivo: formData.motivo,
|
motivo: formData.motivo,
|
||||||
@ -93,24 +93,17 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
|||||||
try {
|
try {
|
||||||
console.log("Enviando dados para webhook N8N:", webhookData);
|
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', {
|
const webhookResponse = await fetch('https://webhookn8n.innova1001.com.br/webhook/faleconosco', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
mode: 'no-cors',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
body: JSON.stringify(webhookData),
|
body: JSON.stringify(webhookData),
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("Status da resposta do webhook:", webhookResponse.status);
|
console.log("Dados enviados para webhook N8N com sucesso");
|
||||||
|
|
||||||
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");
|
|
||||||
} catch (webhookError) {
|
} catch (webhookError) {
|
||||||
console.error("Erro ao enviar para webhook N8N:", webhookError);
|
console.error("Erro ao enviar para webhook N8N:", webhookError);
|
||||||
// Não interrompe o fluxo se o webhook falhar
|
// Não interrompe o fluxo se o webhook falhar
|
||||||
@ -118,7 +111,7 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
|||||||
|
|
||||||
toast({
|
toast({
|
||||||
title: "Mensagem enviada com sucesso!",
|
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
|
// Reset form
|
||||||
@ -148,12 +141,4 @@ const ContactForm = ({ onBack }: ContactFormProps) => {
|
|||||||
<ContactFormHeader onBack={onBack} />
|
<ContactFormHeader onBack={onBack} />
|
||||||
<ContactFormFields
|
<ContactFormFields
|
||||||
formData={formData}
|
formData={formData}
|
||||||
setFormData={setFormData}
|
setFormData={setForm
|
||||||
loading={loading}
|
|
||||||
onSubmit={handleSubmit}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default ContactForm;
|
|
||||||
@ -26,11 +26,18 @@ import {
|
|||||||
Crown,
|
Crown,
|
||||||
MessageSquareText,
|
MessageSquareText,
|
||||||
Users,
|
Users,
|
||||||
Settings
|
Settings,
|
||||||
|
Menu
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import OnboardingTour from '@/components/onboarding/OnboardingTour';
|
import OnboardingTour from '@/components/onboarding/OnboardingTour';
|
||||||
import HelpIcon from '@/components/help/HelpIcon';
|
import HelpIcon from '@/components/help/HelpIcon';
|
||||||
import { useOnboardingTour } from '@/hooks/useOnboardingTour';
|
import { useOnboardingTour } from '@/hooks/useOnboardingTour';
|
||||||
|
import {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
} from '@/components/ui/tooltip';
|
||||||
|
|
||||||
interface NewModernLayoutProps {
|
interface NewModernLayoutProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@ -202,7 +209,16 @@ export default function NewModernLayout({ children }: NewModernLayoutProps) {
|
|||||||
|
|
||||||
<SidebarInset className="flex-1">
|
<SidebarInset className="flex-1">
|
||||||
<header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
|
<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>
|
</header>
|
||||||
<main className="flex-1 overflow-y-auto">
|
<main className="flex-1 overflow-y-auto">
|
||||||
<div className="container mx-auto px-4 py-6">
|
<div className="container mx-auto px-4 py-6">
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
interface TransactionHeaderProps {
|
interface TransactionHeaderProps {
|
||||||
@ -14,7 +15,7 @@ export function TransactionHeader({
|
|||||||
return (
|
return (
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<button
|
<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}
|
disabled={disableAdicionar}
|
||||||
onClick={() => onOpenDialog('receita')}
|
onClick={() => onOpenDialog('receita')}
|
||||||
type="button"
|
type="button"
|
||||||
@ -22,7 +23,7 @@ export function TransactionHeader({
|
|||||||
Nova Receita
|
Nova Receita
|
||||||
</button>
|
</button>
|
||||||
<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}
|
disabled={disableAdicionar}
|
||||||
onClick={() => onOpenDialog('despesa')}
|
onClick={() => onOpenDialog('despesa')}
|
||||||
type="button"
|
type="button"
|
||||||
@ -30,7 +31,7 @@ export function TransactionHeader({
|
|||||||
Nova Despesa
|
Nova Despesa
|
||||||
</button>
|
</button>
|
||||||
<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}
|
disabled={disableAdicionar}
|
||||||
onClick={onOpenCartaoCreditoDialog}
|
onClick={onOpenCartaoCreditoDialog}
|
||||||
type="button"
|
type="button"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
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 {
|
interface TransactionSummaryCardsProps {
|
||||||
totalReceitas: number;
|
totalReceitas: number;
|
||||||
@ -21,48 +21,48 @@ export const TransactionSummaryCards = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid gap-4 md:grid-cols-3">
|
<div className="grid gap-4 md:grid-cols-3">
|
||||||
<Card>
|
<Card className="border-2 border-green-200 shadow-lg">
|
||||||
<CardHeader className="pb-2 bg-green-50">
|
<CardHeader className="pb-2 bg-green-50 rounded-t-lg">
|
||||||
<CardTitle className="text-finance-green flex items-center">
|
<CardTitle className="text-green-700 flex items-center font-bold">
|
||||||
<Wallet className="h-4 w-4 mr-2" />
|
<ArrowUp className="h-5 w-5 mr-2 text-green-600" />
|
||||||
Ganhos do mês
|
Ganhos do mês
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="pt-4">
|
<CardContent className="pt-4">
|
||||||
<p className="text-2xl font-bold text-finance-green">
|
<p className="text-2xl font-bold text-green-600">
|
||||||
{formatCurrency(totalReceitas)}
|
{formatCurrency(totalReceitas)}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card>
|
<Card className="border-2 border-red-200 shadow-lg">
|
||||||
<CardHeader className="pb-2 bg-red-50">
|
<CardHeader className="pb-2 bg-red-50 rounded-t-lg">
|
||||||
<CardTitle className="text-finance-red flex items-center">
|
<CardTitle className="text-red-700 flex items-center font-bold">
|
||||||
<ArrowDown className="h-4 w-4 mr-2" />
|
<ArrowDown className="h-5 w-5 mr-2 text-red-600" />
|
||||||
Gastos do mês
|
Gastos do mês
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="pt-4">
|
<CardContent className="pt-4">
|
||||||
<p className="text-2xl font-bold text-finance-red">
|
<p className="text-2xl font-bold text-red-600">
|
||||||
{formatCurrency(totalDespesas)}
|
{formatCurrency(totalDespesas)}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
<Card>
|
<Card className="border-2 border-blue-200 shadow-lg">
|
||||||
<CardHeader className="pb-2 bg-blue-50">
|
<CardHeader className="pb-2 bg-blue-50 rounded-t-lg">
|
||||||
<CardTitle className="text-finance-blue flex items-center">
|
<CardTitle className="text-blue-700 flex items-center font-bold">
|
||||||
<CreditCard className="h-4 w-4 mr-2" />
|
<CreditCard className="h-5 w-5 mr-2 text-blue-600" />
|
||||||
Gastos em cartões
|
Gastos em cartões
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="pt-4 space-y-1">
|
<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)}
|
{formatCurrency(totalCartoes)}
|
||||||
</p>
|
</p>
|
||||||
<div className="flex items-center justify-between pt-2 text-sm border-t">
|
<div className="flex items-center justify-between pt-2 text-sm border-t">
|
||||||
<span className="text-muted-foreground">Total geral:</span>
|
<span className="text-gray-600 font-medium">Total geral:</span>
|
||||||
<span className="font-medium text-finance-red">{formatCurrency(totalGeral)}</span>
|
<span className="font-bold text-red-600">{formatCurrency(totalGeral)}</span>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import Layout from '@/components/layout/Layout';
|
import Layout from '@/components/layout/Layout';
|
||||||
import SummaryCard from '@/components/dashboard/SummaryCard';
|
import SummaryCard from '@/components/dashboard/SummaryCard';
|
||||||
@ -168,34 +169,38 @@ const Dashboard = () => {
|
|||||||
<SummaryCard
|
<SummaryCard
|
||||||
title="Receitas"
|
title="Receitas"
|
||||||
value={formatCurrency(totals.receitas)}
|
value={formatCurrency(totals.receitas)}
|
||||||
icon={<ArrowUp size={20} className="text-finance-green" />}
|
icon={<ArrowUp size={24} className="text-green-600" />}
|
||||||
trend={5}
|
trend={5}
|
||||||
iconClass="bg-finance-green/10"
|
iconClass="bg-green-100"
|
||||||
valueClass="text-finance-green"
|
valueClass="text-green-700"
|
||||||
|
className="border-green-200 shadow-lg"
|
||||||
/>
|
/>
|
||||||
<SummaryCard
|
<SummaryCard
|
||||||
title="Despesas"
|
title="Despesas"
|
||||||
value={formatCurrency(totalDespesasGeral)}
|
value={formatCurrency(totalDespesasGeral)}
|
||||||
secondaryValue={`Cartões: ${formatCurrency(totals.cartoes)}`}
|
secondaryValue={`Cartões: ${formatCurrency(totals.cartoes)}`}
|
||||||
icon={<ArrowDown size={20} className="text-finance-red" />}
|
icon={<ArrowDown size={24} className="text-red-600" />}
|
||||||
trend={-2}
|
trend={-2}
|
||||||
iconClass="bg-finance-red/10"
|
iconClass="bg-red-100"
|
||||||
valueClass="text-finance-red"
|
valueClass="text-red-700"
|
||||||
|
className="border-red-200 shadow-lg"
|
||||||
/>
|
/>
|
||||||
<SummaryCard
|
<SummaryCard
|
||||||
title="Saldo"
|
title="Saldo"
|
||||||
value={formatCurrency(totals.saldo)}
|
value={formatCurrency(totals.saldo)}
|
||||||
icon={<Wallet size={20} className="text-finance-blue" />}
|
icon={<Wallet size={24} className="text-blue-600" />}
|
||||||
iconClass="bg-finance-blue/10"
|
iconClass="bg-blue-100"
|
||||||
valueClass="text-finance-blue"
|
valueClass="text-blue-700"
|
||||||
|
className="border-blue-200 shadow-lg"
|
||||||
/>
|
/>
|
||||||
<SummaryCard
|
<SummaryCard
|
||||||
title="Economia"
|
title="Economia"
|
||||||
value={`${totals.receitas > 0 ? ((totals.saldo / totals.receitas) * 100).toFixed(1) : 0}%`}
|
value={`${totals.receitas > 0 ? ((totals.saldo / totals.receitas) * 100).toFixed(1) : 0}%`}
|
||||||
secondaryValue={formatCurrency(totals.saldo)}
|
secondaryValue={formatCurrency(totals.saldo)}
|
||||||
icon={<PiggyBank size={20} className="text-finance-purple" />}
|
icon={<PiggyBank size={24} className="text-purple-600" />}
|
||||||
iconClass="bg-finance-purple/10"
|
iconClass="bg-purple-100"
|
||||||
valueClass="text-finance-purple"
|
valueClass="text-purple-700"
|
||||||
|
className="border-purple-200 shadow-lg"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user