make the sidebar smaller when offset, reduce total offset (#8052)

This commit is contained in:
Samuel Newman
2025-03-24 22:23:27 +02:00
committed by GitHub
parent 412b107420
commit a48e64e72a
3 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -31,8 +31,8 @@ export function useBreakpoints(): Record<Breakpoint, boolean> & {
* Fine-tuned breakpoints for the shell layout * Fine-tuned breakpoints for the shell layout
*/ */
export function useLayoutBreakpoints() { export function useLayoutBreakpoints() {
const rightNavVisible = useMediaQuery({minWidth: 1075}) const rightNavVisible = useMediaQuery({minWidth: 1100})
const centerColumnOffset = useMediaQuery({minWidth: 1075, maxWidth: 1300}) const centerColumnOffset = useMediaQuery({minWidth: 1100, maxWidth: 1300})
const leftNavMinimal = useMediaQuery({maxWidth: 1300}) const leftNavMinimal = useMediaQuery({maxWidth: 1300})
return { return {
+1 -1
View File
@@ -18,4 +18,4 @@ export const HEADER_SLOT_SIZE = 34
/** /**
* How far to shift the center column when in the tablet breakpoint * How far to shift the center column when in the tablet breakpoint
*/ */
export const CENTER_COLUMN_OFFSET = -130 export const CENTER_COLUMN_OFFSET = -105
+6 -2
View File
@@ -58,6 +58,8 @@ export function DesktopRightNav({routeName}: {routeName: string}) {
return null return null
} }
const width = centerColumnOffset ? 250 : 300
return ( return (
<View <View
style={[ style={[
@@ -67,10 +69,12 @@ export function DesktopRightNav({routeName}: {routeName: string}) {
position: 'fixed', position: 'fixed',
left: '50%', left: '50%',
transform: [ transform: [
{translateX: 300 + (centerColumnOffset ? CENTER_COLUMN_OFFSET : 0)}, {
translateX: 300 + (centerColumnOffset ? CENTER_COLUMN_OFFSET : 0),
},
...a.scrollbar_offset.transform, ...a.scrollbar_offset.transform,
], ],
width: 300 + gutters.paddingLeft, width: width + gutters.paddingLeft,
maxHeight: '100%', maxHeight: '100%',
overflowY: 'auto', overflowY: 'auto',
}), }),