Skip to content

Commit

Permalink
fix: icon setting can close and open right panel (#3295)
Browse files Browse the repository at this point in the history
* fix: icon setting input box can close and open right panel

* fix: unsued import
  • Loading branch information
urmauur authored Aug 7, 2024
1 parent 26be941 commit be31e93
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions web/screens/Thread/ThreadCenterPanel/ChatInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useState } from 'react'

import { Button, useMediaQuery } from '@janhq/joi'
import { Button } from '@janhq/joi'
import { useAtom, useAtomValue, useSetAtom } from 'jotai'
import { SettingsIcon, ChevronUpIcon, Settings2Icon } from 'lucide-react'

Expand All @@ -27,8 +27,6 @@ const ChatInput: React.FC<Props> = ({ sendMessage, stopInference }) => {
const [activeSetting, setActiveSetting] = useState(false)
const [showRightPanel, setShowRightPanel] = useAtom(showRightPanelAtom)

const matches = useMediaQuery('(max-width: 880px)')

return (
<div className="relative p-4 pb-2">
<div className="relative flex w-full flex-col">
Expand Down Expand Up @@ -72,11 +70,7 @@ const ChatInput: React.FC<Props> = ({ sendMessage, stopInference }) => {
theme="icon"
onClick={() => {
setActiveTabThreadRightPanel('model')
if (matches) {
setShowRightPanel(!showRightPanel)
} else if (!showRightPanel) {
setShowRightPanel(true)
}
setShowRightPanel(!showRightPanel)
}}
>
<Settings2Icon
Expand Down

0 comments on commit be31e93

Please sign in to comment.