mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
feat: sqlite subdocument (#2816)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
@@ -181,7 +181,6 @@ export const useZoomControls = ({
|
||||
}
|
||||
}, [imageRef]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = (event: WheelEvent) => {
|
||||
const { deltaY } = event;
|
||||
|
||||
@@ -62,7 +62,6 @@ export const imagePreviewModalCloseButtonStyle = style({
|
||||
zIndex: 1,
|
||||
marginTop: '38px',
|
||||
marginRight: '38px',
|
||||
|
||||
});
|
||||
|
||||
export const imagePreviewModalGoStyle = style({
|
||||
|
||||
@@ -5,7 +5,14 @@ import { useMediaQuery, useTheme } from '@mui/material';
|
||||
import type React from 'react';
|
||||
import { type CSSProperties } from 'react';
|
||||
|
||||
import { ScrollableContainer, Table, TableBody, TableCell, TableHead, TableHeadRow } from '../..';
|
||||
import {
|
||||
ScrollableContainer,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeadRow,
|
||||
} from '../..';
|
||||
import { TableBodyRow } from '../../ui/table';
|
||||
import { useHasScrollTop } from '../app-sidebar/sidebar-containers/use-has-scroll-top';
|
||||
import { AllPagesBody } from './all-pages-body';
|
||||
@@ -141,12 +148,9 @@ export const PageList = ({
|
||||
? DEFAULT_SORT_KEY
|
||||
: undefined;
|
||||
|
||||
return (
|
||||
sorter.data.length === 0 && fallback ?
|
||||
<StyledTableContainer>
|
||||
{fallback}
|
||||
</StyledTableContainer>
|
||||
:
|
||||
return sorter.data.length === 0 && fallback ? (
|
||||
<StyledTableContainer>{fallback}</StyledTableContainer>
|
||||
) : (
|
||||
<ScrollableContainer inTableView>
|
||||
<StyledTableContainer ref={ref}>
|
||||
<Table showBorder={hasScrollTop} style={{ maxHeight: '100%' }}>
|
||||
@@ -158,7 +162,6 @@ export const PageList = ({
|
||||
importFile={onImportFile}
|
||||
/>
|
||||
<AllPagesBody
|
||||
|
||||
isPublicWorkspace={isPublicWorkspace}
|
||||
groupKey={groupKey}
|
||||
data={sorter.data}
|
||||
@@ -246,12 +249,9 @@ export const PageListTrashView: React.FC<{
|
||||
}
|
||||
);
|
||||
|
||||
return (
|
||||
list.length === 0 && fallback ?
|
||||
<StyledTableContainer>
|
||||
{fallback}
|
||||
</StyledTableContainer>
|
||||
:
|
||||
return list.length === 0 && fallback ? (
|
||||
<StyledTableContainer>{fallback}</StyledTableContainer>
|
||||
) : (
|
||||
<ScrollableContainer inTableView>
|
||||
<StyledTableContainer ref={ref}>
|
||||
<Table showBorder={hasScrollTop}>
|
||||
|
||||
@@ -1 +1 @@
|
||||
export * from './scrollbar';
|
||||
export * from './scrollbar';
|
||||
|
||||
@@ -15,29 +15,27 @@ export const ScrollableContainer = ({
|
||||
showScrollTopBorder = false,
|
||||
inTableView = false,
|
||||
}: PropsWithChildren<ScrollableContainerProps>) => {
|
||||
const [hasScrollTop, ref] = useHasScrollTop();
|
||||
return (
|
||||
<ScrollArea.Root className={styles.scrollableContainerRoot}>
|
||||
<div
|
||||
data-has-scroll-top={hasScrollTop}
|
||||
className={clsx({[styles.scrollTopBorder]:showScrollTopBorder})}
|
||||
/>
|
||||
<ScrollArea.Viewport
|
||||
className={clsx([styles.scrollableViewport])}
|
||||
ref={ref}
|
||||
>
|
||||
<div className={styles.scrollableContainer}>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
</ScrollArea.Viewport>
|
||||
<ScrollArea.Scrollbar
|
||||
|
||||
orientation="vertical"
|
||||
className={clsx(styles.scrollbar,{[styles.TableScrollbar]:inTableView})}
|
||||
>
|
||||
<ScrollArea.Thumb className={styles.scrollbarThumb} />
|
||||
</ScrollArea.Scrollbar>
|
||||
</ScrollArea.Root>
|
||||
);
|
||||
}
|
||||
const [hasScrollTop, ref] = useHasScrollTop();
|
||||
return (
|
||||
<ScrollArea.Root className={styles.scrollableContainerRoot}>
|
||||
<div
|
||||
data-has-scroll-top={hasScrollTop}
|
||||
className={clsx({ [styles.scrollTopBorder]: showScrollTopBorder })}
|
||||
/>
|
||||
<ScrollArea.Viewport
|
||||
className={clsx([styles.scrollableViewport])}
|
||||
ref={ref}
|
||||
>
|
||||
<div className={styles.scrollableContainer}>{children}</div>
|
||||
</ScrollArea.Viewport>
|
||||
<ScrollArea.Scrollbar
|
||||
orientation="vertical"
|
||||
className={clsx(styles.scrollbar, {
|
||||
[styles.TableScrollbar]: inTableView,
|
||||
})}
|
||||
>
|
||||
<ScrollArea.Thumb className={styles.scrollbarThumb} />
|
||||
</ScrollArea.Scrollbar>
|
||||
</ScrollArea.Root>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user