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

Commit a609f1e

Browse files
committed
refactor(mail-panel): use custom-scrollbar
1 parent e3024f2 commit a609f1e

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/containers/MailBox/MailsPanel.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import React from 'react'
22
import R from 'ramda'
3+
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react'
34

45
// eslint-disable-next-line import/named
56
import { ICON_CMD } from '@config'
67
import TabSelector from '@components/TabSelector'
78

8-
import { Wrapper, SeeAllMessages } from './styles/mails_panel'
9+
import { Wrapper, ContentWrapper, SeeAllMessages } from './styles/mails_panel'
910
import MailLists from './MailLists'
1011

1112
import { selectChange, seeAll } from './logic'
@@ -48,7 +49,13 @@ const MailsPannel = ({ activeRaw, mailStatus, pagedMentions }) => {
4849
activeRaw={activeRaw}
4950
onChange={selectChange}
5051
/>
51-
<MailLists activeRaw={activeRaw} pagedMentions={pagedMentions} />
52+
<OverlayScrollbarsComponent
53+
options={{ scrollbars: { autoHide: 'scroll', autoHideDelay: 200 } }}
54+
>
55+
<ContentWrapper>
56+
<MailLists activeRaw={activeRaw} pagedMentions={pagedMentions} />
57+
</ContentWrapper>
58+
</OverlayScrollbarsComponent>
5259
<SeeAllMessages onClick={seeAll}>查看全部消息</SeeAllMessages>
5360
</Wrapper>
5461
)

src/containers/MailBox/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import React from 'react'
88

99
import { connectStore, buildLog } from '@utils'
1010
import Popover from '@components/Popover'
11+
1112
import MailsPanel from './MailsPanel'
1213

1314
import { Wrapper, NofityDot, HeaderMailIcon } from './styles'

src/containers/MailBox/styles/mails_panel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import { theme } from '@utils'
55
export const Wrapper = styled.div`
66
width: 370px;
77
min-height: 300px;
8-
height: auto;
8+
height: 400px;
99
padding: 10px;
1010
`
11+
export const ContentWrapper = styled.div`
12+
height: 300px;
13+
`
1114
export const SeeAllMessages = styled.div`
1215
color: ${theme('banner.title')};
1316
text-align: center;

src/containers/MailBox/styles/mention_list.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ export const Wrapper = styled.div`
99
`
1010
export const ListsWrapper = styled.div`
1111
width: 340px;
12-
min-height: 280px;
13-
max-height: 400px;
14-
overflow-y: scroll;
15-
overflow-x: hidden;
1612
`
1713
export const UserLabel = styled.div`
1814
${cs.flex('align-center')};

0 commit comments

Comments
 (0)