Bugfix of pointer-event disabling logic on panes (#2118)

* Fix pointer-event logic depending on open panes, etc

* Little KclTextEditorPane style tweaks

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu)

* Rerun CI

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Frank Noirot
2024-04-15 21:40:45 -04:00
committed by GitHub
parent 9a9c2223de
commit f29573f3dc
4 changed files with 22 additions and 15 deletions

View File

@ -1,5 +1,6 @@
import { useStore } from 'useStore'
import styles from './ModelingPane.module.css'
import { useSettingsAuthContext } from 'hooks/useSettingsAuthContext'
export interface ModelingPaneProps
extends React.PropsWithChildren,
@ -29,18 +30,21 @@ export const ModelingPane = ({
detailsTestId,
...props
}: ModelingPaneProps) => {
const { settings } = useSettingsAuthContext()
const onboardingStatus = settings.context.app.onboardingStatus
const { buttonDownInStream } = useStore((s) => ({
buttonDownInStream: s.buttonDownInStream,
}))
const pointerEventsCssClass =
buttonDownInStream || onboardingStatus.current === 'camera'
? 'pointer-events-none '
: 'pointer-events-auto '
return (
<section
{...props}
data-testid={detailsTestId}
className={
(buttonDownInStream ? 'pointer-events-none ' : 'pointer-events-auto ') +
styles.panel +
' group ' +
(className || '')
pointerEventsCssClass + styles.panel + ' group ' + (className || '')
}
>
<ModelingPaneHeader title={title} Menu={Menu} />