From 27d0b7e2de38cb5076514301fec5af2157ea30d1 Mon Sep 17 00:00:00 2001 From: keven Date: Wed, 8 Oct 2025 18:23:39 -0300 Subject: [PATCH] =?UTF-8?q?fix(Diversos):=20Ajusta=20diversos=20pequenos?= =?UTF-8?q?=20pontos=20da=20aplica=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/(protected)/page.tsx | 54 +++++++++++++++ src/components/app-sidebar.tsx | 112 ++------------------------------ src/components/nav-main.tsx | 8 +-- src/components/nav-projects.tsx | 4 +- src/components/ui/sidebar.tsx | 2 +- 5 files changed, 68 insertions(+), 112 deletions(-) create mode 100644 src/app/(protected)/page.tsx diff --git a/src/app/(protected)/page.tsx b/src/app/(protected)/page.tsx new file mode 100644 index 0000000..a1f4581 --- /dev/null +++ b/src/app/(protected)/page.tsx @@ -0,0 +1,54 @@ +'use client'; + +import useGUsuarioGetJWTHook from '@/shared/hooks/auth/useGUsuarioGetJWTHook'; +import { useEffect, useState } from 'react'; + +export default function Page() { + const { userAuthenticated } = useGUsuarioGetJWTHook(); + + // Inicializa time como null para renderizar só no cliente + const [time, setTime] = useState(null); + + useEffect(() => { + setTime(new Date()); // define data inicial no cliente + const interval = setInterval(() => setTime(new Date()), 1000); + return () => clearInterval(interval); + }, []); + + // Se ainda não temos a hora, renderiza nada para evitar mismatch + if (!time || !userAuthenticated?.data) return null; + + const hours = time.getHours(); + const greeting = + hours < 12 ? 'Bom dia' : hours < 18 ? 'Boa tarde' : 'Boa noite'; + + const formattedDate = time.toLocaleDateString('pt-BR', { + weekday: 'long', + day: '2-digit', + month: 'long', + }); + const formattedTime = time.toLocaleTimeString('pt-BR'); + + return ( +
+
+

+ {greeting},{' '} + {userAuthenticated.data.nome}{' '} + 👋 +

+ +

+ Hoje é {formattedDate}, {formattedTime} +

+ +
+

+ Que bom ter você de volta! 🎉 + Aproveite o seu dia e continue alcançando seus objetivos. +

+
+
+
+ ); +} diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index 4d1d164..1c67503 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -2,17 +2,11 @@ import * as React from 'react'; import { - AudioWaveform, - BookOpen, Bot, - Command, Frame, GalleryVerticalEnd, House, HouseIcon, - Map, - PieChart, - Settings2, SquareTerminal, UsersIcon, } from 'lucide-react'; @@ -36,41 +30,13 @@ import Image from 'next/image'; // This is sample data. const data = { - teams: [ - { - name: 'Acme Inc', - logo: GalleryVerticalEnd, - plan: 'Enterprise', - }, - { - name: 'Acme Corp.', - logo: AudioWaveform, - plan: 'Startup', - }, - { - name: 'Evil Corp.', - logo: Command, - plan: 'Free', - }, - ], + teams: [], navMain: [ - { - title: 'Início', - url: '#', - icon: House, - isActive: false, - items: [ - { - title: 'Serviços', - url: '/servicos/', - }, - ], - }, { title: 'Administrativo', url: '#', icon: SquareTerminal, - isActive: true, + isActive: false, items: [ { title: 'Usuários', @@ -147,10 +113,6 @@ const data = { title: 'Tipo de Medida', url: '/cadastros/medida-tipo', }, - { - title: 'Natureza Litígio (Censec)', - url: '/cadastros/censec-natureza-litigio', - }, { title: 'Pessoas', url: '/cadastros/pessoas/complementos/', @@ -164,91 +126,31 @@ const data = { url: '/cadastros/minuta/', }, { - title: 'Regimes/Comunhão', - url: '/cadastros/regime-comunhao/', + title: "Censec/Tipo do Ato", + url: "/cadastros/censec-tipoato" }, { title: 'Censec/Centrais', url: '/cadastros/censec/', }, { - title: "Censec Tipo Ato", - url: "/cadastros/censec-tipoato" + title: 'Censec/Natureza Litígio', + url: '/cadastros/censec-natureza-litigio', }, { title: "Regimes/Comunhão", url: "/cadastros/regime-comunhao/", }, - { - title: 'Censec/Centrais', - url: '/cadastros/censec/', - }, ], }, - { - title: 'Documentation', - url: '#', - icon: BookOpen, - items: [ - { - title: 'Introduction', - url: '#', - }, - { - title: 'Get Started', - url: '#', - }, - { - title: 'Tutorials', - url: '#', - }, - { - title: 'Changelog', - url: '#', - }, - ], - }, - { - title: 'Settings', - url: '#', - icon: Settings2, - items: [ - { - title: 'General', - url: '#', - }, - { - title: 'Team', - url: '#', - }, - { - title: 'Billing', - url: '#', - }, - { - title: 'Limits', - url: '#', - }, - ], - }, ], projects: [ { - name: 'Design Engineering', + name: 'Escritura Publica de Compra e Venda', url: '#', icon: Frame, }, - { - name: 'Sales & Marketing', - url: '#', - icon: PieChart, - }, - { - name: 'Travel', - url: '#', - icon: Map, - }, ], }; diff --git a/src/components/nav-main.tsx b/src/components/nav-main.tsx index a4359de..7b62742 100644 --- a/src/components/nav-main.tsx +++ b/src/components/nav-main.tsx @@ -31,8 +31,9 @@ export function NavMain({ }) { return ( - Platform - + + SAAS + {items.map((item) => ( {item.icon && } - {item.title} - - {item.items?.map((subItem) => ( diff --git a/src/components/nav-projects.tsx b/src/components/nav-projects.tsx index c465a1b..904b5ef 100644 --- a/src/components/nav-projects.tsx +++ b/src/components/nav-projects.tsx @@ -32,7 +32,9 @@ export function NavProjects({ return ( - Projects + + Escrituras + {projects.map((item) => ( diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx index d3d8082..d4dc14f 100644 --- a/src/components/ui/sidebar.tsx +++ b/src/components/ui/sidebar.tsx @@ -548,7 +548,7 @@ function SidebarMenuAction({ 'peer-data-[size=lg]/menu-button:top-2.5', 'group-data-[collapsible=icon]:hidden', showOnHover && - 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0', + 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0', className, )} {...props}