perf: getEnvironment() -> env (#2636)

This commit is contained in:
Simon He
2023-06-01 11:23:38 +08:00
committed by Himself65
parent 369282e29e
commit e1d87cf698
16 changed files with 70 additions and 86 deletions
@@ -1,5 +1,5 @@
import { MuiFade, Tooltip } from '@affine/component';
import { config, getEnvironment } from '@affine/env';
import { config, env } from '@affine/env';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { CloseIcon, NewIcon, UserGuideIcon } from '@blocksuite/icons';
import { useAtom } from 'jotai';
@@ -15,7 +15,6 @@ import {
StyledIsland,
StyledTriggerWrapper,
} from './style';
const env = getEnvironment();
const ContactModal = lazy(() =>
import('@affine/component/contact-modal').then(({ ContactModal }) => ({
default: ContactModal,
@@ -1,5 +1,5 @@
import { Modal, ModalWrapper } from '@affine/component';
import { getEnvironment } from '@affine/env';
import { env } from '@affine/env';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { Command } from 'cmdk';
import type { NextRouter } from 'next/router';
@@ -27,7 +27,6 @@ import {
} from './style';
const isMac = () => {
const env = getEnvironment();
return env.isBrowser && env.isMacOs;
};
@@ -3,7 +3,7 @@ import {
MuiClickAwayListener,
MuiSlide,
} from '@affine/component';
import { getEnvironment } from '@affine/env';
import { env } from '@affine/env';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { useEffect, useState } from 'react';
@@ -27,7 +27,6 @@ type ModalProps = {
};
const checkIsMac = () => {
const env = getEnvironment();
return env.isBrowser && env.isMacOs;
};