1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-21 05:31:45 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -12,7 +12,7 @@ const { shell, remote } = electron
const appVersion = remote.app.getVersion()
class InfoTab extends React.Component {
constructor (props) {
constructor(props) {
super(props)
this.state = {
@@ -20,18 +20,18 @@ class InfoTab extends React.Component {
}
}
handleLinkClick (e) {
handleLinkClick(e) {
shell.openExternal(e.currentTarget.href)
e.preventDefault()
}
handleConfigChange (e) {
handleConfigChange(e) {
const newConfig = { amaEnabled: this.refs.amaEnabled.checked }
this.setState({ config: newConfig })
}
handleSaveButtonClick (e) {
handleSaveButtonClick(e) {
const newConfig = {
amaEnabled: this.state.config.amaEnabled
}
@@ -43,7 +43,7 @@ class InfoTab extends React.Component {
})
} else {
this.setState({
amaMessage: i18n.__('Thank\'s for trusting us')
amaMessage: i18n.__("Thank's for trusting us")
})
}
@@ -61,7 +61,7 @@ class InfoTab extends React.Component {
})
}
toggleAutoUpdate () {
toggleAutoUpdate() {
const newConfig = {
autoUpdateEnabled: !this.state.config.autoUpdateEnabled
}
@@ -70,46 +70,64 @@ class InfoTab extends React.Component {
ConfigManager.set(newConfig)
}
infoMessage () {
infoMessage() {
const { amaMessage } = this.state
return amaMessage ? <p styleName='policy-confirm'>{amaMessage}</p> : null
}
render () {
render() {
return (
<div styleName='root'>
<div styleName='group-header'>{i18n.__('Community')}</div>
<div styleName='top'>
<ul styleName='list'>
<li>
<a href='https://issuehunt.io/repos/53266139'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Bounty on IssueHunt')}</a>
<a
href='https://issuehunt.io/repos/53266139'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Bounty on IssueHunt')}
</a>
</li>
<li>
<a href='https://boostnote.io/#subscribe'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Subscribe to Newsletter')}</a>
<a
href='https://boostnote.io/#subscribe'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Subscribe to Newsletter')}
</a>
</li>
<li>
<a href='https://github.com/BoostIO/Boostnote/issues'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('GitHub')}</a>
<a
href='https://github.com/BoostIO/Boostnote/issues'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('GitHub')}
</a>
</li>
<li>
<a href='https://medium.com/boostnote'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Blog')}</a>
<a
href='https://medium.com/boostnote'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Blog')}
</a>
</li>
<li>
<a href='https://www.facebook.com/groups/boostnote'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Facebook Group')}</a>
<a
href='https://www.facebook.com/groups/boostnote'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Facebook Group')}
</a>
</li>
<li>
<a href='https://twitter.com/boostnoteapp'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Twitter')}</a>
<a
href='https://twitter.com/boostnoteapp'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Twitter')}
</a>
</li>
</ul>
</div>
@@ -120,11 +138,20 @@ class InfoTab extends React.Component {
<div styleName='top'>
<div styleName='icon-space'>
<img styleName='icon' src='../resources/app.png' width='92' height='92' />
<img
styleName='icon'
src='../resources/app.png'
width='92'
height='92'
/>
<div styleName='icon-right'>
<div styleName='appId'>{i18n.__('Boostnote')} {appVersion}</div>
<div styleName='appId'>
{i18n.__('Boostnote')} {appVersion}
</div>
<div styleName='description'>
{i18n.__('An open source note-taking app made for programmers just like you.')}
{i18n.__(
'An open source note-taking app made for programmers just like you.'
)}
</div>
</div>
</div>
@@ -132,39 +159,71 @@ class InfoTab extends React.Component {
<ul styleName='list'>
<li>
<a href='https://boostnote.io'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Website')}</a>
<a
href='https://boostnote.io'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Website')}
</a>
</li>
<li>
<a href='https://github.com/BoostIO/Boostnote/blob/master/docs/build.md'
onClick={(e) => this.handleLinkClick(e)}
>{i18n.__('Development')}</a>{i18n.__(' : Development configurations for Boostnote.')}
</li>
<li styleName='cc'>
{i18n.__('Copyright (C) 2017 - 2020 BoostIO')}
</li>
<li styleName='cc'>
{i18n.__('License: GPL v3')}
<a
href='https://github.com/BoostIO/Boostnote/blob/master/docs/build.md'
onClick={e => this.handleLinkClick(e)}
>
{i18n.__('Development')}
</a>
{i18n.__(' : Development configurations for Boostnote.')}
</li>
<li styleName='cc'>{i18n.__('Copyright (C) 2017 - 2020 BoostIO')}</li>
<li styleName='cc'>{i18n.__('License: GPL v3')}</li>
</ul>
<div><label><input type='checkbox' onChange={this.toggleAutoUpdate.bind(this)} checked={this.state.config.autoUpdateEnabled} />{i18n.__('Enable Auto Update')}</label></div>
<div>
<label>
<input
type='checkbox'
onChange={this.toggleAutoUpdate.bind(this)}
checked={this.state.config.autoUpdateEnabled}
/>
{i18n.__('Enable Auto Update')}
</label>
</div>
<hr styleName='separate-line' />
<div styleName='group-header2--sub'>{i18n.__('Analytics')}</div>
<div>{i18n.__('Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.')}</div>
<div>{i18n.__('You can see how it works on ')}<a href='https://github.com/BoostIO/Boostnote' onClick={(e) => this.handleLinkClick(e)}>GitHub</a>.</div>
<div>
{i18n.__(
'Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.'
)}
</div>
<div>
{i18n.__('You can see how it works on ')}
<a
href='https://github.com/BoostIO/Boostnote'
onClick={e => this.handleLinkClick(e)}
>
GitHub
</a>
.
</div>
<br />
<div>{i18n.__('You can choose to enable or disable this option.')}</div>
<input onChange={(e) => this.handleConfigChange(e)}
<input
onChange={e => this.handleConfigChange(e)}
checked={this.state.config.amaEnabled}
ref='amaEnabled'
type='checkbox'
/>
{i18n.__('Enable analytics to help improve Boostnote')}<br />
<button styleName='policy-submit' onClick={(e) => this.handleSaveButtonClick(e)}>{i18n.__('Save')}</button>
{i18n.__('Enable analytics to help improve Boostnote')}
<br />
<button
styleName='policy-submit'
onClick={e => this.handleSaveButtonClick(e)}
>
{i18n.__('Save')}
</button>
<br />
{this.infoMessage()}
</div>
@@ -172,7 +231,6 @@ class InfoTab extends React.Component {
}
}
InfoTab.propTypes = {
}
InfoTab.propTypes = {}
export default CSSModules(InfoTab, styles)