fix(core): add margin to scrollbar when clientBorder has no style (#6867)

close #6684

https://github.com/toeverything/AFFiNE/assets/102217452/9de18009-c718-4bdd-88fd-caafdb5b419c
This commit is contained in:
JimmFly 2024-05-11 05:44:48 +00:00
parent e2b057cb93
commit b8a1fbd6c7
No known key found for this signature in database
GPG Key ID: 14A6F56854E1BED7
2 changed files with 11 additions and 1 deletions

View File

@ -32,3 +32,7 @@ export const affineDocViewport = style({
},
},
});
export const scrollbar = style({
marginRight: '4px',
});

View File

@ -1,6 +1,7 @@
import { Scrollable } from '@affine/component';
import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
import { PageAIOnboarding } from '@affine/core/components/affine/ai-onboarding';
import { useAppSettingHelper } from '@affine/core/hooks/affine/use-app-setting-helper';
import type { PageRootService } from '@blocksuite/blocks';
import {
BookmarkService,
@ -90,6 +91,7 @@ const DetailPageImpl = memo(function DetailPageImpl() {
const rightSidebar = useService(RightSidebarService).rightSidebar;
const docCollection = workspace.docCollection;
const mode = useLiveData(doc.mode$);
const { appSettings } = useAppSettingHelper();
const isActiveView = useIsActiveView();
// TODO: remove jotai here
@ -252,7 +254,11 @@ const DetailPageImpl = memo(function DetailPageImpl() {
docCollection={docCollection}
/>
</Scrollable.Viewport>
<Scrollable.Scrollbar />
<Scrollable.Scrollbar
className={clsx({
[styles.scrollbar]: !appSettings.clientBorder,
})}
/>
</Scrollable.Root>
</AffineErrorBoundary>
{isInTrash ? <TrashPageFooter /> : null}