fix: panel resize cursor style alway in `ew-reisze`

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-09-09 20:17:40 +08:00
parent 55b7868f2e
commit 41416d21c8
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
3 changed files with 20 additions and 20 deletions

View File

@ -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>

View File

@ -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

View File

@ -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