mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-05 09:33:07 +00:00
fix(ui): prevent logo from overlapping macOS traffic light buttons
Add platform detection to apply additional left padding (pl-20) and top padding (pt-4) on macOS to prevent the sidebar header/logo from overlapping with the native window control buttons (close, minimize, maximize). Fixes #176
This commit is contained in:
@@ -3,6 +3,10 @@ import { cn } from '@/lib/utils';
|
|||||||
import { AutomakerLogo } from './automaker-logo';
|
import { AutomakerLogo } from './automaker-logo';
|
||||||
import { BugReportButton } from './bug-report-button';
|
import { BugReportButton } from './bug-report-button';
|
||||||
|
|
||||||
|
// Detect if running on macOS for traffic light button spacing
|
||||||
|
const isMac =
|
||||||
|
typeof navigator !== 'undefined' && navigator.platform.toUpperCase().indexOf('MAC') >= 0;
|
||||||
|
|
||||||
interface SidebarHeaderProps {
|
interface SidebarHeaderProps {
|
||||||
sidebarOpen: boolean;
|
sidebarOpen: boolean;
|
||||||
navigate: (opts: NavigateOptions) => void;
|
navigate: (opts: NavigateOptions) => void;
|
||||||
@@ -20,7 +24,9 @@ export function SidebarHeader({ sidebarOpen, navigate }: SidebarHeaderProps) {
|
|||||||
// Background gradient for depth
|
// Background gradient for depth
|
||||||
'bg-gradient-to-b from-transparent to-background/5',
|
'bg-gradient-to-b from-transparent to-background/5',
|
||||||
'flex items-center',
|
'flex items-center',
|
||||||
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center'
|
sidebarOpen ? 'px-3 lg:px-5 justify-start' : 'px-3 justify-center',
|
||||||
|
// Add left padding on macOS to avoid overlapping with traffic light buttons
|
||||||
|
isMac && 'pt-4 pl-20'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<AutomakerLogo sidebarOpen={sidebarOpen} navigate={navigate} />
|
<AutomakerLogo sidebarOpen={sidebarOpen} navigate={navigate} />
|
||||||
|
|||||||
Reference in New Issue
Block a user