Extract center column offset, reduce by 20px (#7974)

* extract offset, reduce by 20px

* move constant to `Layout/const.ts`
This commit is contained in:
Samuel Newman
2025-03-24 21:55:05 +02:00
committed by GitHub
parent 1b8719293c
commit 412b107420
6 changed files with 19 additions and 7 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ import {
web,
} from '#/alf'
import {useDialogContext} from '#/components/Dialog'
import {SCROLLBAR_OFFSET} from '#/components/Layout/const'
import {CENTER_COLUMN_OFFSET, SCROLLBAR_OFFSET} from '#/components/Layout/const'
import {ScrollbarOffsetContext} from '#/components/Layout/context'
export * from '#/components/Layout/const'
@@ -173,7 +173,7 @@ export const Center = React.memo(function LayoutContent({
centerColumnOffset &&
!ignoreTabletLayoutOffset &&
!isWithinDialog
? -150
? CENTER_COLUMN_OFFSET
: 0,
},
{translateX: web(SCROLLBAR_OFFSET) ?? 0},
@@ -209,7 +209,7 @@ const WebCenterBorders = React.memo(function LayoutContent() {
left: '50%',
transform: [
{translateX: '-50%'},
{translateX: centerColumnOffset ? -150 : 0},
{translateX: centerColumnOffset ? CENTER_COLUMN_OFFSET : 0},
...a.scrollbar_offset.transform,
],
}),