Merge branch 'feat/datacenter' into feat/datacenter-i18n

This commit is contained in:
JimmFly
2023-02-01 10:25:02 +08:00
10 changed files with 27 additions and 107 deletions
@@ -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,
};
});