Skip to content

Commit

Permalink
fix: panel resize cursor style alway in ew-reisze
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Sep 9, 2024
1 parent 55b7868 commit 41416d2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/renderer/src/components/errors/PageError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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>

Expand Down
16 changes: 16 additions & 0 deletions src/renderer/src/components/ui/divider/PanelSpliter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions src/renderer/src/pages/(main)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41416d2

Please sign in to comment.