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:
parent
26be941e84
commit
be31e9315e
@ -1,6 +1,6 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
||||||
import { Button, useMediaQuery } from '@janhq/joi'
|
import { Button } from '@janhq/joi'
|
||||||
import { useAtom, useAtomValue, useSetAtom } from 'jotai'
|
import { useAtom, useAtomValue, useSetAtom } from 'jotai'
|
||||||
import { SettingsIcon, ChevronUpIcon, Settings2Icon } from 'lucide-react'
|
import { SettingsIcon, ChevronUpIcon, Settings2Icon } from 'lucide-react'
|
||||||
|
|
||||||
@ -27,8 +27,6 @@ const ChatInput: React.FC<Props> = ({ sendMessage, stopInference }) => {
|
|||||||
const [activeSetting, setActiveSetting] = useState(false)
|
const [activeSetting, setActiveSetting] = useState(false)
|
||||||
const [showRightPanel, setShowRightPanel] = useAtom(showRightPanelAtom)
|
const [showRightPanel, setShowRightPanel] = useAtom(showRightPanelAtom)
|
||||||
|
|
||||||
const matches = useMediaQuery('(max-width: 880px)')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative p-4 pb-2">
|
<div className="relative p-4 pb-2">
|
||||||
<div className="relative flex w-full flex-col">
|
<div className="relative flex w-full flex-col">
|
||||||
@ -72,11 +70,7 @@ const ChatInput: React.FC<Props> = ({ sendMessage, stopInference }) => {
|
|||||||
theme="icon"
|
theme="icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setActiveTabThreadRightPanel('model')
|
setActiveTabThreadRightPanel('model')
|
||||||
if (matches) {
|
setShowRightPanel(!showRightPanel)
|
||||||
setShowRightPanel(!showRightPanel)
|
|
||||||
} else if (!showRightPanel) {
|
|
||||||
setShowRightPanel(true)
|
|
||||||
}
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Settings2Icon
|
<Settings2Icon
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user