Skip to content

Commit

Permalink
Ensure only bordering areas of app are draggable (#82)
Browse files Browse the repository at this point in the history
Ensures it's only possible to click and drag the bordering areas of the app. The left sidebar remains draggable, also.
  • Loading branch information
Siobhan Bamber committed May 7, 2024
1 parent a342b0c commit c6a0b37
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function App() {
scrollbarGutter: 'stable',
} }
data-testid="site-content"
className="p-8 bg-white overflow-y-auto h-full flex-grow rounded-chrome"
className="py-8 pr-8 bg-white overflow-y-auto h-full flex-grow rounded-chrome"
>
<SiteContentTabs />
</main>
Expand Down
7 changes: 6 additions & 1 deletion src/components/main-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ export default function MainSidebar( { className }: MainSidebarProps ) {
>
<SidebarToolbar />
<div className="flex flex-col h-full">
<div className="flex-1 overflow-y-auto sites-scrollbar">
<div
className={ cx(
'flex-1 overflow-y-auto sites-scrollbar app-no-drag-region',
isMac() ? 'ml-5' : 'ml-4'
) }
>
<SiteMenu />
</div>
<div className="flex flex-col gap-4 pt-5 border-white border-t border-opacity-10 app-no-drag-region">
Expand Down
2 changes: 1 addition & 1 deletion src/components/site-content-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function SiteContentTabs() {
}

return (
<div className="flex flex-col w-full h-full app-no-drag-region">
<div className="flex flex-col w-full h-full pl-8 app-no-drag-region">
<Header />
<TabPanel className="mt-6 h-full flex flex-col" tabs={ tabs } orientation="horizontal">
{ ( { name } ) => (
Expand Down
4 changes: 2 additions & 2 deletions src/components/site-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function SiteItem( { site }: { site: SiteDetails } ) {
<li
className={ cx(
'flex flex-row min-w-[168px] h-8 hover:bg-[#ffffff0C] rounded transition-all',
isMac() ? 'mx-5' : 'mx-4',
isMac() ? 'mr-5' : 'mr-4',
isSelected && 'bg-[#ffffff19] hover:bg-[#ffffff19]'
) }
>
Expand All @@ -127,7 +127,7 @@ export default function SiteMenu( { className }: SiteMenuProps ) {
scrollbarGutter: 'stable',
} }
className={ cx(
'w-full overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 pb-4 app-no-drag-region',
'w-full overflow-y-auto overflow-x-hidden flex flex-col gap-0.5 pb-4',
className
) }
>
Expand Down

0 comments on commit c6a0b37

Please sign in to comment.