Skip to content

Commit fc7e7a3

Browse files
committed
feat: remove avatar for empty field (#8246)
1 parent 58db654 commit fc7e7a3

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

packages/frontend/core/src/components/affine/page-properties/property-row-value-renderer.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
232232
return null;
233233
}, [cloudDocMeta, props.type]);
234234

235-
const t = useI18n();
236-
237235
if (!cloudDocMeta) {
238236
if (isRevalidating) {
239237
// TODO: loading ui
@@ -253,32 +251,34 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
253251
</>
254252
);
255253
}
256-
return (
257-
<>
258-
<Avatar name="?" size={20} />
259-
<span>
260-
{t['com.affine.page-properties.property-user-avatar-no-record']()}
261-
</span>
262-
</>
263-
);
254+
return <NoRecordValue />;
264255
};
265256

266-
export const LocalUserValue = () => {
257+
const NoRecordValue = () => {
267258
const t = useI18n();
268259
return (
269-
<span className={styles.propertyRowValueCell}>
270-
{t['com.affine.page-properties.local-user']()}
260+
<span>
261+
{t['com.affine.page-properties.property-user-avatar-no-record']()}
271262
</span>
272263
);
273264
};
274265

266+
const LocalUserValue = () => {
267+
const t = useI18n();
268+
return <span>{t['com.affine.page-properties.local-user']()}</span>;
269+
};
270+
275271
export const CreatedUserValue = () => {
276272
const workspaceService = useService(WorkspaceService);
277273
const isCloud =
278274
workspaceService.workspace.flavour === WorkspaceFlavour.AFFINE_CLOUD;
279275

280276
if (!isCloud) {
281-
return <LocalUserValue />;
277+
return (
278+
<div className={styles.propertyRowValueUserCell}>
279+
<LocalUserValue />
280+
</div>
281+
);
282282
}
283283

284284
return (

0 commit comments

Comments
 (0)