fix: icon setting can close and open right panel (#3295)

* fix: icon setting input box can close and open right panel

* fix: unsued import
This commit is contained in:
Faisal Amir 2024-08-07 20:09:07 +07:00 committed by GitHub
parent 26be941e84
commit be31e9315e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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'
@ -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">
@ -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)
}
}}
>
<Settings2Icon