fix(Diversos): Ajusta diversos pequenos pontos da aplicação
This commit is contained in:
parent
36dba45995
commit
27d0b7e2de
5 changed files with 68 additions and 112 deletions
54
src/app/(protected)/page.tsx
Normal file
54
src/app/(protected)/page.tsx
Normal file
|
|
@ -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<Date | null>(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 (
|
||||
<main className="fixed inset-0 flex flex-col items-center justify-center text-gray-800 overflow-hidden select-none">
|
||||
<section className="text-center max-w-md px-4">
|
||||
<h1 className="text-4xl font-bold mb-2">
|
||||
{greeting},{' '}
|
||||
<span className="text-blue-600">{userAuthenticated.data.nome}</span>{' '}
|
||||
👋
|
||||
</h1>
|
||||
|
||||
<p className="text-gray-600 text-sm mb-6">
|
||||
Hoje é <strong>{formattedDate}</strong>, {formattedTime}
|
||||
</p>
|
||||
|
||||
<div className="rounded-2xl p-6">
|
||||
<p className="text-gray-700 leading-relaxed">
|
||||
Que bom ter você de volta! 🎉
|
||||
Aproveite o seu dia e continue alcançando seus objetivos.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ export function NavMain({
|
|||
}) {
|
||||
return (
|
||||
<SidebarGroup>
|
||||
<SidebarGroupLabel>Platform</SidebarGroupLabel>
|
||||
|
||||
<SidebarGroupLabel>
|
||||
SAAS
|
||||
</SidebarGroupLabel>
|
||||
<SidebarMenu>
|
||||
{items.map((item) => (
|
||||
<Collapsible
|
||||
|
|
@ -45,13 +46,10 @@ export function NavMain({
|
|||
<CollapsibleTrigger asChild>
|
||||
<SidebarMenuButton tooltip={item.title}>
|
||||
{item.icon && <item.icon />}
|
||||
|
||||
<span>{item.title}</span>
|
||||
|
||||
<ChevronRight className="ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" />
|
||||
</SidebarMenuButton>
|
||||
</CollapsibleTrigger>
|
||||
|
||||
<CollapsibleContent>
|
||||
<SidebarMenuSub>
|
||||
{item.items?.map((subItem) => (
|
||||
|
|
|
|||
|
|
@ -32,7 +32,9 @@ export function NavProjects({
|
|||
|
||||
return (
|
||||
<SidebarGroup className="group-data-[collapsible=icon]:hidden">
|
||||
<SidebarGroupLabel>Projects</SidebarGroupLabel>
|
||||
<SidebarGroupLabel>
|
||||
Escrituras
|
||||
</SidebarGroupLabel>
|
||||
<SidebarMenu>
|
||||
{projects.map((item) => (
|
||||
<SidebarMenuItem key={item.name}>
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue