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
committed by GitHub
parent 80c2a78273
commit 5496969e58
72 changed files with 255 additions and 242 deletions
@@ -1,5 +1,4 @@
import { MuiFade, Tooltip } from '@affine/component';
import { config, env } from '@affine/env';
import { useAFFiNEI18N } from '@affine/i18n/hooks';
import { CloseIcon, NewIcon, UserGuideIcon } from '@blocksuite/icons';
import { useAtom } from 'jotai';
@@ -28,7 +27,7 @@ const DEFAULT_SHOW_LIST: IslandItemNames[] = [
const DESKTOP_SHOW_LIST: IslandItemNames[] = [...DEFAULT_SHOW_LIST, 'guide'];
export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts' | 'guide';
export const HelpIsland = ({
showList = env.isDesktop ? DESKTOP_SHOW_LIST : DEFAULT_SHOW_LIST,
showList = environment.isDesktop ? DESKTOP_SHOW_LIST : DEFAULT_SHOW_LIST,
}: {
showList?: IslandItemNames[];
}) => {
@@ -73,7 +72,7 @@ export const HelpIsland = ({
<StyledIconWrapper
data-testid="right-bottom-change-log-icon"
onClick={() => {
window.open(config.changelogUrl, '_blank');
window.open(runtimeConfig.changelogUrl, '_blank');
}}
>
<NewIcon />