fix: adjust margin bottom (#6370)

This commit is contained in:
Kilu.He 2024-09-21 14:31:10 +08:00 committed by GitHub
parent 88df232139
commit 164933325c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 10 deletions

View File

@ -8,7 +8,7 @@ export function Calendar () {
const { dayPropGetter, localizer, formats, events, emptyEvents } = useCalendarSetup();
return (
<div className={'database-calendar z-[1] h-fit pb-4 pt-4 text-sm'}>
<div className={'database-calendar z-[1] h-fit pb-36 pt-4 text-sm'}>
<BigCalendar
components={{
toolbar: (props) => <Toolbar {...props} emptyEvents={emptyEvents} />,

View File

@ -27,7 +27,7 @@ export const ListItem = memo(
</div>
);
},
areEqual
areEqual,
);
export default ListItem;

View File

@ -1,7 +1,7 @@
import { DEFAULT_ROW_HEIGHT } from '@/application/database-yjs';
import { useCallback, useRef } from 'react';
export function useMeasureHeight({
export function useMeasureHeight ({
forceUpdate,
rows,
}: {
@ -19,31 +19,39 @@ export function useMeasureHeight({
return heightRef.current[row.rowId] || DEFAULT_ROW_HEIGHT;
},
[rows]
[rows],
);
const setRowHeight = useCallback(
(index: number, height: number) => {
const row = rows[index];
const isLastRow = index === rows.length - 1;
let newHeight = height;
if (isLastRow) {
newHeight += 144;
}
const rowId = row.rowId;
if (!row || !rowId) return;
const oldHeight = heightRef.current[rowId];
heightRef.current[rowId] = Math.max(oldHeight || DEFAULT_ROW_HEIGHT, height);
heightRef.current[rowId] = Math.max(oldHeight || DEFAULT_ROW_HEIGHT, newHeight);
if (oldHeight !== height) {
if (oldHeight !== newHeight) {
forceUpdate(index);
}
},
[forceUpdate, rows]
[forceUpdate, rows],
);
const onResize = useCallback(
(rowIndex: number, columnIndex: number, size: { width: number; height: number }) => {
setRowHeight(rowIndex, size.height);
},
[setRowHeight]
[setRowHeight],
);
return {

View File

@ -103,7 +103,7 @@ export const GridTable = ({ scrollLeft, columnWidth, columns, onScrollLeft }: Gr
if (row.type === RenderRowType.CalculateRow && column.fieldId) {
return (
<div style={style}>
<div style={style} className={'pb-36'}>
<GridCalculateRowCell fieldId={column.fieldId} />
</div>
);

View File

@ -46,7 +46,7 @@ export const Document = ({
<div
style={{
minHeight: `calc(100vh - 48px)`,
}} className={'mb-16 flex h-full w-full flex-col items-center'}
}} className={'mb-36 flex h-full w-full flex-col items-center'}
>
<ViewMetaPreview {...viewMeta} />
<Suspense fallback={<EditorSkeleton />}>