Skip to content

Commit

Permalink
fix: modal setting title draggable area
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 30, 2024
1 parent 9628aae commit 2a931e7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
36 changes: 22 additions & 14 deletions src/renderer/src/modules/settings/modal/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,28 @@ import { createElement, useCallback } from "react"

import { SettingModalContent } from "./content"

export const useSettingModal = (

) => {
export const useSettingModal = () => {
const { present } = useModalStack()

return useCallback((initialTab?: string) => present({
title: "Setting",
id: "setting",
content: () => createElement(SettingModalContent, {
initialTab,
}),
CustomModalComponent: (props) => createElement("div", {
className: "center h-full center",
}, props.children),

}), [present])
return useCallback(
(initialTab?: string) =>
present({
title: "Setting",
id: "setting",
content: () =>
createElement(SettingModalContent, {
initialTab,
}),
CustomModalComponent: (props) =>
createElement(
"div",
{
className: "center h-full center",
},
props.children,
),
modalContainerClassName: "overflow-hidden",
}),
[present],
)
}
2 changes: 1 addition & 1 deletion src/renderer/src/modules/settings/title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const SettingsTitle = ({
<div
className={cn(
"flex items-center gap-2 pb-2 pt-6 text-xl font-bold",
"sticky top-0 z-[11] mb-4 bg-background",
"sticky top-0 mb-4 bg-background",
className,
)}
>
Expand Down

0 comments on commit 2a931e7

Please sign in to comment.