feat: remove avatar for empty field (#8246)

This commit is contained in:
darkskygit 2024-09-13 11:18:22 +00:00
parent 58db654b07
commit fc7e7a37ee
No known key found for this signature in database
GPG Key ID: 97B7D036B1566E9D

View File

@ -232,8 +232,6 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
return null; return null;
}, [cloudDocMeta, props.type]); }, [cloudDocMeta, props.type]);
const t = useI18n();
if (!cloudDocMeta) { if (!cloudDocMeta) {
if (isRevalidating) { if (isRevalidating) {
// TODO: loading ui // TODO: loading ui
@ -253,23 +251,21 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
</> </>
); );
} }
return <NoRecordValue />;
};
const NoRecordValue = () => {
const t = useI18n();
return ( return (
<>
<Avatar name="?" size={20} />
<span> <span>
{t['com.affine.page-properties.property-user-avatar-no-record']()} {t['com.affine.page-properties.property-user-avatar-no-record']()}
</span> </span>
</>
); );
}; };
export const LocalUserValue = () => { const LocalUserValue = () => {
const t = useI18n(); const t = useI18n();
return ( return <span>{t['com.affine.page-properties.local-user']()}</span>;
<span className={styles.propertyRowValueCell}>
{t['com.affine.page-properties.local-user']()}
</span>
);
}; };
export const CreatedUserValue = () => { export const CreatedUserValue = () => {
@ -278,7 +274,11 @@ export const CreatedUserValue = () => {
workspaceService.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD; workspaceService.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD;
if (!isCloud) { if (!isCloud) {
return <LocalUserValue />; return (
<div className={styles.propertyRowValueUserCell}>
<LocalUserValue />
</div>
);
} }
return ( return (