Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit 9bd7c6f

Browse files
committed
chore: merge branch 'dev'
2 parents b394923 + 86b2608 commit 9bd7c6f

File tree

9 files changed

+29
-17
lines changed

9 files changed

+29
-17
lines changed

components/Modal/styles/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { theme, animate } from 'utils'
3+
import { theme, animate, cs } from 'utils'
44
import Img from 'Img'
55

66
// display: ${props => (props.show ? 'block' : 'none')};
@@ -11,7 +11,7 @@ export const Mask = styled.div`
1111
right: 0;
1212
bottom: 0;
1313
left: 0;
14-
z-index: 1000;
14+
z-index: ${cs.zIndex.modalOverlay};
1515
display: ${({ show }) => (show ? 'block' : 'none')};
1616
`
1717

containers/Doraemon/styles/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const PageOverlay = styled.div`
99
position: fixed;
1010
right: 0;
1111
top: 0;
12-
z-index: 1001;
12+
z-index: ${cs.zIndex.doraemonOverlay};
1313
display: ${({ visible }) => (visible ? 'block' : 'none')};
1414
`
1515
// flex-grow example: http://zhoon.github.io/css3/2014/08/23/flex.html
@@ -19,7 +19,7 @@ export const PanelContainer = styled.div`
1919
max-width: 550px;
2020
position: fixed;
2121
top: 12vh;
22-
z-index: 1002;
22+
z-index: ${cs.zIndex.doraemon};
2323
display: ${({ visible }) => (visible ? 'block' : 'none')};
2424
left: 50%;
2525
margin-left: -19vw;

containers/Doraemon/styles/results_list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const PageOverlay = styled.div`
2525
position: fixed;
2626
right: 0;
2727
top: 0;
28-
z-index: 1001;
28+
z-index: ${cs.zIndex.doraemonOverlay};
2929
display: ${({ visible }) => (visible ? 'block' : 'none')};
3030
`
3131
// flex-grow example: http://zhoon.github.io/css3/2014/08/23/flex.html
@@ -35,7 +35,7 @@ export const PanelContainer = styled.div`
3535
max-width: 550px;
3636
position: fixed;
3737
top: 12vh;
38-
z-index: 1002;
38+
z-index: ${cs.zIndex.doraemon};
3939
display: ${({ visible }) => (visible ? 'block' : 'none')};
4040
left: 50%;
4141
margin-left: -19vw;

containers/Preview/styles/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,10 @@ export const PreviewOverlay = styled.div`
3434
position: fixed;
3535
height: 100%;
3636
right: 0;
37-
z-index: 998;
37+
z-index: ${cs.zIndex.previewOverlay};
3838
top: 0;
3939
visibility: ${({ visible }) => (visible ? 'visible' : 'hidden')};
4040
`
41-
// z-index: 1001;
42-
// z-index: ${props => (props.visible ? 1001 : -1)};
43-
// display: ${props => (props.visible ? 'block' : 'none')};
44-
// visibility: ${props => (props.visible ? 'visible' : 'hidden')};
4541

4642
export const PreviewWrapper = styled.div`
4743
${cs.flex()};
@@ -59,7 +55,7 @@ export const PreviewWrapper = styled.div`
5955
position: fixed;
6056
transform: ${({ visible }) => doTransform(visible)};
6157
top: 0px;
62-
z-index: 1000;
58+
z-index: ${cs.zIndex.preview};
6359
`
6460
export const PreviewContent = styled.div`
6561
width: 90%;

containers/Sidebar/Sidebar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { theme } from 'utils'
3+
import { theme, cs } from 'utils'
44

55
const SideBar = styled.div`
66
border-right: 1px solid;
@@ -10,7 +10,7 @@ const SideBar = styled.div`
1010
width: ${({ open }) => (open ? '256px' : '56px')};
1111
background: ${theme('sidebar.bg')};
1212
border-color: ${theme('sidebar.border_color')};
13-
z-index: 1000;
13+
z-index: ${cs.zIndex.sidebar};
1414
overflow-y: scroll;
1515
overflow-x: hidden;
1616

containers/Sidebar/styles/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const Container = styled.aside`
1414
box-shadow: ${({ pin }) => (pin ? '3px 0 20px rgba(0, 0, 0, 0.2); ' : '')};
1515
background: ${theme('sidebar.bg')};
1616
border-color: ${theme('sidebar.borderColor')};
17-
z-index: 2000;
17+
z-index: ${cs.zIndex.sidebar};
1818
overflow: hidden;
1919
2020
transition: width 0.2s, opacity 0.8s, box-shadow 0.1s linear 0.1s,

containers/Sidebar/styles/menu_bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Container } from './index'
66

77
export const Wrapper = styled.div`
88
display: block;
9-
z-index: 2001;
9+
z-index: ${cs.zIndex.sidebar + 1};
1010
&:hover {
1111
background: ${theme('sidebar.menuHover')};
1212
}

containers/ThemeWrapper/AntUIOverWrite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { createGlobalStyle } from 'styled-components'
22
import { lighten } from 'polished'
33

4-
import { theme } from 'utils'
4+
import { theme, cs } from 'utils'
55

66
// move ant style to seperate file
77
const AntUIOverWrite = createGlobalStyle`
@@ -78,6 +78,9 @@ const AntUIOverWrite = createGlobalStyle`
7878
7979
// ----
8080
// popover
81+
.ant-popover {
82+
z-index: ${cs.zIndex.popover};
83+
}
8184
.ant-popover-inner-content {
8285
padding: 0;
8386
}

utils/common_styles.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ const flexColumnGrow = opt => `
8181
flex-grow: 1;
8282
`
8383

84+
const zIndex = {
85+
popover: 2100,
86+
modalOverlay: 2500,
87+
previewOverlay: 2000,
88+
preview: 2001,
89+
doraemonOverlay: 2600,
90+
doraemon: 2601,
91+
92+
//
93+
sidebar: 1999,
94+
}
95+
8496
const cs = {
8597
truncate,
8698
circle,
@@ -89,6 +101,7 @@ const cs = {
89101
flexGrow,
90102
flexColumn,
91103
flexColumnGrow,
104+
zIndex,
92105
}
93106

94107
export default cs

0 commit comments

Comments
 (0)