fix: panel resize cursor style alway in `ew-reisze`
Signed-off-by: Innei <i@innei.in>
This commit is contained in:
parent
55b7868f2e
commit
41416d21c8
|
|
@ -4,11 +4,11 @@ import type { FC } from "react"
|
|||
import type { AppErrorFallbackProps } from "../common/AppErrorBoundary"
|
||||
import { FallbackIssue } from "../common/ErrorElement"
|
||||
import { Button } from "../ui/button"
|
||||
import { parseError } from "./helper"
|
||||
import { parseError, useResetErrorWhenRouteChange } from "./helper"
|
||||
|
||||
export const PageErrorFallback: FC<AppErrorFallbackProps> = (props) => {
|
||||
const { message, stack } = parseError(props.error)
|
||||
|
||||
useResetErrorWhenRouteChange(props.resetError)
|
||||
return (
|
||||
<div className="flex w-full flex-col items-center justify-center rounded-md bg-theme-modal-background-opaque p-2">
|
||||
<div className="m-auto max-w-prose text-center">
|
||||
|
|
@ -17,13 +17,13 @@ export const PageErrorFallback: FC<AppErrorFallbackProps> = (props) => {
|
|||
</div>
|
||||
<div className="text-lg font-bold">{message}</div>
|
||||
{import.meta.env.DEV && stack ? (
|
||||
<pre className="mt-4 max-h-48 cursor-text overflow-auto whitespace-pre-line rounded-md bg-red-50 p-4 text-left font-mono text-sm text-red-600">
|
||||
<pre className="mt-4 max-h-48 cursor-text select-text overflow-auto whitespace-pre-line rounded-md bg-red-50 p-4 text-left font-mono text-sm text-red-600">
|
||||
{attachOpenInEditor(stack)}
|
||||
</pre>
|
||||
) : null}
|
||||
|
||||
<p className="my-8">
|
||||
The App has a temporary problem, click the button below to try reloading the app or
|
||||
{APP_NAME} has a temporary problem, click the button below to try reloading the app or
|
||||
another solution?
|
||||
</p>
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,22 @@ export const PanelSplitter = (
|
|||
) => {
|
||||
const { isDragging, ...rest } = props
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!isDragging) return
|
||||
const $css = document.createElement("style")
|
||||
|
||||
$css.innerHTML = `
|
||||
* {
|
||||
cursor: ew-resize !important;
|
||||
}
|
||||
`
|
||||
|
||||
document.head.append($css)
|
||||
return () => {
|
||||
$css.remove()
|
||||
}
|
||||
}, [isDragging])
|
||||
|
||||
return (
|
||||
<div className="relative h-full w-0 shrink-0">
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -186,22 +186,6 @@ const FeedResponsiveResizerContainer = ({
|
|||
}
|
||||
}, [feedColumnShow])
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDragging) return
|
||||
const $css = document.createElement("style")
|
||||
|
||||
$css.innerHTML = `
|
||||
* {
|
||||
cursor: ew-resize !important;
|
||||
}
|
||||
`
|
||||
|
||||
document.head.append($css)
|
||||
return () => {
|
||||
$css.remove()
|
||||
}
|
||||
}, [isDragging])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Reference in New Issue