ajustes no nav bar
This commit is contained in:
parent
f14742b312
commit
2bf3635d4d
1 changed files with 99 additions and 66 deletions
|
|
@ -32,7 +32,7 @@ const dropdownItemClassName = ({ isActive }: { isActive: boolean }) =>
|
|||
"flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-sm font-bold transition-all duration-200",
|
||||
isActive
|
||||
? "bg-brand/10 text-brand"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main",
|
||||
);
|
||||
|
||||
export function AppShell() {
|
||||
|
|
@ -87,16 +87,16 @@ export function AppShell() {
|
|||
<div className="relative">
|
||||
<button
|
||||
onClick={() => setShowOrgSwitcher(!showOrgSwitcher)}
|
||||
className="flex items-center gap-2 rounded-xl border border-border-soft bg-surface-muted/50 px-4 py-2 text-sm font-bold transition-all hover:bg-surface-muted group"
|
||||
className="flex w-48 items-center gap-2 rounded-xl border border-border-soft bg-surface-muted/50 px-4 py-2 text-sm font-bold transition-all hover:bg-surface-muted group"
|
||||
>
|
||||
<div className="flex h-6 w-6 items-center justify-center rounded-lg bg-brand/10 text-brand group-hover:bg-brand group-hover:text-white transition-all">
|
||||
<Building2 size={14} />
|
||||
</div>
|
||||
<div className="text-left hidden sm:block">
|
||||
<span className="block text-xs text-text-main leading-tight truncate max-w-[120px]">
|
||||
<div className="text-left hidden sm:block flex-1 min-w-0">
|
||||
<span className="block text-xs text-text-main leading-tight truncate">
|
||||
{activeOrg?.name || "Selecionar Org"}
|
||||
</span>
|
||||
<span className="block text-[10px] text-text-muted font-black uppercase tracking-tighter leading-none">
|
||||
<span className="block text-[10px] text-text-muted font-black uppercase tracking-tighter leading-none truncate">
|
||||
{activeOrg?.roles[0] || "Visitante"}
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -118,7 +118,7 @@ export function AppShell() {
|
|||
<motion.div
|
||||
initial={{ opacity: 0, y: 10 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
className="absolute left-0 mt-2 z-50 w-64 rounded-2xl border border-border-soft bg-surface p-2 shadow-xl shadow-brand/10"
|
||||
className="absolute left-0 mt-2 z-50 w-48 rounded-2xl border border-border-soft bg-surface p-2 shadow-xl shadow-brand/10"
|
||||
>
|
||||
<div className="px-3 py-2 text-[10px] font-black uppercase tracking-widest text-text-muted">
|
||||
Suas Organizações
|
||||
|
|
@ -185,13 +185,13 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/"
|
||||
className={({ isActive }) => {
|
||||
const isBoardActive = window.location.pathname === '/board';
|
||||
const isBoardActive = window.location.pathname === "/board";
|
||||
const active = isActive || isBoardActive;
|
||||
return cn(
|
||||
"inline-flex items-center gap-2 rounded-xl px-4 py-2 text-sm font-semibold transition-all duration-200",
|
||||
active || showTasksDropdown
|
||||
? "bg-brand text-white shadow-md shadow-brand/20"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main",
|
||||
);
|
||||
}}
|
||||
onClick={(e) => {
|
||||
|
|
@ -201,7 +201,13 @@ export function AppShell() {
|
|||
>
|
||||
<ListTodo size={18} />
|
||||
Tarefas
|
||||
<ChevronDown size={14} className={cn("transition-transform", showTasksDropdown && "rotate-180")} />
|
||||
<ChevronDown
|
||||
size={14}
|
||||
className={cn(
|
||||
"transition-transform",
|
||||
showTasksDropdown && "rotate-180",
|
||||
)}
|
||||
/>
|
||||
</NavLink>
|
||||
|
||||
{showTasksDropdown && (
|
||||
|
|
@ -227,7 +233,9 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/board"
|
||||
onClick={() => setShowTasksDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Columns size={18} />
|
||||
Quadro
|
||||
|
|
@ -247,14 +255,16 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/organizations"
|
||||
className={({ isActive }) => {
|
||||
const isRequestsActive = window.location.pathname === '/requests';
|
||||
const isAdminActive = window.location.pathname === '/admin';
|
||||
const active = isActive || isRequestsActive || isAdminActive;
|
||||
const isRequestsActive =
|
||||
window.location.pathname === "/requests";
|
||||
const isAdminActive = window.location.pathname === "/admin";
|
||||
const active =
|
||||
isActive || isRequestsActive || isAdminActive;
|
||||
return cn(
|
||||
"inline-flex items-center gap-2 rounded-xl px-4 py-2 text-sm font-semibold transition-all duration-200",
|
||||
active || showOrgDropdown
|
||||
? "bg-brand text-white shadow-md shadow-brand/20"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main"
|
||||
: "text-text-muted hover:bg-surface-muted hover:text-text-main",
|
||||
);
|
||||
}}
|
||||
onClick={(e) => {
|
||||
|
|
@ -264,7 +274,13 @@ export function AppShell() {
|
|||
>
|
||||
<Building2 size={18} />
|
||||
Organizações
|
||||
<ChevronDown size={14} className={cn("transition-transform", showOrgDropdown && "rotate-180")} />
|
||||
<ChevronDown
|
||||
size={14}
|
||||
className={cn(
|
||||
"transition-transform",
|
||||
showOrgDropdown && "rotate-180",
|
||||
)}
|
||||
/>
|
||||
</NavLink>
|
||||
|
||||
{showOrgDropdown && (
|
||||
|
|
@ -289,21 +305,27 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/requests"
|
||||
onClick={() => setShowOrgDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Clock size={18} />
|
||||
Solicitações
|
||||
Minhas Solicitações
|
||||
</NavLink>
|
||||
{user?.organizations.some(
|
||||
(org) => org.roles.includes("OWNER") || org.roles.includes("ADMIN")
|
||||
(org) =>
|
||||
org.roles.includes("OWNER") ||
|
||||
org.roles.includes("ADMIN"),
|
||||
) && (
|
||||
<NavLink
|
||||
to="/admin"
|
||||
onClick={() => setShowOrgDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Settings size={18} />
|
||||
Gestão da Org
|
||||
Solicitações Pendentes
|
||||
</NavLink>
|
||||
)}
|
||||
</motion.div>
|
||||
|
|
@ -344,9 +366,11 @@ export function AppShell() {
|
|||
onClick={() => setShowTasksDropdown(!showTasksDropdown)}
|
||||
className={cn(
|
||||
navLinkClassName({
|
||||
isActive: window.location.pathname === '/' || window.location.pathname === '/board'
|
||||
isActive:
|
||||
window.location.pathname === "/" ||
|
||||
window.location.pathname === "/board",
|
||||
}),
|
||||
"flex-col gap-0.5 py-1"
|
||||
"flex-col gap-0.5 py-1",
|
||||
)}
|
||||
>
|
||||
<ListTodo size={20} />
|
||||
|
|
@ -376,7 +400,9 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/board"
|
||||
onClick={() => setShowTasksDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Columns size={18} />
|
||||
Quadro
|
||||
|
|
@ -396,11 +422,12 @@ export function AppShell() {
|
|||
onClick={() => setShowOrgDropdown(!showOrgDropdown)}
|
||||
className={cn(
|
||||
navLinkClassName({
|
||||
isActive: window.location.pathname === '/organizations' ||
|
||||
window.location.pathname === '/requests' ||
|
||||
window.location.pathname === '/admin'
|
||||
isActive:
|
||||
window.location.pathname === "/organizations" ||
|
||||
window.location.pathname === "/requests" ||
|
||||
window.location.pathname === "/admin",
|
||||
}),
|
||||
"flex-col gap-0.5 py-1"
|
||||
"flex-col gap-0.5 py-1",
|
||||
)}
|
||||
>
|
||||
<Building2 size={20} />
|
||||
|
|
@ -429,18 +456,24 @@ export function AppShell() {
|
|||
<NavLink
|
||||
to="/requests"
|
||||
onClick={() => setShowOrgDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Clock size={18} />
|
||||
Pedidos
|
||||
</NavLink>
|
||||
{user?.organizations.some(
|
||||
(org) => org.roles.includes("OWNER") || org.roles.includes("ADMIN")
|
||||
(org) =>
|
||||
org.roles.includes("OWNER") ||
|
||||
org.roles.includes("ADMIN"),
|
||||
) && (
|
||||
<NavLink
|
||||
to="/admin"
|
||||
onClick={() => setShowOrgDropdown(false)}
|
||||
className={(props) => cn(dropdownItemClassName(props), "mt-1")}
|
||||
className={(props) =>
|
||||
cn(dropdownItemClassName(props), "mt-1")
|
||||
}
|
||||
>
|
||||
<Settings size={18} />
|
||||
Gestão
|
||||
|
|
|
|||
Loading…
Reference in a new issue