mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat: ui
This commit is contained in:
@@ -109,7 +109,7 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
|
||||
top: '20px',
|
||||
}}
|
||||
>
|
||||
{item.name || 'untitled'}
|
||||
{item.name || 'AFFiNE'}
|
||||
</span>
|
||||
</span>
|
||||
<span
|
||||
@@ -118,11 +118,10 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
|
||||
top: '20px',
|
||||
}}
|
||||
>
|
||||
{(item.workspaceType === 'local' ||
|
||||
!item.workspaceType) && (
|
||||
{(item.type === 'local' || !item.type) && (
|
||||
<CloudUnsyncedIcon fontSize={24} />
|
||||
)}
|
||||
{item.workspaceType === 'cloud' && (
|
||||
{item.type === 'cloud' && (
|
||||
<CloudInsyncIcon fontSize={24} />
|
||||
)}
|
||||
{item.isPublish && <UsersIcon fontSize={24} />}
|
||||
@@ -133,6 +132,9 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
|
||||
})}
|
||||
<li>
|
||||
<Button
|
||||
style={{
|
||||
marginTop: '20px',
|
||||
}}
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setCreateWorkspaceOpen(true);
|
||||
@@ -141,7 +143,7 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
|
||||
<AddIcon
|
||||
style={{
|
||||
fontSize: '20px',
|
||||
top: '4px',
|
||||
top: '5px',
|
||||
position: 'relative',
|
||||
marginRight: '10px',
|
||||
}}
|
||||
@@ -194,7 +196,7 @@ export const WorkspaceModal = ({ open, onClose }: LoginModalProps) => {
|
||||
workspaceId &&
|
||||
setTimeout(() => {
|
||||
updateWorkspaceMeta(workspaceId as string, {
|
||||
workspaceType: 'cloud',
|
||||
type: 'cloud',
|
||||
});
|
||||
}, 1000);
|
||||
} else {
|
||||
|
||||
@@ -6,7 +6,6 @@ export interface Workspace {
|
||||
isPublish?: boolean; // 是否公开
|
||||
isLocal?: boolean; // 是否全部数据都在本地
|
||||
avatar?: string; // 封面
|
||||
workspaceType: 'local' | 'cloud' | 'join'; // cloud: 云端(本次暂不支持),local: 本地,join : 加入别人的
|
||||
type: 'local' | 'cloud' | 'join'; // cloud: 云端(本次暂不支持),local: 本地,join : 加入别人的
|
||||
workspaceOwner?: User; // 本地工作空间的拥有者
|
||||
}
|
||||
@@ -23,7 +22,7 @@ export function updateWorkspaceMeta(
|
||||
workspaceData: {
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
workspaceType?: 'local' | 'cloud' | 'join';
|
||||
type?: 'local' | 'cloud' | 'join';
|
||||
}
|
||||
) {
|
||||
const workspacesMeta = getWorkspaces();
|
||||
@@ -31,8 +30,7 @@ export function updateWorkspaceMeta(
|
||||
if (workspace.id === workspaceId) {
|
||||
workspaceData.name && (workspace.name = workspaceData.name);
|
||||
workspaceData.avatar && (workspace.avatar = workspaceData.avatar);
|
||||
workspaceData.workspaceType &&
|
||||
(workspace.type = workspaceData.workspaceType);
|
||||
workspaceData.type && (workspace.type = workspaceData.type);
|
||||
return workspaceData;
|
||||
}
|
||||
return workspace;
|
||||
@@ -42,8 +40,7 @@ export function updateWorkspaceMeta(
|
||||
workspaceData.name && (activeWorkspace.name = workspaceData.name);
|
||||
workspaceData.avatar && (activeWorkspace.avatar = workspaceData.avatar);
|
||||
|
||||
workspaceData.workspaceType &&
|
||||
(activeWorkspace.type = workspaceData.workspaceType);
|
||||
workspaceData.type && (activeWorkspace.type = workspaceData.type);
|
||||
setActiveWorkspace(activeWorkspace);
|
||||
}
|
||||
export function createWorkspace(workspaceName: string) {
|
||||
|
||||
Reference in New Issue
Block a user