From fc7e7a37ee4cd8360f1895477bfbedea6344f402 Mon Sep 17 00:00:00 2001 From: darkskygit Date: Fri, 13 Sep 2024 11:18:22 +0000 Subject: [PATCH] feat: remove avatar for empty field (#8246) --- .../property-row-value-renderer.tsx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/frontend/core/src/components/affine/page-properties/property-row-value-renderer.tsx b/packages/frontend/core/src/components/affine/page-properties/property-row-value-renderer.tsx index 8be342b0c..94dc784de 100644 --- a/packages/frontend/core/src/components/affine/page-properties/property-row-value-renderer.tsx +++ b/packages/frontend/core/src/components/affine/page-properties/property-row-value-renderer.tsx @@ -232,8 +232,6 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => { return null; }, [cloudDocMeta, props.type]); - const t = useI18n(); - if (!cloudDocMeta) { if (isRevalidating) { // TODO: loading ui @@ -253,23 +251,21 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => { ); } + return ; +}; + +const NoRecordValue = () => { + const t = useI18n(); return ( - <> - - - {t['com.affine.page-properties.property-user-avatar-no-record']()} - - + + {t['com.affine.page-properties.property-user-avatar-no-record']()} + ); }; -export const LocalUserValue = () => { +const LocalUserValue = () => { const t = useI18n(); - return ( - - {t['com.affine.page-properties.local-user']()} - - ); + return {t['com.affine.page-properties.local-user']()}; }; export const CreatedUserValue = () => { @@ -278,7 +274,11 @@ export const CreatedUserValue = () => { workspaceService.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD; if (!isCloud) { - return ; + return ( +
+ +
+ ); } return (