mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-03 19:23:37 +03:00
feat(core): adjust help island style (#6651)
This commit is contained in:
parent
ab7282213b
commit
b7ade43c2e
@ -89,7 +89,7 @@ export const toolStyle = style({
|
||||
position: 'absolute',
|
||||
right: '30px',
|
||||
bottom: '30px',
|
||||
zIndex: cssVar('zIndexPopover'),
|
||||
zIndex: 1,
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
gap: '12px',
|
||||
|
@ -3,7 +3,6 @@ import { appSettingAtom, useLiveData, useService } from '@toeverything/infra';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
|
||||
import { appSidebarOpenAtom } from '../../../components/app-sidebar/index.jotai';
|
||||
import { RightSidebarService } from '../services/right-sidebar';
|
||||
import * as styles from './container.css';
|
||||
import { Header } from './header';
|
||||
@ -20,17 +19,15 @@ export const RightSidebarContainer = () => {
|
||||
const frontView = useLiveData(rightSidebar.front$);
|
||||
const open = useLiveData(rightSidebar.isOpen$) && frontView !== undefined;
|
||||
const [floating, setFloating] = useState(false);
|
||||
const appSidebarOpened = useAtomValue(appSidebarOpenAtom);
|
||||
|
||||
useEffect(() => {
|
||||
const onResize = () =>
|
||||
setFloating(!!(window.innerWidth < 1200 && appSidebarOpened));
|
||||
const onResize = () => setFloating(!!(window.innerWidth < 768));
|
||||
onResize();
|
||||
window.addEventListener('resize', onResize);
|
||||
return () => {
|
||||
window.removeEventListener('resize', onResize);
|
||||
};
|
||||
}, [appSidebarOpened]);
|
||||
}, []);
|
||||
|
||||
const handleOpenChange = useCallback(
|
||||
(open: boolean) => {
|
||||
|
Loading…
Reference in New Issue
Block a user