Skip to content

Commit

Permalink
💄 style: fix sidebar style
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 committed Apr 22, 2023
1 parent 0273840 commit 8738409
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
12 changes: 6 additions & 6 deletions javascript/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/ExtraNetworkSidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const SidebarView = styled.div<{ size: number }>`

const Footer = styled.div`
flex: 0;
padding: 12px 16px;
border-top: 1px soild ${({ theme }) => theme.colorSplit};
padding: 8px 16px;
display: flex;
align-items: center;
justify-content: flex-start;
border-top: 1px solid var(--color-border);
`

const ZoomSlider = styled(Slider)`
Expand Down
13 changes: 10 additions & 3 deletions src/components/Sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DraggablePanel } from '@/components'
import { useResponsive } from 'antd-style'
import React, { useEffect, useState } from 'react'
import React, { CSSProperties, useEffect, useState } from 'react'
import styled from 'styled-components'
import PromptGroup from './PromptGroup'

Expand All @@ -14,9 +14,10 @@ const SidebarView = styled.div`
interface SidebarProps {
children: React.ReactNode
loading?: boolean
style?: CSSProperties
}

const Sidebar: React.FC<SidebarProps> = ({ children, loading }) => {
const Sidebar: React.FC<SidebarProps> = ({ children, loading, style }) => {
const { mobile } = useResponsive()
const [expand, setExpand] = useState<boolean>(!mobile)

Expand All @@ -25,7 +26,13 @@ const Sidebar: React.FC<SidebarProps> = ({ children, loading }) => {
}, [mobile])

return (
<DraggablePanel placement="left" defaultSize={{ width: 280 }} isExpand={expand} onExpandChange={setExpand}>
<DraggablePanel
style={style}
placement="left"
defaultSize={{ width: 280 }}
isExpand={expand}
onExpandChange={setExpand}
>
<SidebarView>
{!loading && <PromptGroup />}
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const App: React.FC<AppProps> = ({ themeMode }) => {
<div ref={headerRef} className="header" />
</Header>
<View>
<Sidebar>
<Sidebar style={['tab_txt2img', 'tab_img2img'].includes(currentTab) ? {} : { display: 'none' }}>
{loading && (
<LoadingBox>
<Spin size="small" />
Expand Down

0 comments on commit 8738409

Please sign in to comment.