mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-18 02:21:51 +08:00
fix: a series of bugs
This commit is contained in:
@@ -9,16 +9,17 @@ dayjs.extend(localizedFormat);
|
||||
export const DateCell = ({
|
||||
pageMeta,
|
||||
dateKey,
|
||||
backupKey = '',
|
||||
}: {
|
||||
pageMeta: PageMeta;
|
||||
dateKey: keyof PageMeta;
|
||||
backupKey?: keyof PageMeta;
|
||||
}) => {
|
||||
// dayjs().format('L LT');
|
||||
const value = pageMeta[dateKey] ?? pageMeta[backupKey];
|
||||
return (
|
||||
<TableCell ellipsis={true}>
|
||||
{pageMeta[dateKey] === undefined
|
||||
? '--'
|
||||
: dayjs(pageMeta[dateKey] as string).format('YYYY-MM-DD HH:mm')}
|
||||
{value ? dayjs(value as string).format('YYYY-MM-DD HH:mm') : '--'}
|
||||
</TableCell>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -85,6 +85,7 @@ export const PageList = ({
|
||||
<DateCell
|
||||
pageMeta={pageMeta}
|
||||
dateKey={isTrash ? 'trashDate' : 'updatedDate'}
|
||||
backupKey={isTrash ? 'trashDate' : 'createDate'}
|
||||
/>
|
||||
<TableCell style={{ padding: 0 }}>
|
||||
{isTrash ? (
|
||||
|
||||
@@ -40,9 +40,8 @@ export const OperationCell = ({ pageMeta }: { pageMeta: PageMeta }) => {
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
confirm({
|
||||
title: 'Delete',
|
||||
content:
|
||||
'Deleted items will be moved to Trash Bin. Do you confirm?',
|
||||
title: 'Delete page?',
|
||||
content: `${pageMeta.title} will be moved to Trash`,
|
||||
confirmText: 'Delete',
|
||||
confirmType: 'danger',
|
||||
}).then(confirm => {
|
||||
|
||||
Reference in New Issue
Block a user