Skip to content

Commit 570d8b3

Browse files
author
Yang Zhen
committed
Add vimium check
1 parent ea68922 commit 570d8b3

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

app/components/Notification/index.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ const barStyleFactory = (index, style) => {
99
left: 'initial',
1010
right: '-100%',
1111
bottom: 'initial',
12-
top: `${2 + index * 4}rem`
12+
top: `${2 + index * 4}rem`,
13+
fontSize: '12px',
14+
padding: '8px',
1315
})
1416
}
1517

@@ -18,7 +20,9 @@ const activeBarStyleFactory = (index, style) => {
1820
left: 'initial',
1921
right: '1rem',
2022
bottom: 'initial',
21-
top: `${2 + index * 4}rem`
23+
top: `${2 + index * 4}rem`,
24+
fontSize: '12px',
25+
padding: '8px',
2226
})
2327
}
2428

app/containers/IDE.jsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { connect } from 'react-redux'
33
import { initializeFileTree } from '../components/FileTree/actions'
44
import PanelsContainer from '../components/Panel'
55
import Utilities from './Utilities'
6-
6+
import hasVimium from 'utils/hasVimium'
7+
import { notify, NOTIFY_TYPE } from '../components/Notification/actions'
8+
import i18n from 'utils/createI18n'
79

810
class IDE extends Component {
911
constructor (props) {
@@ -16,6 +18,16 @@ class IDE extends Component {
1618
this.setState({ isReady: true })
1719
}
1820

21+
componentDidMount () {
22+
if (hasVimium()) {
23+
notify({
24+
notifyType: NOTIFY_TYPE.ERROR,
25+
message: i18n`global.hasVimium`,
26+
dismissAfter: 12000
27+
})
28+
}
29+
}
30+
1931
render () {
2032
if (!this.state.isReady) return null
2133
return (

app/i18n/en_US/global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"connecting": "Connecting",
1414
"loadingWorkspace": "Loading workspace...",
1515
"reloadWorkspace": "Retry",
16-
"requestCollaborationExpires": "The demo has already expired."
16+
"requestCollaborationExpires": "The demo has already expired.",
17+
"hasVimium": "Please disable Vimium plugin."
1718
}

app/i18n/zh_CN/global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"connecting": "连接",
1414
"loadingWorkspace": "正在加载工作区",
1515
"reloadWorkspace": "重新加载",
16-
"requestCollaborationExpires": "试用已经结束"
16+
"requestCollaborationExpires": "试用已经结束",
17+
"hasVimium": "请禁用 Vimium 插件以避免按键冲突"
1718
}

0 commit comments

Comments
 (0)