Skip to content

Commit

Permalink
[Optimization-2588][studio] Optimize hide console when closing all tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwenmo committed Nov 30, 2023
1 parent 7e5f22d commit 448ba86
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dinky-web/src/pages/DataStudio/BottomContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const BottomContainer: React.FC<BottomContainerProps> = (props: any) => {
marginTop: 0,
backgroundColor: '#fff',
position: 'fixed',
// bottom: VIEW.footerHeight
bottom: VIEW.footerHeight
}}
defaultSize={{ width: '100%', height: height }}
minHeight={VIEW.midMargin}
Expand Down
12 changes: 6 additions & 6 deletions dinky-web/src/pages/DataStudio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const DataStudio = (props: any) => {
const themeValue = useThemeValue();
const app = getDvaApp(); // 获取dva的实例
const persist = app._store.persist;
let bottomHeight = !isProject ? 0 : bottomContainer.selectKey === '' ? 0 : bottomContainer.height;
const { fullscreen } = useEditor();

const getClientSize = () => ({
Expand All @@ -89,7 +88,8 @@ const DataStudio = (props: any) => {

const onResize = () => {
setSize(getClientSize());
const centerContentHeight = getClientSize().contentHeight - bottomHeight;
const newBottomHeight = !isProject ? 0 : bottomContainer.selectKey === '' ? 0 : bottomContainer.height;
const centerContentHeight = getClientSize().contentHeight - newBottomHeight;
updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
};
Expand Down Expand Up @@ -117,8 +117,8 @@ const DataStudio = (props: any) => {
};

useEffect(() => {
bottomHeight = !isProject ? 0 : bottomContainer.selectKey === '' ? 0 : bottomContainer.height;
const centerContentHeight = size.contentHeight - bottomHeight;
const newBottomHeight = !isProject ? 0 : bottomContainer.selectKey === '' ? 0 : bottomContainer.height;
const centerContentHeight = size.contentHeight - newBottomHeight;
updateCenterContentHeight(centerContentHeight);
updateToolContentHeight(centerContentHeight - VIEW.leftMargin);
}, [activeKey]);
Expand Down Expand Up @@ -245,9 +245,9 @@ const DataStudio = (props: any) => {
>
<MiddleContainer />
</Content>
<RightContainer size={size} bottomHeight={bottomHeight} />
<RightContainer size={size} bottomHeight={bottomContainer.height} />
</div>
{isProject && <BottomContainer size={size} height={bottomHeight} />}
{isProject && <BottomContainer size={size} height={bottomContainer.height} />}
</Content>

<Sider collapsed collapsedWidth={40}>
Expand Down
8 changes: 4 additions & 4 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,12 @@ const config = {
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
/*announcementBar: {
announcementBar: {
id: 'announcementBar-2', // Increment on change
content: `⭐️ &nbsp; If you like Dinky , give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/DataLinkDC/dlink">GitHub</a> . Domain name will be migrated soon , The new domain name is <a target="_blank" rel="noopener noreferrer" href="http://docs.dinky.org.cn">docs.dinky.org.cn</a>`,
content: `⭐️ &nbsp; If you like Dinky , give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/DataLinkDC/dlink">GitHub</a> . Domain name will be migrated soon , The new domain name is <a target="_blank" rel="noopener noreferrer" href="http://www.dinky.org.cn">www.dinky.org.cn</a>`,
backgroundColor: "#BBDFFF",
isCloseable: false,
},*/
},
hideOnScroll: false, // 滚动时是否隐藏 | Whether to hide the sidebar on scroll
docs: {
sidebar: {
Expand Down Expand Up @@ -269,7 +269,7 @@ const config = {
height: 30,
},
copyright: `Copyright © ${new Date().getFullYear()} Dinky, Inc. DataLinkDC.<br/>
<a href="https://beian.miit.gov.cn" target="_blank">鲁ICP备20001630号-2</a>`,
<a href="https://beian.miit.gov.cn" target="_blank">鲁ICP备20001630号-3</a>`,
},
prism: {
theme: lightCodeTheme,
Expand Down

0 comments on commit 448ba86

Please sign in to comment.