Commit 8b6fb043 authored by RobPruzan's avatar RobPruzan

fix: render indicator + panel with error overlay

parent 50202d5a
...@@ -7,7 +7,10 @@ import { Warning } from '../../icons/warning' ...@@ -7,7 +7,10 @@ import { Warning } from '../../icons/warning'
import { css } from '../../utils/css' import { css } from '../../utils/css'
import { useDevOverlayContext } from '../../../dev-overlay.browser' import { useDevOverlayContext } from '../../../dev-overlay.browser'
import { useRenderErrorContext } from '../../dev-overlay' import { useRenderErrorContext } from '../../dev-overlay'
import { ACTION_ERROR_OVERLAY_OPEN } from '../../shared' import {
ACTION_ERROR_OVERLAY_CLOSE,
ACTION_ERROR_OVERLAY_OPEN,
} from '../../shared'
import { usePanelRouterContext } from '../../menu/context' import { usePanelRouterContext } from '../../menu/context'
import { BASE_LOGO_SIZE } from '../../utils/indicator-metrics' import { BASE_LOGO_SIZE } from '../../utils/indicator-metrics'
...@@ -53,10 +56,7 @@ export function NextLogoNew({ ...@@ -53,10 +56,7 @@ export function NextLogoNew({
'--duration-short': `${SHORT_DURATION_MS}ms`, '--duration-short': `${SHORT_DURATION_MS}ms`,
// if the indicator is disabled, hide the badge // if the indicator is disabled, hide the badge
// also allow the "disabled" state be dismissed, as long as there are no build errors // also allow the "disabled" state be dismissed, as long as there are no build errors
display: display: state.disableDevIndicator && dismissed ? 'none' : 'block',
state.disableDevIndicator && (!hasError || dismissed)
? 'none'
: 'block',
} as React.CSSProperties } as React.CSSProperties
} }
> >
...@@ -418,7 +418,12 @@ export function NextLogoNew({ ...@@ -418,7 +418,12 @@ export function NextLogoNew({
data-issues-open data-issues-open
aria-label="Open issues overlay" aria-label="Open issues overlay"
onClick={() => { onClick={() => {
// wait this is wrong if (state.isErrorOverlayOpen) {
dispatch({
type: ACTION_ERROR_OVERLAY_CLOSE,
})
return
}
dispatch({ type: ACTION_ERROR_OVERLAY_OPEN }) dispatch({ type: ACTION_ERROR_OVERLAY_OPEN })
setPanel(null) setPanel(null)
}} }}
......
...@@ -160,7 +160,7 @@ export const DevtoolMenu = ({ ...@@ -160,7 +160,7 @@ export const DevtoolMenu = ({
borderRadius: 'var(--rounded-xl)', borderRadius: 'var(--rounded-xl)',
position: 'fixed', position: 'fixed',
fontFamily: 'var(--font-stack-sans)', fontFamily: 'var(--font-stack-sans)',
zIndex: 3, zIndex: 'var(--top-z-index)',
overflow: 'hidden', overflow: 'hidden',
opacity: 1, opacity: 1,
minWidth: '248px', minWidth: '248px',
......
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
ACTION_DEV_INDICATOR_SET, ACTION_DEV_INDICATOR_SET,
ACTION_DEVTOOLS_POSITION, ACTION_DEVTOOLS_POSITION,
ACTION_DEVTOOLS_SCALE, ACTION_DEVTOOLS_SCALE,
ACTION_ERROR_OVERLAY_CLOSE,
ACTION_ERROR_OVERLAY_OPEN, ACTION_ERROR_OVERLAY_OPEN,
} from '../shared' } from '../shared'
import GearIcon from '../icons/gear-icon' import GearIcon from '../icons/gear-icon'
...@@ -41,6 +42,13 @@ const MenuPanel = () => { ...@@ -41,6 +42,13 @@ const MenuPanel = () => {
label: 'Issues', label: 'Issues',
value: <IssueCount>{totalErrorCount}</IssueCount>, value: <IssueCount>{totalErrorCount}</IssueCount>,
onClick: () => { onClick: () => {
if (state.isErrorOverlayOpen) {
dispatch({
type: ACTION_ERROR_OVERLAY_CLOSE,
})
setPanel(null)
return
}
setPanel(null) setPanel(null)
setSelectedIndex(-1) setSelectedIndex(-1)
if (totalErrorCount > 0) { if (totalErrorCount > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment