mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix(electron): update settings styles (#10193)
This commit is contained in:
@@ -2,9 +2,10 @@ import {
|
||||
SettingHeader,
|
||||
SettingWrapper,
|
||||
} from '@affine/component/setting-components';
|
||||
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
|
||||
import { WorkspaceService } from '@affine/core/modules/workspace';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useService } from '@toeverything/infra';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
|
||||
import { EnableCloudPanel } from '../preference/enable-cloud';
|
||||
import { BlobManagementPanel } from './blob-management';
|
||||
@@ -18,6 +19,10 @@ export const WorkspaceSettingStorage = ({
|
||||
}) => {
|
||||
const t = useI18n();
|
||||
const workspace = useService(WorkspaceService).workspace;
|
||||
const workspacePermissionService = useService(
|
||||
WorkspacePermissionService
|
||||
).permission;
|
||||
const isTeam = useLiveData(workspacePermissionService.isTeam$);
|
||||
return (
|
||||
<>
|
||||
<SettingHeader
|
||||
@@ -25,23 +30,33 @@ export const WorkspaceSettingStorage = ({
|
||||
subtitle={t['com.affine.settings.workspace.storage.subtitle']()}
|
||||
/>
|
||||
{workspace.flavour === 'local' ? (
|
||||
<EnableCloudPanel onCloseSetting={onCloseSetting} />
|
||||
<>
|
||||
<EnableCloudPanel onCloseSetting={onCloseSetting} />{' '}
|
||||
{BUILD_CONFIG.isElectron && (
|
||||
<SettingWrapper>
|
||||
<DesktopExportPanel workspace={workspace} />
|
||||
</SettingWrapper>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<SettingWrapper>
|
||||
<WorkspaceQuotaPanel />
|
||||
</SettingWrapper>
|
||||
{isTeam ? (
|
||||
<SettingWrapper>
|
||||
<WorkspaceQuotaPanel />
|
||||
</SettingWrapper>
|
||||
) : null}
|
||||
|
||||
{BUILD_CONFIG.isElectron && (
|
||||
<SettingWrapper>
|
||||
<DesktopExportPanel workspace={workspace} />
|
||||
</SettingWrapper>
|
||||
)}
|
||||
|
||||
<SettingWrapper>
|
||||
<BlobManagementPanel />
|
||||
</SettingWrapper>
|
||||
</>
|
||||
)}
|
||||
{BUILD_CONFIG.isElectron && (
|
||||
<SettingWrapper>
|
||||
<DesktopExportPanel workspace={workspace} />
|
||||
</SettingWrapper>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { ErrorMessage, Skeleton } from '@affine/component';
|
||||
import { SettingRow } from '@affine/component/setting-components';
|
||||
import { WorkspacePermissionService } from '@affine/core/modules/permissions';
|
||||
import { WorkspaceQuotaService } from '@affine/core/modules/quota';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
@@ -11,14 +10,6 @@ import * as styles from './style.css';
|
||||
|
||||
export const WorkspaceQuotaPanel = () => {
|
||||
const t = useI18n();
|
||||
const workspacePermissionService = useService(
|
||||
WorkspacePermissionService
|
||||
).permission;
|
||||
const isTeam = useLiveData(workspacePermissionService.isTeam$);
|
||||
|
||||
if (!isTeam) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<SettingRow
|
||||
|
||||
Reference in New Issue
Block a user