Skip to content

Commit 1d1293d

Browse files
committed
refactor: const z-index Level
1 parent 50586bb commit 1d1293d

File tree

30 files changed

+71
-69
lines changed

30 files changed

+71
-69
lines changed

frontend/src/app/components/ChartEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import { FC, useCallback, useEffect, useMemo, useRef, useState } from 'react';
6060
import { useDispatch, useSelector } from 'react-redux';
6161
import { useHistory } from 'react-router';
6262
import styled from 'styled-components/macro';
63-
import { EMPHASIS_LEVEL } from 'styles/StyleConstants';
63+
import { LEVEL_100 } from 'styles/StyleConstants';
6464
import { CloneValueDeep, isEmptyArray } from 'utils/object';
6565
import ChartWorkbench from '../pages/ChartWorkbenchPage/components/ChartWorkbench/ChartWorkbench';
6666
import {
@@ -598,7 +598,7 @@ const StyledChartWorkbenchPage = styled.div`
598598
right: 0;
599599
bottom: 0;
600600
left: 0;
601-
z-index: ${EMPHASIS_LEVEL * 6};
601+
z-index: ${LEVEL_100};
602602
display: flex;
603603
min-width: 0;
604604
min-height: 0;

frontend/src/app/components/ChartGraph/BasicTableChart/TableComponents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Tooltip } from 'antd';
33
import React from 'react';
44
import { Resizable } from 'react-resizable';
55
import styled from 'styled-components/macro';
6-
import { BLUE, STICKY_LEVEL } from 'styles/StyleConstants';
6+
import { BLUE, LEVEL_1 } from 'styles/StyleConstants';
77

88
export const TableComponentsTd = ({
99
children,
@@ -78,7 +78,7 @@ const ResizableHandleStyle = styled.span`
7878
position: absolute;
7979
right: -5px;
8080
bottom: 0;
81-
z-index: ${STICKY_LEVEL};
81+
z-index: ${LEVEL_1};
8282
width: 10px;
8383
height: 100%;
8484
cursor: col-resize;

frontend/src/app/components/LoadingMask.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { LoadingOutlined } from '@ant-design/icons';
22
import { cloneElement, ReactElement } from 'react';
33
import styled, { createGlobalStyle } from 'styled-components/macro';
4-
import { STICKY_LEVEL } from 'styles/StyleConstants';
4+
import { LEVEL_1 } from 'styles/StyleConstants';
55

66
interface LoadingMaskProps {
77
loading: boolean;
@@ -28,7 +28,7 @@ const SpinWrapper = styled.div`
2828
right: 0;
2929
bottom: 0;
3030
left: 0;
31-
z-index: ${STICKY_LEVEL};
31+
z-index: ${LEVEL_1};
3232
display: flex;
3333
align-items: center;
3434
justify-content: center;

frontend/src/app/pages/ChartWorkbenchPage/components/ChartOperationPanel/components/ChartDraggable/ChartDragLayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import { DragLayer } from 'react-dnd';
2020
import styled from 'styled-components';
21-
import { EMPHASIS_LEVEL } from 'styles/StyleConstants';
21+
import { LEVEL_100 } from 'styles/StyleConstants';
2222
import ChartDragPreview from './ChartDragPreview';
2323

2424
const collect = monitor => {
@@ -76,6 +76,6 @@ const LayerStyles = styled.div`
7676
right: 0;
7777
bottom: 0;
7878
left: 0;
79-
z-index: ${EMPHASIS_LEVEL * 10};
79+
z-index: ${LEVEL_100};
8080
pointer-events: none;
8181
`;

frontend/src/app/pages/ChartWorkbenchPage/components/ChartOperationPanel/components/ChartPresentPanel/ChartPresentPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { useSelector } from 'react-redux';
3333
import styled from 'styled-components/macro';
3434
import {
3535
BORDER_RADIUS,
36-
EMPHASIS_LEVEL,
36+
LEVEL_10,
3737
LINE_HEIGHT_ICON_XXL,
3838
SPACE_LG,
3939
SPACE_MD,
@@ -204,7 +204,7 @@ const ReloadMask = styled.div`
204204
position: absolute;
205205
top: 0;
206206
left: 0;
207-
z-index: ${EMPHASIS_LEVEL};
207+
z-index: ${LEVEL_10};
208208
display: flex;
209209
align-items: center;
210210
justify-content: center;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { BoardState } from 'app/pages/DashBoardPage/pages/Board/slice/types';
2727
import React, { useCallback, useContext, useMemo, useState } from 'react';
2828
import { useDispatch, useSelector } from 'react-redux';
2929
import styled from 'styled-components/macro';
30-
import { EMPHASIS_LEVEL, G90, WHITE } from 'styles/StyleConstants';
30+
import { G90, LEVEL_10, WHITE } from 'styles/StyleConstants';
3131
import { CanFullScreenWidgetTypes } from '../../constants';
3232
import { BoardContext } from '../BoardProvider/BoardProvider';
3333
import { FullScreenWidgetMapper } from './FullScreenWidgetMapper';
@@ -131,7 +131,7 @@ const FullScreenWrap = styled.div<{ show: boolean }>`
131131
right: 0;
132132
bottom: 0;
133133
left: 0;
134-
z-index: ${EMPHASIS_LEVEL * 10};
134+
z-index: ${LEVEL_10 * 10};
135135
display: flex;
136136
flex-direction: column;
137137
width: 100%;
@@ -158,7 +158,7 @@ const FullScreenWrap = styled.div<{ show: boolean }>`
158158
position: absolute;
159159
top: 64px;
160160
left: ${p => (p.show ? '0' : '-300px')};
161-
z-index: ${EMPHASIS_LEVEL};
161+
z-index: ${LEVEL_10};
162162
width: 300px;
163163
height: 100%;
164164

frontend/src/app/pages/DashBoardPage/components/WidgetComponents/BlockMaskLayer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import React, { memo, useCallback, useMemo } from 'react';
2424
import { useDispatch, useSelector } from 'react-redux';
2525
import styled from 'styled-components/macro';
26-
import { EMPHASIS_LEVEL, INFO, SUCCESS } from 'styles/StyleConstants';
26+
import { INFO, LEVEL_20, LEVEL_5, SUCCESS } from 'styles/StyleConstants';
2727
import {
2828
editDashBoardInfoActions,
2929
editWidgetInfoActions,
@@ -104,7 +104,7 @@ const MaskLayer = styled.div<MaskLayerProps>`
104104
position: absolute;
105105
top: -5px;
106106
left: -5px;
107-
z-index: ${p => (p.front ? EMPHASIS_LEVEL + 10 : EMPHASIS_LEVEL - 5)};
107+
z-index: ${p => (p.front ? LEVEL_20 : LEVEL_5)};
108108
width: calc(100% + 10px);
109109
height: calc(100% + 10px);
110110
cursor: move;

frontend/src/app/pages/DashBoardPage/components/WidgetComponents/StyledWidgetToolBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
*/
1818
import { memo } from 'react';
1919
import styled from 'styled-components/macro';
20-
import { EMPHASIS_LEVEL } from 'styles/StyleConstants';
20+
import { LEVEL_50 } from 'styles/StyleConstants';
2121
export const StyledWidgetToolBar: React.FC<{}> = memo(props => {
2222
return <StyleWrap>{props.children} </StyleWrap>;
2323
});
2424
const StyleWrap = styled.div`
2525
position: absolute;
2626
top: 0;
2727
right: 0;
28-
z-index: ${EMPHASIS_LEVEL * 3};
28+
z-index: ${LEVEL_50};
2929
overflow: hidden;
3030
text-align: right;
3131
.widget-tool-dropdown {

frontend/src/app/pages/DashBoardPage/components/WidgetComponents/WidgetDndHandleMask.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import React, { memo } from 'react';
2424
import { useDrag } from 'react-dnd';
2525
import { useDispatch } from 'react-redux';
26-
import { EMPHASIS_LEVEL } from 'styles/StyleConstants';
26+
import { LEVEL_10 } from 'styles/StyleConstants';
2727
import { editBoardStackActions } from '../../pages/BoardEditor/slice';
2828
export interface WidgetDndHandleMaskProps {
2929
widgetId: string;
@@ -86,7 +86,7 @@ export const WidgetDndHandleMask: React.FC<WidgetDndHandleMaskProps> = memo(
8686
position: 'absolute',
8787
cursor: 'grabbing',
8888
top: '0',
89-
zIndex: EMPHASIS_LEVEL + 5,
89+
zIndex: LEVEL_10 + 1,
9090
width: '100%',
9191
height: '100%',
9292
}}

frontend/src/app/pages/DashBoardPage/components/WidgetComponents/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
*/
1818

1919
import type { CSSProperties } from 'react';
20-
import { EMPHASIS_LEVEL } from 'styles/StyleConstants';
20+
import { LEVEL_10 } from 'styles/StyleConstants';
2121
export const FlexStyle: CSSProperties = {
2222
display: 'flex',
2323
flex: '1',
2424
minHeight: '0',
2525
};
2626
export const ZIndexStyle: CSSProperties = {
27-
zIndex: EMPHASIS_LEVEL,
27+
zIndex: LEVEL_10,
2828
display: 'flex',
2929
flexDirection: 'column',
3030
width: '100%',

0 commit comments

Comments
 (0)