mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
Adjust Note in Uitab && Add message notification for policy save
This commit is contained in:
@@ -115,7 +115,6 @@
|
|||||||
line-height 1.2
|
line-height 1.2
|
||||||
|
|
||||||
.note-for-keymap
|
.note-for-keymap
|
||||||
margin-left: 10px
|
|
||||||
font-size: 12px
|
font-size: 12px
|
||||||
|
|
||||||
.code-mirror
|
.code-mirror
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import styles from './InfoTab.styl'
|
|||||||
import ConfigManager from 'browser/main/lib/ConfigManager'
|
import ConfigManager from 'browser/main/lib/ConfigManager'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
|
||||||
|
import _ from 'lodash'
|
||||||
|
|
||||||
const electron = require('electron')
|
const electron = require('electron')
|
||||||
const { shell, remote } = electron
|
const { shell, remote } = electron
|
||||||
@@ -36,8 +37,21 @@ class InfoTab extends React.Component {
|
|||||||
|
|
||||||
if (!newConfig.amaEnabled) {
|
if (!newConfig.amaEnabled) {
|
||||||
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('DISABLE_AMA')
|
||||||
|
this.setState({
|
||||||
|
amaMessage: 'We hope we will gain your trust'
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.setState({
|
||||||
|
amaMessage: 'Thank\'s for trust us'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_.debounce(() => {
|
||||||
|
this.setState({
|
||||||
|
amaMessage: ''
|
||||||
|
})
|
||||||
|
}, 3000)()
|
||||||
|
|
||||||
ConfigManager.set(newConfig)
|
ConfigManager.set(newConfig)
|
||||||
|
|
||||||
store.dispatch({
|
store.dispatch({
|
||||||
@@ -46,6 +60,11 @@ class InfoTab extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
infoMessage () {
|
||||||
|
const { amaMessage } = this.state
|
||||||
|
return amaMessage ? <p styleName='policy-confirm'>{amaMessage}</p> : null
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div styleName='root'>
|
<div styleName='root'>
|
||||||
@@ -107,6 +126,7 @@ class InfoTab extends React.Component {
|
|||||||
/>
|
/>
|
||||||
Enable to send analytics to our servers<br />
|
Enable to send analytics to our servers<br />
|
||||||
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
|
||||||
|
{this.infoMessage()}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,6 +50,10 @@
|
|||||||
.policy-submit
|
.policy-submit
|
||||||
margin-top 10px
|
margin-top 10px
|
||||||
|
|
||||||
|
.policy-confirm
|
||||||
|
margin-top 10px
|
||||||
|
font-size 12px
|
||||||
|
|
||||||
body[data-theme="dark"]
|
body[data-theme="dark"]
|
||||||
.root
|
.root
|
||||||
color alpha($tab--dark-text-color, 80%)
|
color alpha($tab--dark-text-color, 80%)
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ class UiTab extends React.Component {
|
|||||||
<option value='vim'>vim</option>
|
<option value='vim'>vim</option>
|
||||||
<option value='emacs'>emacs</option>
|
<option value='emacs'>emacs</option>
|
||||||
</select>
|
</select>
|
||||||
<span styleName='note-for-keymap'>Please restart boostnote after you change the keymap</span>
|
<p styleName='note-for-keymap'>⚠️ Please restart boostnote after you change the keymap</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user