mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 05:25:53 +08:00
feat: change workspaceInfo type
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { styled } from '@/styles';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
|
||||
export const ExportPageTitleContainer = styled('div')(() => {
|
||||
return {
|
||||
@@ -9,7 +9,7 @@ export const ExportPageTitleContainer = styled('div')(() => {
|
||||
flex: 1,
|
||||
};
|
||||
});
|
||||
export const ExportPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
export const ExportPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
return (
|
||||
<ExportPageTitleContainer>
|
||||
Export Workspace{' '}
|
||||
|
||||
@@ -24,13 +24,13 @@ import { Empty } from '@/ui/empty';
|
||||
// User,
|
||||
// Workspace,
|
||||
// } from '@/hooks/mock-data/mock';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useTemporaryHelper } from '@/providers/temporary-helper-provider';
|
||||
import { StyledMemberWarp } from './general/style';
|
||||
import { useConfirm } from '@/providers/ConfirmProvider';
|
||||
|
||||
// import { useAppState } from '@/providers/app-state-provider';
|
||||
export const MembersPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
export const MembersPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const [isInviteModalShow, setIsInviteModalShow] = useState(false);
|
||||
const [members, setMembers] = useState<[{ name: string; email: string }]>([
|
||||
{ name: 'affine', email: 'tttt' },
|
||||
|
||||
@@ -12,9 +12,9 @@ import { toast } from '@/ui/toast';
|
||||
import { useConfirm } from '@/providers/ConfirmProvider';
|
||||
// import { useAppState } from '@/providers/app-state-provider3';
|
||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
|
||||
export const PublishPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const shareUrl =
|
||||
window.location.host + '/workspace/' + workspace.id + '?share=true';
|
||||
const { publishWorkspace } = useWorkspaceHelper();
|
||||
@@ -53,7 +53,7 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
{workspace.provider === 'cloud' ? (
|
||||
<div>
|
||||
<StyledPublishContent>
|
||||
{workspace?.isPublish ? (
|
||||
{workspace?.published ? (
|
||||
<>
|
||||
<StyledPublishExplanation>
|
||||
Publishing to web requires AFFiNE Cloud service .
|
||||
@@ -75,7 +75,7 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
</StyledPublishExplanation>
|
||||
)}
|
||||
</StyledPublishContent>
|
||||
{workspace.isPublish ? (
|
||||
{workspace.published ? (
|
||||
<Button
|
||||
onClick={() => {
|
||||
togglePublic(false);
|
||||
|
||||
@@ -6,13 +6,13 @@ import {
|
||||
import { DownloadIcon } from '@blocksuite/icons';
|
||||
import { Button } from '@/ui/button';
|
||||
import { Menu, MenuItem } from '@/ui/menu';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { useConfirm } from '@/providers/ConfirmProvider';
|
||||
import { toast } from '@/ui/toast';
|
||||
import { useRouter } from 'next/router';
|
||||
export const SyncPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
export const SyncPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
// console.log('workspace: ', workspace);
|
||||
const { enableWorkspace } = useWorkspaceHelper();
|
||||
const { currentWorkspace, user } = useAppState();
|
||||
|
||||
@@ -14,9 +14,9 @@ import { WorkspaceDelete } from './delete';
|
||||
import { WorkspaceLeave } from './leave';
|
||||
import { Upload } from '@/components/file-upload';
|
||||
import { WorkspaceAvatar } from '@/components/workspace-avatar';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||
export const GeneralPage = ({ workspace }: { workspace: WorkspaceInfo }) => {
|
||||
export const GeneralPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const [showDelete, setShowDelete] = useState<boolean>(false);
|
||||
const [showLeave, setShowLeave] = useState<boolean>(false);
|
||||
const [uploading, setUploading] = useState<boolean>(false);
|
||||
|
||||
@@ -17,12 +17,12 @@ import {
|
||||
getWorkspaces,
|
||||
// Workspace,
|
||||
} from '@/hooks/mock-data/mock';
|
||||
import { WorkspaceInfo } from '@affine/datacenter';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
|
||||
interface WorkspaceDeleteProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
workspace: WorkspaceInfo;
|
||||
workspace: WorkspaceUnit;
|
||||
}
|
||||
|
||||
export const WorkspaceDelete = ({
|
||||
|
||||
Reference in New Issue
Block a user