fix: lint error

This commit is contained in:
DiamondThree 2023-01-09 22:30:23 +08:00
parent 1e5e61ab51
commit 550e7f765f
11 changed files with 20 additions and 16 deletions

View File

@ -5,7 +5,6 @@ import { useState } from 'react';
import Input from '@/ui/input';
import { KeyboardEvent } from 'react';
import { useTranslation } from 'react-i18next';
import { useAppState } from '@/providers/app-state-provider';
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
import { useRouter } from 'next/router';

View File

@ -1,11 +1,11 @@
import { getDataCenter } from '@affine/datacenter';
// import { getDataCenter } from '@affine/datacenter';
import { styled } from '@/styles';
import { Button } from '@/ui/button';
import { useModal } from '@/providers/GlobalModalProvider';
// import { useModal } from '@/providers/GlobalModalProvider';
import { GoogleIcon, StayLogOutIcon } from './Icons';
export const GoogleLoginButton = () => {
const { triggerLoginModal } = useModal();
// const { triggerLoginModal } = useModal();
return (
<StyledGoogleButton
onClick={() => {

View File

@ -10,7 +10,7 @@ import {
UsersIcon,
AddIcon,
} from '@blocksuite/icons';
import { useConfirm } from '@/providers/ConfirmProvider';
// import { useConfirm } from '@/providers/ConfirmProvider';
import { toast } from '@/ui/toast';
import { WorkspaceAvatar } from '@/components/workspace-avatar';
import { useAppState } from '@/providers/app-state-provider';
@ -24,7 +24,7 @@ interface WorkspaceModalProps {
export const WorkspaceModal = ({ open, onClose }: WorkspaceModalProps) => {
const [createWorkspaceOpen, setCreateWorkspaceOpen] = useState(false);
const { confirm } = useConfirm();
// const { confirm } = useConfirm();
const { workspaceList, currentWorkspace } = useAppState();
const { login, user } = useUserHelper();
const router = useRouter();

View File

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

View File

@ -9,6 +9,7 @@ import { Menu, MenuItem } from '@/ui/menu';
import { useTemporaryHelper } from '@/providers/temporary-helper-provider';
import { Workspace } from '@affine/datacenter';
export const SyncPage = ({ workspace }: { workspace: Workspace }) => {
console.log('workspace: ', workspace);
const { currentWorkspace, updateWorkspaceMeta } = useTemporaryHelper();
return (

View File

@ -8,7 +8,7 @@ import {
import { ModalCloseButton } from '@/ui/modal';
import { Button } from '@/ui/button';
// import { getDataCenter } from '@affine/datacenter';
import { useAppState } from '@/providers/app-state-provider';
// import { useAppState } from '@/providers/app-state-provider';
interface WorkspaceDeleteProps {
open: boolean;
@ -22,8 +22,9 @@ export const WorkspaceLeave = ({
onClose,
workspaceId,
}: WorkspaceDeleteProps) => {
console.log('workspaceId: ', workspaceId);
// const router = useRouter();
const { refreshWorkspacesMeta } = useAppState();
// const { refreshWorkspacesMeta } = useAppState();
const handleLeave = async () => {
// const dc = await getDataCenter();
// await dc.apis.leaveWorkspace({ id: workspaceId });

View File

@ -12,7 +12,7 @@ import {
} from './WorkspaceItem';
import { WorkspaceSetting } from '@/components/workspace-setting';
import { useCallback, useEffect, useState } from 'react';
import { getDataCenter, WorkspaceType } from '@affine/datacenter';
import { WorkspaceType } from '@affine/datacenter';
import { useModal } from '@/providers/GlobalModalProvider';
export type WorkspaceDetails = Record<

View File

@ -1,4 +1,4 @@
import { getDataCenter } from '@affine/datacenter';
// import { getDataCenter } from '@affine/datacenter';
import Modal from '@/ui/modal';
import Input from '@/ui/input';
import {
@ -11,8 +11,8 @@ import {
} from './style';
import { useState } from 'react';
import { ModalCloseButton } from '@/ui/modal';
import router from 'next/router';
import { useAppState } from '@/providers/app-state-provider';
// import router from 'next/router';
// import { useAppState } from '@/providers/app-state-provider';
interface WorkspaceCreateProps {
open: boolean;
@ -30,7 +30,7 @@ const DefaultHeadImgColors = [
export const WorkspaceCreate = ({ open, onClose }: WorkspaceCreateProps) => {
const [workspaceName, setWorkspaceId] = useState<string>('');
const [creating, setCreating] = useState<boolean>(false);
const { refreshWorkspacesMeta } = useAppState();
// const { refreshWorkspacesMeta } = useAppState();
const handlerInputChange = (workspaceName: string) => {
setWorkspaceId(workspaceName);
};

View File

@ -1,7 +1,7 @@
import { styled } from '@/styles';
import { Empty } from '@/ui/empty';
import { Avatar } from '@mui/material';
import { getDataCenter } from '@affine/datacenter';
// import { getDataCenter } from '@affine/datacenter';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
@ -37,6 +37,8 @@ export default function DevPage() {
// .catch(err => {
// console.log('err: ', err);
// });
setSuccessInvited(true);
setInviteData(null);
}, [router.query.invite_code]);
return (

View File

@ -9,7 +9,7 @@ import {
import type { PropsWithChildren } from 'react';
import ShortcutsModal from '@/components/shortcuts-modal';
import ContactModal from '@/components/contact-modal';
import QuickSearch from '@/components/quick-search';
// import QuickSearch from '@/components/quick-search';
import { ImportModal } from '@/components/import';
import { LoginModal } from '@/components/login-modal';

View File

@ -52,7 +52,7 @@ export const AppStateProvider = ({
};
init();
}, []);
});
useEffect(() => {
if (!appState?.currentWorkspace) {