fix: lint error

This commit is contained in:
DiamondThree 2023-01-13 14:11:29 +08:00
parent 5988777baf
commit d1c9a40705
2 changed files with 15 additions and 25 deletions

View File

@ -6,15 +6,16 @@ const useAvatar = (workspaceUnit?: WorkspaceUnit) => {
const [avatarUrl, setAvatarUrl] = useState('');
const avatarId =
workspaceUnit?.avatar || workspaceUnit?.blocksuiteWorkspace?.meta.avatar;
const blobs = workspaceUnit?.blocksuiteWorkspace?.blobs;
useEffect(() => {
if (avatarId && workspaceUnit?.blocksuiteWorkspace?.blobs) {
workspaceUnit.blocksuiteWorkspace.blobs.then(blobs => {
if (avatarId && blobs) {
blobs.then(blobs => {
blobs?.get(avatarId).then(url => setAvatarUrl(url || ''));
});
} else {
setAvatarUrl('');
}
}, [avatarId]);
}, [avatarId, blobs]);
return avatarUrl;
};

View File

@ -1,5 +1,4 @@
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
import { useAppState } from '@/providers/app-state-provider';
import { styled } from '@/styles';
import { Empty } from '@/ui/empty';
// import { Avatar } from '@mui/material';
@ -23,16 +22,14 @@ export default function DevPage() {
const router = useRouter();
const [successInvited, setSuccessInvited] = useState<boolean>(false);
const { acceptInvite } = useWorkspaceHelper();
const { user } = useAppState();
useEffect(() => {
router.query.invite_code &&
acceptInvite(router.query.invite_code as string).then(data => {
if (data && data.accepted) {
setSuccessInvited(true);
user && router.push(`/workspace/${data.workspace_id}`);
}
});
}, [router.query.invite_code]);
}, [router, acceptInvite]);
return (
<Invited>
@ -98,16 +95,16 @@ export default function DevPage() {
</Invited>
);
}
const UserIcon = styled('div')({
display: 'inline-block',
width: '28px',
height: '28px',
borderRadius: '50%',
backgroundColor: '#FFF5AB',
textAlign: 'center',
color: '#896406',
lineHeight: '28px',
});
// const UserIcon = styled('div')({
// display: 'inline-block',
// width: '28px',
// height: '28px',
// borderRadius: '50%',
// backgroundColor: '#FFF5AB',
// textAlign: 'center',
// color: '#896406',
// lineHeight: '28px',
// });
const Invited = styled('div')(({ theme }) => {
return {
@ -126,14 +123,6 @@ const Content = styled('div')({
marginTop: '35px',
});
const UserContent = styled('span')({
fontSize: '18px',
marginLeft: '12px',
span: {
padding: '0 12px',
},
});
const Status = styled('div')(() => {
return {
marginTop: '16px',