mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
Merge branch 'feat/datacenter' into feat/datacenter-i18n
This commit is contained in:
@@ -10,7 +10,6 @@ import { useState } from 'react';
|
||||
import { Button } from '@/ui/button';
|
||||
import Input from '@/ui/input';
|
||||
import { toast } from '@/ui/toast';
|
||||
// import { useAppState } from '@/providers/app-state-provider3';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useWorkspaceHelper } from '@/hooks/use-workspace-helper';
|
||||
import { useTranslation } from '@affine/i18n';
|
||||
@@ -23,6 +22,7 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const togglePublic = async (flag: boolean) => {
|
||||
try {
|
||||
await publishWorkspace(workspace.id.toString(), flag);
|
||||
setLoaded(false);
|
||||
} catch (e) {
|
||||
toast(t('Failed to publish workspace'));
|
||||
}
|
||||
@@ -66,7 +66,6 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
onClick={async () => {
|
||||
setLoaded(true);
|
||||
await togglePublic(true);
|
||||
setLoaded(false);
|
||||
}}
|
||||
loading={loaded}
|
||||
type="primary"
|
||||
@@ -85,7 +84,6 @@ export const PublishPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
onClick={async () => {
|
||||
setLoaded(true);
|
||||
await togglePublic(false);
|
||||
setLoaded(true);
|
||||
}}
|
||||
loading={false}
|
||||
type="danger"
|
||||
|
||||
@@ -9,11 +9,13 @@ import { DownloadIcon } from '@blocksuite/icons';
|
||||
import { Button } from '@/ui/button';
|
||||
import { Menu, MenuItem } from '@/ui/menu';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { Trans, useTranslation } from '@affine/i18n';
|
||||
import { useTranslation, Trans } from '@affine/i18n';
|
||||
import { WorkspaceUnitAvatar } from '@/components/workspace-avatar';
|
||||
import { EnableWorkspaceButton } from '../enable-workspace';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
export const SyncPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
const { t } = useTranslation();
|
||||
const { user } = useAppState();
|
||||
return (
|
||||
<div>
|
||||
<StyledPublishContent>
|
||||
@@ -51,7 +53,7 @@ export const SyncPage = ({ workspace }: { workspace: WorkspaceUnit }) => {
|
||||
All data will be synchronised and saved to the AFFiNE account
|
||||
<StyledEmail>
|
||||
{{
|
||||
email: '{' + workspace.owner?.email + '}.',
|
||||
email: '{' + user?.email + '}.',
|
||||
}}
|
||||
</StyledEmail>
|
||||
</Trans>
|
||||
|
||||
@@ -148,5 +148,6 @@ export const StyledPublishContent = styled('div')(({ theme }) => {
|
||||
flexDirection: 'column',
|
||||
fontSize: theme.font.base,
|
||||
lineHeight: theme.font.lineHeightBase,
|
||||
flex: 1,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user