fix: banner blocking new page button issue (#3301)

This commit is contained in:
JimmFly 2023-07-19 12:51:15 +08:00 committed by GitHub
parent 57bac5d36b
commit f4aa249138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View File

@ -23,6 +23,7 @@ import {
import { contentLayoutAtom } from '../../../atoms/layout'; import { contentLayoutAtom } from '../../../atoms/layout';
import { currentModeAtom } from '../../../atoms/mode'; import { currentModeAtom } from '../../../atoms/mode';
import type { AffineOfficialWorkspace } from '../../../shared'; import type { AffineOfficialWorkspace } from '../../../shared';
import DownloadClientTip from './download-tips';
import { EditorOptionMenu } from './header-right-items/editor-option-menu'; import { EditorOptionMenu } from './header-right-items/editor-option-menu';
import TrashButtonGroup from './header-right-items/trash-button-group'; import TrashButtonGroup from './header-right-items/trash-button-group';
import * as styles from './styles.css'; import * as styles from './styles.css';
@ -165,6 +166,7 @@ export const Header = forwardRef<
PropsWithChildren<HeaderProps> & HTMLAttributes<HTMLDivElement> PropsWithChildren<HeaderProps> & HTMLAttributes<HTMLDivElement>
>((props, ref) => { >((props, ref) => {
const [showWarning, setShowWarning] = useState(false); const [showWarning, setShowWarning] = useState(false);
const [showDownloadTip, setShowDownloadTip] = useState(true);
// const [shouldShowGuideDownloadClientTip] = useAtom( // const [shouldShowGuideDownloadClientTip] = useAtom(
// guideDownloadClientTipAtom // guideDownloadClientTipAtom
// ); // );
@ -184,6 +186,12 @@ export const Header = forwardRef<
data-open={open} data-open={open}
data-sidebar-floating={appSidebarFloating} data-sidebar-floating={appSidebarFloating}
> >
{showDownloadTip ? (
<DownloadClientTip
show={showDownloadTip}
onClose={() => setShowDownloadTip(false)}
/>
) : (
<BrowserWarning <BrowserWarning
show={showWarning} show={showWarning}
message={<OSWarningMessage />} message={<OSWarningMessage />}
@ -191,7 +199,7 @@ export const Header = forwardRef<
setShowWarning(false); setShowWarning(false);
}} }}
/> />
)}
<div <div
className={styles.header} className={styles.header}
data-has-warning={showWarning} data-has-warning={showWarning}

View File

@ -2,7 +2,7 @@ import type { ComplexStyleRule } from '@vanilla-extract/css';
import { style } from '@vanilla-extract/css'; import { style } from '@vanilla-extract/css';
export const headerContainer = style({ export const headerContainer = style({
height: '52px', height: 'auto',
flexShrink: 0, flexShrink: 0,
position: 'sticky', position: 'sticky',
top: 0, top: 0,