From 7541dff00ec824759fae06436532fbc3762eb284 Mon Sep 17 00:00:00 2001 From: "Kilu.He" <108015703+qinluhe@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:30:08 +0800 Subject: [PATCH] fix: some file block issues (#6085) --- .../components/blocks/file/FileBlock.tsx | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx b/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx index ecb5a49b4e..ed6c652462 100644 --- a/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx +++ b/frontend/appflowy_web_app/src/components/editor/components/blocks/file/FileBlock.tsx @@ -1,17 +1,15 @@ -import { FieldURLType } from '@/application/collab.type'; import { notify } from '@/components/_shared/notify'; import RightTopActionsToolbar from '@/components/editor/components/block-actions/RightTopActionsToolbar'; import { EditorElementProps, FileNode } from '@/components/editor/editor.type'; import { copyTextToClipboard } from '@/utils/copy'; import { downloadFile } from '@/utils/download'; -import { renderDate } from '@/utils/time'; import React, { forwardRef, memo, useCallback, useMemo, useState } from 'react'; import { ReactComponent as FileIcon } from '@/assets/file_upload.svg'; import { useTranslation } from 'react-i18next'; export const FileBlock = memo( forwardRef>(({ node, children, ...attributes }, ref) => { - const { url, name, url_type, uploaded_at } = useMemo(() => node.data || {}, [node.data]); + const { url, name } = useMemo(() => node.data || {}, [node.data]); const className = useMemo(() => { const classList = ['w-full bg-bg-body py-2']; @@ -41,20 +39,6 @@ export const FileBlock = memo( } }, [url, name]); - const uploadTypePrefix = useMemo(() => { - const time = renderDate(uploaded_at, 'MMM DD, YYYY', false); - - if (url_type === FieldURLType.Upload) { - return t('web.fileBlock.uploadedAt', { - time, - }); - } else { - return t('web.fileBlock.linkedAt', { - time, - }); - } - }, [uploaded_at, url_type, t]); - return (
{name?.trim() || t('document.title.placeholder')}
-
- {uploadTypePrefix} -
:
{t('web.fileBlock.empty')}