chore: adjust style of CloudUserAvatar (#8548)

close PD-1774

![CleanShot 2024-10-18 at 17 59 52@2x](https://github.com/user-attachments/assets/ac73fa27-25ab-4136-9008-7abde4491f92)
This commit is contained in:
JimmFly 2024-10-19 13:37:06 +00:00
parent 675a010dfc
commit 3ca052c55f
No known key found for this signature in database
GPG Key ID: 126E0320FEB0D05C
2 changed files with 10 additions and 3 deletions

View File

@ -0,0 +1,5 @@
import { style } from '@vanilla-extract/css';
export const userWrapper = style({
display: 'flex',
gap: '8px',
});

View File

@ -5,6 +5,8 @@ import { useI18n } from '@affine/i18n';
import { useLiveData, useService, WorkspaceService } from '@toeverything/infra';
import { useEffect, useMemo } from 'react';
import { userWrapper } from './created-updated-by.css';
const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
const cloudDocMetaService = useService(CloudDocMetaService);
const cloudDocMeta = useLiveData(cloudDocMetaService.cloudDocMeta.meta$);
@ -46,10 +48,10 @@ const CloudUserAvatar = (props: { type: 'CreatedBy' | 'UpdatedBy' }) => {
}
if (user) {
return (
<>
<Avatar url={user.avatarUrl || ''} name={user.name} size={20} />
<div className={userWrapper}>
<Avatar url={user.avatarUrl || ''} name={user.name} size={22} />
<span>{user.name}</span>
</>
</div>
);
}
return <NoRecordValue />;