1
0
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:
Paul Rosset
2017-10-27 12:38:26 +01:00
parent 8910c26ee2
commit b9038e254e
4 changed files with 25 additions and 2 deletions

View File

@@ -115,7 +115,6 @@
line-height 1.2
.note-for-keymap
margin-left: 10px
font-size: 12px
.code-mirror

View File

@@ -4,6 +4,7 @@ import styles from './InfoTab.styl'
import ConfigManager from 'browser/main/lib/ConfigManager'
import store from 'browser/main/store'
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
import _ from 'lodash'
const electron = require('electron')
const { shell, remote } = electron
@@ -36,8 +37,21 @@ class InfoTab extends React.Component {
if (!newConfig.amaEnabled) {
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)
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 () {
return (
<div styleName='root'>
@@ -107,6 +126,7 @@ class InfoTab extends React.Component {
/>
Enable to send analytics to our servers<br />
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>Save</button>
{this.infoMessage()}
</div>
)
}

View File

@@ -50,6 +50,10 @@
.policy-submit
margin-top 10px
.policy-confirm
margin-top 10px
font-size 12px
body[data-theme="dark"]
.root
color alpha($tab--dark-text-color, 80%)

View File

@@ -228,7 +228,7 @@ class UiTab extends React.Component {
<option value='vim'>vim</option>
<option value='emacs'>emacs</option>
</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>