refactor: environment setup (#2898)

Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com>
This commit is contained in:
Alex Yang
2023-06-28 19:19:19 +08:00
parent be33cfd174
commit bff8ca6178
72 changed files with 255 additions and 242 deletions
@@ -1,6 +1,6 @@
import { Switch } from '@affine/component';
import { relatedLinks } from '@affine/component/contact-modal';
import { env } from '@affine/env';
import { isDesktop } from '@affine/env/constant';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { ArrowRightSmallIcon, OpenInNewIcon } from '@blocksuite/icons';
import { useCallback } from 'react';
@@ -24,7 +24,7 @@ export const AboutAffine = () => {
return (
<>
<SettingHeader title={t['About AFFiNE']()} subtitle={t['None yet']()} />
{IS_EXHIBITION && env.isDesktop ? (
{IS_EXHIBITION && isDesktop ? (
<Wrapper title={t['Version']()}>
<SettingRow
name={t['Check for updates']()}
@@ -1,5 +1,5 @@
import { RadioButton, RadioButtonGroup, Switch } from '@affine/component';
import { env } from '@affine/env';
import { isDesktop } from '@affine/env/constant';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useTheme } from 'next-themes';
import { useCallback } from 'react';
@@ -71,7 +71,7 @@ export const AppearanceSettings = () => {
<LanguageMenu />
</div>
</SettingRow>
{IS_EXHIBITION && env.isDesktop ? (
{IS_EXHIBITION && isDesktop ? (
<SettingRow
name={t['Client Border Style']()}
desc={t['Customize the appearance of the client.']()}
@@ -92,7 +92,7 @@ export const AppearanceSettings = () => {
onChange={checked => changeSwitch('fullWidthLayout', checked)}
/>
</SettingRow>
{IS_EXHIBITION && env.isDesktop ? (
{IS_EXHIBITION && isDesktop ? (
<SettingRow
name={t['Window frame style']()}
desc={t['Customize appearance of Windows Client.']()}
@@ -137,7 +137,7 @@ export const AppearanceSettings = () => {
</Wrapper>
) : null}
{env.isDesktop ? (
{isDesktop ? (
<Wrapper title={t['Sidebar']()}>
<SettingRow
name={t['Disable the noise background on the sidebar']()}