fix: lint warning

This commit is contained in:
DiamondThree 2023-01-06 16:58:21 +08:00
parent 78facb2fe6
commit 3e76a94730
8 changed files with 23 additions and 25 deletions

View File

@ -79,9 +79,9 @@ const ContentTitle = styled('span')({
paddingBottom: '16px',
});
const Footer = styled('div')({
height: '70px',
paddingLeft: '24px',
marginTop: '32px',
textAlign: 'center',
});
// const Footer = styled('div')({
// height: '70px',
// paddingLeft: '24px',
// marginTop: '32px',
// textAlign: 'center',
// });

View File

@ -4,7 +4,7 @@ import { Modal, ModalWrapper, ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
import Input from '@/ui/input';
import { useState } from 'react';
import { getDataCenter } from '@affine/datacenter';
// import { getDataCenter } from '@affine/datacenter';
import { Avatar } from '@mui/material';
import { setMember } from '@/hooks/mock-data/mock';
interface LoginModalProps {

View File

@ -51,7 +51,7 @@ export const MembersPage = ({ workspace }: { workspace: Workspace }) => {
useEffect(() => {
setMembersList();
// refreshMembers();
}, []);
});
const setMembersList = () => {
const members = getMembers(workspace.id);

View File

@ -11,9 +11,7 @@ import {
import { useState } from 'react';
import { ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
import { getDataCenter } from '@affine/datacenter';
import { useRouter } from 'next/router';
import { useAppState } from '@/providers/app-state-provider';
import {
deleteWorkspace,
getWorkspaces,

View File

@ -9,25 +9,24 @@ import { StyledSettingH2 } from '../style';
import { useState } from 'react';
import { Button, TextButton } from '@/ui/button';
import Input from '@/ui/input';
import { getDataCenter } from '@affine/datacenter';
import { useAppState } from '@/providers/app-state-provider';
// import { useAppState } from '@/providers/app-state-provider';
import { WorkspaceDelete } from './delete';
import { debounce } from '@/utils';
// import { debounce } from '@/utils';
import { WorkspaceLeave } from './leave';
import { Upload } from '@/components/file-upload';
import { Workspace } from '@/hooks/mock-data/mock';
import { WorkspaceAvatar } from '@/components/workspace-avatar';
import { useTemporaryHelper } from '@/providers/temporary-helper-provider';
export const GeneralPage = ({ workspace }: { workspace: Workspace }) => {
const { refreshWorkspacesMeta } = useAppState();
// const { refreshWorkspacesMeta } = useAppState();
const { updateWorkspaceMeta } = useTemporaryHelper();
const [showDelete, setShowDelete] = useState<boolean>(false);
const [showLeave, setShowLeave] = useState<boolean>(false);
const [uploading, setUploading] = useState<boolean>(false);
const [workspaceName, setWorkspaceName] = useState<string>('');
const debouncedRefreshWorkspacesMeta = debounce(() => {
refreshWorkspacesMeta();
}, 100);
// const debouncedRefreshWorkspacesMeta = debounce(() => {
// refreshWorkspacesMeta();
// }, 100);
const isOwner = true;
const handleChangeWorkSpaceName = (newName: string) => {
@ -51,6 +50,7 @@ export const GeneralPage = ({ workspace }: { workspace: Workspace }) => {
};
const fileChange = async (file: File) => {
console.log('file: ', file);
setUploading(true);
// const blob = new Blob([file], { type: file.type });
// const blobId = await getDataCenter()

View File

@ -8,7 +8,6 @@ import {
import { ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
import { getDataCenter } from '@affine/datacenter';
import { useRouter } from 'next/router';
import { useAppState } from '@/providers/app-state-provider';
interface WorkspaceDeleteProps {
@ -23,7 +22,7 @@ export const WorkspaceLeave = ({
onClose,
workspaceId,
}: WorkspaceDeleteProps) => {
const router = useRouter();
// const router = useRouter();
const { refreshWorkspacesMeta } = useAppState();
const handleLeave = async () => {
const dc = await getDataCenter();

View File

@ -11,7 +11,7 @@ export const WorkspaceSelector = () => {
if (workspaceMetaList.length === 0) {
setWorkspaceListShow(true);
}
});
}, [workspaceMetaList]);
return (
<>
@ -24,14 +24,17 @@ export const WorkspaceSelector = () => {
<Avatar
alt="Affine"
data-testid="workspace-avatar"
src={currentWorkspace.avatar}
src={currentWorkspace?.avatar}
>
<div
style={{
float: 'left',
}}
>
<WorkspaceAvatar size={28} name={currentWorkspace.name} />
<WorkspaceAvatar
size={28}
name={currentWorkspace?.name ?? 'AFFiNE'}
/>
</div>
</Avatar>
<WorkspaceName data-testid="workspace-name">

View File

@ -1,5 +1,3 @@
import { type } from 'os';
export interface Workspace {
name: string; // 名称
id: string; //唯一标识
@ -95,7 +93,7 @@ export function deleteMember(workspaceId: string, index: number) {
memberMap[workspaceId] = memberList;
localStorage.setItem('affine-member', JSON.stringify(memberMap));
}
export function leaveWorkspace(id: string) {
export function leaveWorkspace() {
return true;
}