Skip to content

Commit 28c2d7c

Browse files
✨ feat(setting): add laytout setting Split Previewer Hide Footer
1 parent 8588ed8 commit 28c2d7c

6 files changed

Lines changed: 268 additions & 414 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -66,196 +66,6 @@
6666

6767
</div>
6868

69-
## [Version 2.0.0](https://github.com/canisminor1990/sd-webui-lobe-theme/compare/v1.8.3...v2.0.0)
70-
71-
<sup>Released on **2023-06-28**</sup>
72-
73-
#### ♻ Code Refactoring
74-
75-
- **wip**: Refactor with @lobehub/ui.
76-
- **misc**: Refactor layout and styles, refactor project.
77-
78-
#### ✨ Features
79-
80-
- **wip**: Theme modify.
81-
- **misc**: Add custom logo, add primary color setting, add split t2i i2t layout.
82-
83-
#### 🐛 Bug Fixes
84-
85-
- **build**: Fix rollup-plugin-terser config.
86-
- **misc**: Fix extra button, fix gallery style, fix setting typo.
87-
88-
#### 💄 Styles
89-
90-
- **misc**: Update, update, update grenerate button style, update layout style, update svg icon.
91-
92-
<br/>
93-
94-
<details>
95-
<summary><kbd>Improvements and Fixes</kbd></summary>
96-
97-
#### Code refactoring
98-
99-
- **wip**: Refactor with @lobehub/ui ([e116458](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/e116458))
100-
- **misc**: Refactor layout and styles ([438cd1f](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/438cd1f))
101-
- **misc**: Refactor project ([b9046f1](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b9046f1))
102-
103-
#### What's improved
104-
105-
- **wip**: Theme modify ([7cdb48d](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/7cdb48d))
106-
- **misc**: Add custom logo ([34ea7aa](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/34ea7aa))
107-
- **misc**: Add primary color setting ([406aba7](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/406aba7))
108-
- **misc**: Add split t2i i2t layout ([149d1d8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/149d1d8))
109-
110-
#### What's fixed
111-
112-
- **build**: Fix rollup-plugin-terser config ([b46c7d4](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b46c7d4))
113-
- **misc**: Fix extra button ([079083b](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/079083b))
114-
- **misc**: Fix gallery style ([dd17dad](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/dd17dad))
115-
- **misc**: Fix setting typo ([9419345](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/9419345))
116-
117-
#### Styles
118-
119-
- **misc**: Update ([6e6dad8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/6e6dad8))
120-
- **misc**: Update ([ba811e6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ba811e6))
121-
- **misc**: Update grenerate button style ([48321e5](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/48321e5))
122-
- **misc**: Update layout style ([ac76d7a](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ac76d7a))
123-
- **misc**: Update svg icon ([d7e13b6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/d7e13b6))
124-
125-
</details>
126-
127-
<div align="right">
128-
129-
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
130-
131-
</div>
132-
133-
## [Version 2.0.0](https://github.com/canisminor1990/sd-webui-lobe-theme/compare/v1.8.3...v2.0.0)
134-
135-
<sup>Released on **2023-06-28**</sup>
136-
137-
#### ♻ Code Refactoring
138-
139-
- **wip**: Refactor with @lobehub/ui.
140-
- **misc**: Refactor layout and styles, refactor project.
141-
142-
#### ✨ Features
143-
144-
- **wip**: Theme modify.
145-
- **misc**: Add custom logo, add primary color setting, add split t2i i2t layout.
146-
147-
#### 🐛 Bug Fixes
148-
149-
- **build**: Fix rollup-plugin-terser config.
150-
- **misc**: Fix gallery style, fix setting typo.
151-
152-
#### 💄 Styles
153-
154-
- **misc**: Update, update, update grenerate button style, update layout style, update svg icon.
155-
156-
<br/>
157-
158-
<details>
159-
<summary><kbd>Improvements and Fixes</kbd></summary>
160-
161-
#### Code refactoring
162-
163-
- **wip**: Refactor with @lobehub/ui ([e116458](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/e116458))
164-
- **misc**: Refactor layout and styles ([438cd1f](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/438cd1f))
165-
- **misc**: Refactor project ([b9046f1](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b9046f1))
166-
167-
#### What's improved
168-
169-
- **wip**: Theme modify ([7cdb48d](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/7cdb48d))
170-
- **misc**: Add custom logo ([34ea7aa](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/34ea7aa))
171-
- **misc**: Add primary color setting ([406aba7](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/406aba7))
172-
- **misc**: Add split t2i i2t layout ([149d1d8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/149d1d8))
173-
174-
#### What's fixed
175-
176-
- **build**: Fix rollup-plugin-terser config ([b46c7d4](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b46c7d4))
177-
- **misc**: Fix gallery style ([dd17dad](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/dd17dad))
178-
- **misc**: Fix setting typo ([9419345](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/9419345))
179-
180-
#### Styles
181-
182-
- **misc**: Update ([6e6dad8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/6e6dad8))
183-
- **misc**: Update ([ba811e6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ba811e6))
184-
- **misc**: Update grenerate button style ([48321e5](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/48321e5))
185-
- **misc**: Update layout style ([ac76d7a](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ac76d7a))
186-
- **misc**: Update svg icon ([d7e13b6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/d7e13b6))
187-
188-
</details>
189-
190-
<div align="right">
191-
192-
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
193-
194-
</div>
195-
196-
## [Version 2.0.0](https://github.com/canisminor1990/sd-webui-lobe-theme/compare/v1.8.3...v2.0.0)
197-
198-
<sup>Released on **2023-06-28**</sup>
199-
200-
#### ♻ Code Refactoring
201-
202-
- **wip**: Refactor with @lobehub/ui.
203-
- **misc**: Refactor layout and styles, refactor project.
204-
205-
#### ✨ Features
206-
207-
- **wip**: Theme modify.
208-
- **misc**: Add custom logo, add primary color setting, add split t2i i2t layout.
209-
210-
#### 🐛 Bug Fixes
211-
212-
- **build**: Fix rollup-plugin-terser config.
213-
- **misc**: Fix gallery style, fix setting typo.
214-
215-
#### 💄 Styles
216-
217-
- **misc**: Update, update, update grenerate button style, update layout style, update svg icon.
218-
219-
<br/>
220-
221-
<details>
222-
<summary><kbd>Improvements and Fixes</kbd></summary>
223-
224-
#### Code refactoring
225-
226-
- **wip**: Refactor with @lobehub/ui ([e116458](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/e116458))
227-
- **misc**: Refactor layout and styles ([438cd1f](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/438cd1f))
228-
- **misc**: Refactor project ([b9046f1](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b9046f1))
229-
230-
#### What's improved
231-
232-
- **wip**: Theme modify ([7cdb48d](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/7cdb48d))
233-
- **misc**: Add custom logo ([34ea7aa](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/34ea7aa))
234-
- **misc**: Add primary color setting ([406aba7](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/406aba7))
235-
- **misc**: Add split t2i i2t layout ([149d1d8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/149d1d8))
236-
237-
#### What's fixed
238-
239-
- **build**: Fix rollup-plugin-terser config ([b46c7d4](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/b46c7d4))
240-
- **misc**: Fix gallery style ([dd17dad](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/dd17dad))
241-
- **misc**: Fix setting typo ([9419345](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/9419345))
242-
243-
#### Styles
244-
245-
- **misc**: Update ([6e6dad8](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/6e6dad8))
246-
- **misc**: Update ([ba811e6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ba811e6))
247-
- **misc**: Update grenerate button style ([48321e5](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/48321e5))
248-
- **misc**: Update layout style ([ac76d7a](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/ac76d7a))
249-
- **misc**: Update svg icon ([d7e13b6](https://github.com/canisminor1990/sd-webui-lobe-theme/commit/d7e13b6))
250-
251-
</details>
252-
253-
<div align="right">
254-
255-
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
256-
257-
</div>
258-
25969
### Version 1.8.3
26070

26171
<sup>Released on **2023-05-30**</sup>

javascript/main.js

Lines changed: 231 additions & 221 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/Footer/index.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import { Footer as F } from '@lobehub/ui';
2+
import isEqual from 'fast-deep-equal';
23
import { memo, useEffect, useRef } from 'react';
34

5+
import { useAppStore } from '@/store';
46
import { DivProps } from '@/types/index';
57

68
import { columns } from './data';
79
import { useStyles } from './style';
810

911
const Footer = memo<DivProps>(({ className, ...props }) => {
12+
const setting = useAppStore((st) => st.setting, isEqual);
1013
const { cx, styles } = useStyles();
1114
const footerReference = useRef<HTMLDivElement>(null);
1215

@@ -16,7 +19,11 @@ const Footer = memo<DivProps>(({ className, ...props }) => {
1619
}, []);
1720
return (
1821
<div className={cx(styles.footer, className)} {...props}>
19-
<F bottom={<div ref={footerReference} />} columns={columns} />
22+
{setting.layoutHideFooter ? (
23+
<div ref={footerReference} />
24+
) : (
25+
<F bottom={<div ref={footerReference} />} columns={columns} />
26+
)}
2027
</div>
2128
);
2229
});

src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const Index = memo(() => {
4141
<QuickSettingSidebar headerHeight={HEADER_HEIGHT} />
4242
</LayoutSidebar>
4343
<Content />
44-
{mobile === false && (
44+
{setting.layoutSplitPreviewer && mobile === false && (
4545
<LayoutSidebar
4646
className={cx(styles.sidebar, styles.panel)}
4747
headerHeight={HEADER_HEIGHT}

src/slots/Setting/SettingForm.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Icon, Swatches } from '@lobehub/ui';
22
import { Button, Divider, Form, Input, InputNumber, Segmented, Switch } from 'antd';
33
import isEqual from 'fast-deep-equal';
4-
import { Palette, PanelLeftClose, PanelRightClose, TextCursorInput } from 'lucide-react';
4+
import { Layout, Palette, PanelLeftClose, PanelRightClose, TextCursorInput } from 'lucide-react';
55
import { memo, useCallback, useMemo, useState } from 'react';
66
import { shallow } from 'zustand/shallow';
77

@@ -103,6 +103,29 @@ const SettingForm = memo(() => {
103103
<Switch />
104104
</Item>
105105
</div>
106+
<div className={styles.group}>
107+
<div className={styles.title}>
108+
<Icon icon={Layout} />
109+
Layout
110+
</div>
111+
<Item
112+
className={styles.item}
113+
label="Split Previewer"
114+
name="layoutSplitPreviewer"
115+
valuePropName="checked"
116+
>
117+
<Switch />
118+
</Item>
119+
<Divider style={{ margin: 0 }} />
120+
<Item
121+
className={styles.item}
122+
label="Hide Footer"
123+
name="layoutHideFooter"
124+
valuePropName="checked"
125+
>
126+
<Switch />
127+
</Item>
128+
</div>
106129
<div className={styles.group}>
107130
<div className={styles.title}>
108131
<Icon icon={PanelLeftClose} />

src/store/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export interface WebuiSetting {
2525
extraNetworkFixedMode: 'fixed' | 'float';
2626
extraNetworkSidebarExpand: boolean;
2727
extraNetworkSidebarWidth: number;
28+
layoutHideFooter: boolean;
29+
layoutSplitPreviewer: boolean;
2830
logoCustomTitle: string | undefined;
2931
logoCustomUrl: string | undefined;
3032
logoType: 'lobe' | 'kitchen' | 'custom';
@@ -44,6 +46,8 @@ export const defaultSetting: WebuiSetting = {
4446
extraNetworkFixedMode: 'fixed',
4547
extraNetworkSidebarExpand: true,
4648
extraNetworkSidebarWidth: 340,
49+
layoutHideFooter: false,
50+
layoutSplitPreviewer: true,
4751
logoCustomTitle: '',
4852
logoCustomUrl: '',
4953
logoType: 'lobe',

0 commit comments

Comments
 (0)