mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -162,7 +162,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
data-size={size}
|
||||
data-variant={variant}
|
||||
data-no-hover={withoutHover || undefined}
|
||||
data-mobile={environment.isMobileEdition}
|
||||
data-mobile={BUILD_CONFIG.isMobileEdition}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<IconSlot
|
||||
|
||||
@@ -9,12 +9,14 @@ import { MobileMenu } from './mobile/root';
|
||||
import { MobileMenuSeparator } from './mobile/separator';
|
||||
import { MobileMenuSub } from './mobile/sub';
|
||||
|
||||
const MenuItem = environment.isMobileEdition ? MobileMenuItem : DesktopMenuItem;
|
||||
const MenuSeparator = environment.isMobileEdition
|
||||
const MenuItem = BUILD_CONFIG.isMobileEdition
|
||||
? MobileMenuItem
|
||||
: DesktopMenuItem;
|
||||
const MenuSeparator = BUILD_CONFIG.isMobileEdition
|
||||
? MobileMenuSeparator
|
||||
: DesktopMenuSeparator;
|
||||
const MenuSub = environment.isMobileEdition ? MobileMenuSub : DesktopMenuSub;
|
||||
const Menu = environment.isMobileEdition ? MobileMenu : DesktopMenu;
|
||||
const MenuSub = BUILD_CONFIG.isMobileEdition ? MobileMenuSub : DesktopMenuSub;
|
||||
const Menu = BUILD_CONFIG.isMobileEdition ? MobileMenu : DesktopMenu;
|
||||
|
||||
export {
|
||||
DesktopMenu,
|
||||
|
||||
@@ -26,7 +26,7 @@ export const useMenuItem = <T extends MenuItemProps>({
|
||||
checked,
|
||||
selected,
|
||||
block,
|
||||
[mobileMenuItem]: environment.isMobileEdition,
|
||||
[mobileMenuItem]: BUILD_CONFIG.isMobileEdition,
|
||||
},
|
||||
propsClassName
|
||||
);
|
||||
|
||||
@@ -149,7 +149,7 @@ export const ModalInner = forwardRef<HTMLDivElement, ModalProps>(
|
||||
children,
|
||||
contentWrapperClassName,
|
||||
contentWrapperStyle,
|
||||
animation = environment.isMobileEdition ? 'slideBottom' : 'fadeScaleTop',
|
||||
animation = BUILD_CONFIG.isMobileEdition ? 'slideBottom' : 'fadeScaleTop',
|
||||
fullScreen,
|
||||
...otherProps
|
||||
} = props;
|
||||
@@ -208,7 +208,7 @@ export const ModalInner = forwardRef<HTMLDivElement, ModalProps>(
|
||||
`anim-${animation}`,
|
||||
styles.modalOverlay,
|
||||
overlayClassName,
|
||||
{ mobile: environment.isMobileEdition }
|
||||
{ mobile: BUILD_CONFIG.isMobileEdition }
|
||||
)}
|
||||
style={{
|
||||
...overlayStyle,
|
||||
@@ -216,7 +216,7 @@ export const ModalInner = forwardRef<HTMLDivElement, ModalProps>(
|
||||
{...otherOverlayOptions}
|
||||
>
|
||||
<SafeArea
|
||||
bottom={environment.isMobileEdition}
|
||||
bottom={BUILD_CONFIG.isMobileEdition}
|
||||
bottomOffset={12}
|
||||
data-full-screen={fullScreen}
|
||||
data-modal={modal}
|
||||
|
||||
@@ -30,7 +30,7 @@ export const SafeArea = forwardRef<HTMLDivElement, SafeAreaProps>(
|
||||
<div
|
||||
ref={ref}
|
||||
className={clsx(safeArea, className)}
|
||||
data-standalone={environment.isStandalone ? '' : undefined}
|
||||
data-standalone={environment.isPwa ? '' : undefined}
|
||||
data-bottom={bottom ? '' : undefined}
|
||||
data-top={top ? '' : undefined}
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user