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

Commit b71db03

Browse files
committed
chore: Merge branch 'dev'
2 parents ca5383a + 8e4ce8b commit b71db03

File tree

19 files changed

+107
-36
lines changed

19 files changed

+107
-36
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: elixir
22
elixir:
3-
- 1.8
3+
- 1.9
44
otp_release:
55
- 21.0
66
addons:
7-
postgresql: '9.4'
7+
postgresql: '9.6'
88

99
before_install:
1010
- sudo chown -R travis ./travis/install_node.sh

components/Hooks/usePlatform.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const inialPlatform = {
99
isSafari: false,
1010
isIE: false,
1111
isEdge: false,
12+
isMacOS: false,
1213
}
1314

1415
// see https://stackoverflow.com/questions/49328382/browser-detection-in-reactjs/49328524
@@ -40,10 +41,18 @@ const usePlatform = (/* { breakpoint } */) => {
4041
const isChrome =
4142
!!Global.chrome && (!!Global.chrome.webstore || !!Global.chrome.runtime)
4243

44+
const isMacOS = Global.navigator.appVersion.indexOf('Mac') != -1
4345
/* eslint-enable */
4446

4547
setPlatform(
46-
R.merge(inialPlatform, { isFirefox, isSafari, isIE, isEdge, isChrome })
48+
R.merge(inialPlatform, {
49+
isFirefox,
50+
isSafari,
51+
isIE,
52+
isEdge,
53+
isChrome,
54+
isMacOS,
55+
})
4756
)
4857

4958
return () => {}

config/endpoint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const getGraphQLEndpoint = () => {
1313
return 'http://localhost:4001/graphiql'
1414

1515
default:
16-
// return 'https://api.coderplanets.com/graphiql'
17-
return 'http://localhost:4001/graphiql'
16+
return 'https://api.coderplanets.com/graphiql'
17+
/* return 'http://localhost:4001/graphiql' */
1818
}
1919
}
2020

containers/Doraemon/ResultsList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const HintIcon = ({ index, active, cur, length }) => {
3030
}
3131

3232
const ResultsList = ({ searchValue, searchThread, suggestions, activeRaw }) => (
33-
<Wrapper>
33+
<Wrapper id="suggestion-scroller">
3434
<SuggestionWrapper empty={suggestions.length === 0}>
3535
{suggestions.map((suggestion, i) => (
3636
<InfoBar

containers/Doraemon/logic/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ export const useInit = _store => {
500500
pockect$ = new Pocket(store)
501501
SAK = new SwissArmyKnife(store)
502502

503+
/* eslint-disable no-undef */
504+
OverlayScrollbars(document.getElementById('suggestion-scroller'), {})
505+
503506
initSpecCmdResolver()
504507

505508
pockect$.search().subscribe(res => {
@@ -537,6 +540,8 @@ export const useInit = _store => {
537540
}, [_store])
538541
}
539542

543+
/*
544+
540545
export const init2 = _store => {
541546
if (store) return false
542547
@@ -577,3 +582,4 @@ export const init2 = _store => {
577582
if (sub$) sub$.unsubscribe()
578583
sub$ = sr71$.data().subscribe($solver(DataSolver, ErrSolver))
579584
}
585+
*/

containers/Doraemon/styles/results_list.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import styled from 'styled-components'
33
import Img from '@components/Img'
44
import { theme, animate, cs } from '@utils'
55

6+
export const Wrapper = styled.div.attrs(({ id }) => ({
7+
id,
8+
}))`
9+
width: 100%;
10+
overflow: hidden;
11+
max-height: 400px;
12+
`
613
export const LoadingIcon = styled(Img)`
714
fill: ${theme('shell.searchIcon')};
815
width: 30px;
@@ -40,18 +47,14 @@ export const PanelContainer = styled.div`
4047
left: 50%;
4148
margin-left: -19vw;
4249
`
43-
export const Wrapper = styled.div`
44-
width: 100%;
45-
overflow: hidden;
46-
`
4750
export const SuggestionWrapper = styled.div`
4851
position: relative;
4952
display: ${({ empty }) => (empty ? 'none' : 'flex')};
5053
flex-direction: column;
51-
max-height: 60vh;
54+
// max-height: 400px;
5255
overflow-y: scroll;
5356
overflow-x: hidden;
54-
width: 102%;
57+
width: 100%;
5558
`
5659
// #001b21;
5760
export const BaseBar = styled.div`
@@ -115,7 +118,7 @@ export const Title = styled.div`
115118
116119
${cs.truncate('400px')};
117120
${cs.media.mobile`
118-
${cs.truncate('200px')};
121+
${cs.truncate('200px')};
119122
`};
120123
`
121124
export const Desc = styled.div`

containers/GlobalLayout/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import React from 'react'
88
import T from 'prop-types'
99
import useNetwork from 'react-use/lib/useNetwork'
1010

11+
import 'overlayscrollbars/js/OverlayScrollbars'
12+
import 'overlayscrollbars/css/OverlayScrollbars.css'
13+
1114
import { ICON_CMD } from '@config'
1215
import { connectStore } from '@utils'
13-
1416
import { useShortcut, useMedia, usePlatform } from '@hooks'
1517

1618
import { Wrapper, SubCommunitiesExpander, ExpanderIcon } from './styles'

containers/GlobalLayout/logic.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ export const useInit = (_store, extra) => {
2222
useEffect(() => {
2323
store = _store
2424

25+
// FIXME: do not show body scrollbar on mac
26+
// plus this plugin will break antd's affix staff
27+
/* eslint-disable no-undef */
28+
// OverlayScrollbars(document.querySelectorAll('body'), {
29+
// NOT WORK!
30+
// scrollbars: { autoHide: 'scroll', autoHideDelay: 500 },
31+
// })
32+
2533
const { online, media, platform } = extra
2634
store.markState({ online, media, platform })
2735
}, [_store, extra])

containers/Preview/Viewer.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ import {
1919
DynamicStateTree,
2020
} from './DynamicComps'
2121

22+
import { Wrapper } from './styles/viewer'
2223
import DefaultViewer from './DefaultViewer'
2324
import { closePreview } from './logic'
2425

25-
const Viewer = ({ type, root, attachment, attUser }) => {
26+
const renderViewer = (type, root, attachment, attUser) => {
2627
switch (type) {
2728
case TYPE.PREVIEW_ACCOUNT_VIEW:
2829
return <DynamicAccountViewer />
@@ -83,4 +84,10 @@ const Viewer = ({ type, root, attachment, attUser }) => {
8384
}
8485
}
8586

87+
const Viewer = ({ type, root, attachment, attUser }) => (
88+
<Wrapper id="preview-viewer-scroller">
89+
{renderViewer(type, root, attachment, attUser)}
90+
</Wrapper>
91+
)
92+
8693
export default Viewer

containers/Preview/logic.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ export const useInit = _store => {
8989

9090
sub$ = sr71$.data().subscribe($solver(DataResolver, []))
9191

92+
/* eslint-disable no-undef */
93+
OverlayScrollbars(document.getElementById('preview-viewer-scroller'), {})
94+
9295
return () => {
9396
if (!sub$) return false
9497
sr71$.stop()

0 commit comments

Comments
 (0)