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

Commit 6300ed9

Browse files
committed
chore: merge branch 'custom-scrollbar' into dev
2 parents a2691b3 + 7680cd5 commit 6300ed9

File tree

5 files changed

+56
-15
lines changed

5 files changed

+56
-15
lines changed

containers/ThemeWrapper/GlobalStyle.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createGlobalStyle } from 'styled-components'
1+
import { createGlobalStyle, css } from 'styled-components'
22
import { theme, cs } from '@utils'
33
import normalize from './normalize'
44

@@ -18,7 +18,7 @@ const GlobalStyle = createGlobalStyle`
1818
body {
1919
${cs.media.mobile`
2020
position: relative;
21-
`};
21+
`};
2222
}
2323
*::-moz-selection {
2424
background-color: ${theme('selectionBg')} !important;
@@ -138,6 +138,33 @@ const GlobalStyle = createGlobalStyle`
138138
padding: 0 1px;
139139
color: ${theme('searchHighlight.doramonFg')};
140140
}
141+
142+
${({ isMacOS }) =>
143+
isMacOS ||
144+
css`
145+
::-webkit-scrollbar {
146+
background: transparent;
147+
width: 4px;
148+
}
149+
::-webkit-scrollbar-button {
150+
background: transparent;
151+
}
152+
::-webkit-scrollbar-track {
153+
background: transparent;
154+
}
155+
::-webkit-scrollbar-track-piece {
156+
background: transparent;
157+
}
158+
::-webkit-scrollbar-thumb {
159+
background: ${theme('banner.title')};
160+
}
161+
::-webkit-scrollbar-corner {
162+
background: grey;
163+
}
164+
::-webkit-resizer {
165+
background: grey;
166+
}
167+
`};
141168
`
142169

143170
export default GlobalStyle

containers/ThemeWrapper/index.js

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,32 @@ import { ThemeProvider } from 'styled-components'
99
import Helmet from 'react-helmet'
1010

1111
import { connectStore } from '@utils'
12+
import { usePlatform } from '@hooks'
1213

1314
// import MarkDownStyle from './MarkDownStyle'
1415
import CodeSyxHighlight from './CodeSyxHighlight'
1516
import AntUIOverWrite from './AntUIOverWrite'
1617
import GlobalStyle from './GlobalStyle'
1718

18-
const ThemeContainer = ({ children, theme: { themeData } }) => (
19-
<ThemeProvider theme={themeData}>
20-
<React.Fragment>
21-
<Helmet meta={[{ name: 'theme-color', content: themeData.mobileTab }]} />
22-
<div>{children}</div>
23-
<CodeSyxHighlight />
24-
<AntUIOverWrite />
25-
<GlobalStyle />
26-
</React.Fragment>
27-
</ThemeProvider>
28-
)
19+
const ThemeContainer = ({ children, theme: { themeData } }) => {
20+
const { isMacOS } = usePlatform()
21+
22+
console.log('isMacOS: ', isMacOS)
23+
24+
return (
25+
<ThemeProvider theme={themeData}>
26+
<React.Fragment>
27+
<Helmet
28+
meta={[{ name: 'theme-color', content: themeData.mobileTab }]}
29+
/>
30+
<div>{children}</div>
31+
<CodeSyxHighlight />
32+
<AntUIOverWrite />
33+
<GlobalStyle isMacOS={isMacOS} />
34+
</React.Fragment>
35+
</ThemeProvider>
36+
)
37+
}
2938

3039
export default connectStore(ThemeContainer)
3140

containers/UserLister/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const UserListerContainer = ({ userLister }) => {
6464

6565
return (
6666
<Modal width="700px" show={show} showCloseBtn onClose={onClose}>
67-
<Wrapper>
67+
<Wrapper id="userlist-scroller">
6868
<HeaderInfo
6969
type={type}
7070
brief={brief}

containers/UserLister/logic.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ export const useInit = _store => {
167167
// log('effect init')
168168
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
169169

170+
/* eslint-disable no-undef */
171+
// OverlayScrollbars(document.getElementById('userlist-scroller'), {})
172+
170173
return () => {
171174
// log('effect uninit')
172175
sr71$.stop()

containers/UserLister/styles/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import styled from 'styled-components'
33
// import Img from '@components/Img'
44
import { cs } from '@utils'
55

6-
export const Wrapper = styled.div`
6+
export const Wrapper = styled.div.attrs(({ id }) => ({
7+
id,
8+
}))`
79
padding: 20px;
810
`
911
export const MsgWrapper = styled.div`

0 commit comments

Comments
 (0)