mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 11:06:25 +08:00
fix: add platform selector to storybook (#4380)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { isDesktop } from '@affine/env/constant';
|
||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||
import {
|
||||
DeletePermanentlyIcon,
|
||||
@@ -66,7 +65,7 @@ export const OperationCell = ({
|
||||
? t['com.affine.favoritePageOperation.remove']()
|
||||
: t['com.affine.favoritePageOperation.add']()}
|
||||
</MenuItem>
|
||||
{!isDesktop && (
|
||||
{!environment.isDesktop && (
|
||||
<MenuItem
|
||||
onClick={onOpenPageInNewTab}
|
||||
preFix={
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { isDesktop } from '@affine/env/constant';
|
||||
import { ThemeProvider as NextThemeProvider, useTheme } from 'next-themes';
|
||||
import type { PropsWithChildren } from 'react';
|
||||
import { memo, useRef } from 'react';
|
||||
@@ -10,7 +9,7 @@ const DesktopThemeSync = memo(function DesktopThemeSync() {
|
||||
const lastThemeRef = useRef(theme);
|
||||
const onceRef = useRef(false);
|
||||
if (lastThemeRef.current !== theme || !onceRef.current) {
|
||||
if (isDesktop && theme) {
|
||||
if (environment.isDesktop && theme) {
|
||||
window.apis?.ui
|
||||
.handleThemeChange(theme as 'dark' | 'light' | 'system')
|
||||
.catch(err => {
|
||||
|
||||
Reference in New Issue
Block a user