refactor: standardize code formatting and improve readability across multiple components, including transaction handling and sidebar layout adjustments

This commit is contained in:
Julien Froidefond
2025-12-08 09:28:09 +01:00
parent 11c0df1293
commit cb8628ce39
10 changed files with 80 additions and 86 deletions

View File

@@ -77,10 +77,7 @@ function SidebarContent({
</div>
)}
<nav className={cn(
"flex-1 space-y-2",
collapsed ? "p-2" : "p-4"
)}>
<nav className={cn("flex-1 space-y-2", collapsed ? "p-2" : "p-4")}>
{navItems.map((item) => {
const isActive = pathname === item.href;
return (
@@ -117,10 +114,12 @@ function SidebarContent({
})}
</nav>
<div className={cn(
"border-t border-border/30 space-y-2",
collapsed ? "p-2" : "p-4"
)}>
<div
className={cn(
"border-t border-border/30 space-y-2",
collapsed ? "p-2" : "p-4",
)}
>
<Link href="/settings" onClick={handleLinkClick}>
<Button
variant="ghost"
@@ -186,10 +185,12 @@ export function Sidebar({ open, onOpenChange }: SidebarProps) {
collapsed ? "w-16" : "w-64",
)}
>
<div className={cn(
"flex items-center border-b border-border/30 transition-all duration-300",
collapsed ? "justify-center p-4" : "justify-between p-6"
)}>
<div
className={cn(
"flex items-center border-b border-border/30 transition-all duration-300",
collapsed ? "justify-center p-4" : "justify-between p-6",
)}
>
{!collapsed && (
<div className="flex items-center gap-3">
<div className="w-12 h-12 rounded-2xl bg-gradient-to-br from-primary via-primary/90 to-primary/80 flex items-center justify-center shadow-xl shadow-primary/30 backdrop-blur-sm">
@@ -206,7 +207,7 @@ export function Sidebar({ open, onOpenChange }: SidebarProps) {
onClick={() => setCollapsed(!collapsed)}
className={cn(
"hover:bg-muted/60 rounded-xl transition-all duration-300 hover:scale-110",
collapsed ? "" : "ml-auto"
collapsed ? "" : "ml-auto",
)}
>
{collapsed ? (