refactor(store): port to useGlobalState with zustand (#1012)

This commit is contained in:
Himself65
2023-02-14 23:38:21 -06:00
committed by GitHub
parent 2b3ec1240a
commit 6a8aff9e56
29 changed files with 304 additions and 207 deletions

View File

@@ -24,12 +24,14 @@ import { useTranslation } from '@affine/i18n';
import { CameraIcon } from './icons';
import { Upload } from '@/components/file-upload';
import { MuiFade } from '@affine/component';
import { useGlobalState } from '@/store/app';
export const GeneralPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
const [showDelete, setShowDelete] = useState<boolean>(false);
const [showLeave, setShowLeave] = useState<boolean>(false);
const [workspaceName, setWorkspaceName] = useState<string>(workspace?.name);
const [showEditInput, setShowEditInput] = useState(false);
const { currentWorkspace, isOwner } = useAppState();
const isOwner = useGlobalState(store => store.isOwner);
const { currentWorkspace } = useAppState();
const { updateWorkspace } = useWorkspaceHelper();
const { t } = useTranslation();