Skip to content

Commit

Permalink
oh boy
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank committed Oct 16, 2024
1 parent 623a411 commit c2613c1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions packages/react/src/PageLayout/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ const Root: React.FC<React.PropsWithChildren<PageLayoutProps>> = ({

const [slots, rest] = useSlots(children, slotsConfig ?? {header: Header, footer: Footer})

console.log(SPACING_MAP[columnGap])

Check failure on line 86 in packages/react/src/PageLayout/PageLayout.tsx

View workflow job for this annotation

GitHub Actions / lint

Unexpected console statement

return (
<PageLayoutContext.Provider
value={{
Expand All @@ -98,10 +100,11 @@ const Root: React.FC<React.PropsWithChildren<PageLayoutProps>> = ({
>
<Box
ref={rootRef}
style={{
style={theme => ({
// @ts-ignore TypeScript doesn't know about CSS custom properties
'--sticky-pane-height': stickyPaneHeight,
}}
'--pageLayout-columnGap': theme.space[SPACING_MAP[columnGap]],
})}
sx={merge<BetterSystemStyleObject>({padding: SPACING_MAP[padding]}, sx)}
>
<Box
Expand Down Expand Up @@ -218,6 +221,10 @@ const DraggingGlobalStyles = createGlobalStyle`
body[data-page-layout-dragging="true"] * {
user-select: none;
}
:root {
--pageLayout-columnGap: 5px;
}
`

const VerticalDivider: React.FC<React.PropsWithChildren<DividerProps & DraggableDividerProps>> = ({
Expand Down Expand Up @@ -762,8 +769,8 @@ const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayout
}
: {}),
...(position === 'end'
? {flexDirection: 'row-reverse', marginLeft: SPACING_MAP[columnGap]}
: {flexDirection: 'row', marginRight: SPACING_MAP[columnGap]}),
? {flexDirection: 'row-reverse', marginLeft: 'var(--pageLayout-columnGap)'}
: {flexDirection: 'row', marginRight: 'var(--pageLayout-columnGap)'}),
},
},
sx,
Expand Down Expand Up @@ -812,7 +819,7 @@ const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayout
}}
// If pane is resizable, the divider should be draggable
draggable={resizable}
sx={{[position === 'end' ? 'marginRight' : 'marginLeft']: SPACING_MAP[columnGap]}}
sx={{[position === 'end' ? 'marginRight' : 'marginLeft']: 'var(--pageLayout-columnGap)'}}
onDrag={(delta, isKeyboard = false) => {
// Get the number of pixels the divider was dragged
let deltaWithDirection
Expand Down

0 comments on commit c2613c1

Please sign in to comment.