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