mirror of
https://github.com/lobehub/sd-webui-lobe-theme.git
synced 2026-01-09 06:23:44 +08:00
🔨 chore: remove sidebar auto collapse
This commit is contained in:
parent
51dc2aaa60
commit
906be79144
File diff suppressed because one or more lines are too long
@ -1,11 +1,9 @@
|
||||
import { DraggablePanel } from '@/components'
|
||||
import { WebuiSetting } from '@/components/Header/Setting'
|
||||
import { useAppStore } from '@/store'
|
||||
import { useLocalStorageState } from 'ahooks'
|
||||
import { useResponsive } from 'antd-style'
|
||||
import React, { CSSProperties, useEffect } from 'react'
|
||||
import styled from 'styled-components'
|
||||
import { shallow } from 'zustand/shallow'
|
||||
import PromptGroup from './PromptGroup'
|
||||
|
||||
const SidebarView = styled.div`
|
||||
@ -23,21 +21,15 @@ interface SidebarProps {
|
||||
|
||||
const Sidebar: React.FC<SidebarProps> = ({ children, loading, style }) => {
|
||||
const { mobile } = useResponsive()
|
||||
const [currentTab] = useAppStore((st) => [st.currentTab], shallow)
|
||||
const [setting] = useLocalStorageState<WebuiSetting>('SD-KITCHEN-SETTING')
|
||||
const [expand, setExpand] = useLocalStorageState<boolean>('SD-KITCHEN-SIDEBAR', {
|
||||
defaultValue: true,
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (mobile) setExpand(false)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
if (currentTab && !['tab_txt2img', 'tab_img2img'].includes(currentTab)) {
|
||||
setExpand(false)
|
||||
}
|
||||
}, [currentTab])
|
||||
|
||||
return (
|
||||
<DraggablePanel
|
||||
maxHeight
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user