refactor: unify synced and un-synced affine workspace (#1299)

This commit is contained in:
Himself65
2023-03-03 13:58:15 -06:00
committed by GitHub
parent 296cd215c1
commit 50ff9b0c5c
7 changed files with 19 additions and 71 deletions
@@ -19,7 +19,7 @@ import { lockMutex } from '../../../../../atoms';
import { useMembers } from '../../../../../hooks/affine/use-members';
import { transformWorkspace } from '../../../../../plugins';
import {
AffineRemoteWorkspace,
AffineWorkspace,
LocalWorkspace,
RemWorkspaceFlavour,
} from '../../../../../shared';
@@ -45,7 +45,7 @@ import {
const AffineRemoteCollaborationPanel: React.FC<
Omit<PanelProps, 'workspace'> & {
workspace: AffineRemoteWorkspace;
workspace: AffineWorkspace;
}
> = ({ workspace }) => {
const [isInviteModalShow, setIsInviteModalShow] = useState(false);
@@ -213,7 +213,7 @@ const LocalCollaborationPanel: React.FC<
export const CollaborationPanel: React.FC<PanelProps> = props => {
switch (props.workspace.flavour) {
case RemWorkspaceFlavour.AFFINE: {
const workspace = props.workspace as AffineRemoteWorkspace;
const workspace = props.workspace as AffineWorkspace;
return (
<AffineRemoteCollaborationPanel {...props} workspace={workspace} />
);
@@ -13,7 +13,7 @@ import { lockMutex } from '../../../../../atoms';
import { useToggleWorkspacePublish } from '../../../../../hooks/affine/use-toggle-workspace-publish';
import {
AffineOfficialWorkspace,
AffineRemoteWorkspace,
AffineWorkspace,
LocalWorkspace,
RemWorkspaceFlavour,
} from '../../../../../shared';
@@ -25,7 +25,7 @@ export type PublishPanelProps = {
};
export type PublishPanelAffineProps = {
workspace: AffineRemoteWorkspace;
workspace: AffineWorkspace;
};
const PublishPanelAffine: React.FC<PublishPanelAffineProps> = ({