Skip to content

Commit d312cf6

Browse files
committed
style: FullScreenPanel
1 parent b12f865 commit d312cf6

File tree

1 file changed

+19
-29
lines changed

1 file changed

+19
-29
lines changed

frontend/src/app/pages/DashBoardPage/components/FullScreenPanel/FullScreenPanel.tsx

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,23 @@
1616
* limitations under the License.
1717
*/
1818
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
19-
import { Button, Layout, Menu } from 'antd';
19+
import { Button, Menu } from 'antd';
2020
import { WidgetWrapProvider } from 'app/pages/DashBoardPage/components/WidgetProvider/WidgetWrapProvider';
2121
import { boardActions } from 'app/pages/DashBoardPage/pages/Board/slice';
2222
import {
2323
makeSelectBoardFullScreenPanelById,
2424
selectBoardWidgetMapById,
2525
} from 'app/pages/DashBoardPage/pages/Board/slice/selector';
2626
import { BoardState } from 'app/pages/DashBoardPage/pages/Board/slice/types';
27-
import React, { useCallback, useContext, useMemo, useState } from 'react';
27+
import { memo, useCallback, useContext, useMemo, useState } from 'react';
2828
import { useDispatch, useSelector } from 'react-redux';
2929
import styled from 'styled-components/macro';
30-
import { G90, LEVEL_10, WHITE } from 'styles/StyleConstants';
30+
import { LEVEL_10, LEVEL_100, SPACE_LG, SPACE_SM } from 'styles/StyleConstants';
3131
import { CanFullScreenWidgetTypes } from '../../constants';
3232
import { BoardContext } from '../BoardProvider/BoardProvider';
3333
import { FullScreenWidgetMapper } from './FullScreenWidgetMapper';
3434

35-
const { Header } = Layout;
36-
37-
export const FullScreenPanel: React.FC<{}> = () => {
35+
export const FullScreenPanel: React.FC<{}> = memo(() => {
3836
const { boardId, boardType } = useContext(BoardContext);
3937
const dispatch = useDispatch();
4038

@@ -93,21 +91,20 @@ export const FullScreenPanel: React.FC<{}> = () => {
9391
<>
9492
{itemId && (
9593
<FullScreenWrap show={collapsed}>
96-
<Header className="full-header">
94+
<FullHeader>
9795
<div onClick={toggle}>
9896
{collapsed ? <MenuFoldOutlined /> : <MenuUnfoldOutlined />}
9997
<span>{widgetMap[itemId].config.name}</span>
10098
</div>
10199
<Button className="close-fullscreen" onClick={closeFullScreen}>
102100
取消全屏
103101
</Button>
104-
</Header>
102+
</FullHeader>
105103
<div className="full-container">
106104
{chart}
107105
{itemId && (
108106
<div className="full-menu">
109107
<Menu
110-
theme="light"
111108
mode="inline"
112109
onClick={changeItem}
113110
defaultSelectedKeys={[itemId]}
@@ -123,32 +120,22 @@ export const FullScreenPanel: React.FC<{}> = () => {
123120
)}
124121
</>
125122
);
126-
};
123+
});
127124

128125
const FullScreenWrap = styled.div<{ show: boolean }>`
129126
position: fixed;
130127
top: 0;
131128
right: 0;
132129
bottom: 0;
133130
left: 0;
134-
z-index: ${LEVEL_10 * 10};
131+
z-index: ${LEVEL_100};
135132
display: flex;
136133
flex-direction: column;
137134
width: 100%;
138135
height: 100%;
139-
140-
background-color: ${WHITE};
136+
background-color: ${p => p.theme.componentBackground};
141137
transition: all 3s ease-out;
142138
143-
.full-header {
144-
display: flex;
145-
justify-content: space-between;
146-
background-color: transparent;
147-
}
148-
.close-fullscreen {
149-
margin-top: 20px;
150-
color: ${G90};
151-
}
152139
.full-container {
153140
display: flex;
154141
flex: 1;
@@ -161,13 +148,16 @@ const FullScreenWrap = styled.div<{ show: boolean }>`
161148
z-index: ${LEVEL_10};
162149
width: 300px;
163150
height: 100%;
164-
165-
background-color: rgba(250, 250, 250, 0.859);
166-
151+
background-color: ${p => p.theme.bodyBackground};
167152
transition: all 0.3s;
168-
169-
.ant-menu {
170-
background-color: transparent;
171-
}
172153
}
173154
`;
155+
const FullHeader = styled.div`
156+
display: flex;
157+
flex-shrink: 0;
158+
align-items: center;
159+
justify-content: space-between;
160+
padding: ${SPACE_SM} ${SPACE_LG};
161+
background-color: ${p => p.theme.componentBackground};
162+
box-shadow: ${p => p.theme.shadowSider};
163+
`;

0 commit comments

Comments
 (0)