mirror of
https://github.com/BoostIo/Boostnote
synced 2026-05-21 06:51:56 +00:00
add Preferences modal(30%done) & move some modules (actions, reducer, socket, store -> lib/~)
This commit is contained in:
@@ -4,7 +4,7 @@ import { findWhere, uniq } from 'lodash'
|
||||
import ModeIcon from 'boost/components/ModeIcon'
|
||||
import MarkdownPreview from 'boost/components/MarkdownPreview'
|
||||
import CodeEditor from 'boost/components/CodeEditor'
|
||||
import { UNSYNCED, IDLE_MODE, CREATE_MODE, EDIT_MODE, switchMode, switchArticle, updateArticle, destroyArticle } from '../actions'
|
||||
import { UNSYNCED, IDLE_MODE, CREATE_MODE, EDIT_MODE, switchMode, switchArticle, updateArticle, destroyArticle } from 'boost/actions'
|
||||
import aceModes from 'boost/ace-modes'
|
||||
import Select from 'react-select'
|
||||
import linkState from 'boost/linkState'
|
||||
@@ -20,7 +20,7 @@ var modeOptions = aceModes.map(function (mode) {
|
||||
|
||||
function makeInstantArticle (article) {
|
||||
let instantArticle = Object.assign({}, article)
|
||||
instantArticle.Tags = (typeof instantArticle.Tags === 'array') ? instantArticle.Tags.map(tag => tag.name) : []
|
||||
instantArticle.Tags = Array.isArray(instantArticle.Tags) ? instantArticle.Tags.map(tag => tag.name) : []
|
||||
return instantArticle
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class ArticleDetail extends React.Component {
|
||||
<i className='fa fa-fw fa-check'/> Sure
|
||||
</button>
|
||||
<button onClick={e => this.handleDeleteCancleButtonClick(e)}>
|
||||
<i className='fa fa-fw fa-times'/> Cancle
|
||||
<i className='fa fa-fw fa-times'/> Cancel
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'
|
||||
import ProfileImage from 'boost/components/ProfileImage'
|
||||
import ModeIcon from 'boost/components/ModeIcon'
|
||||
import moment from 'moment'
|
||||
import { switchArticle, NEW } from '../actions'
|
||||
import { switchArticle, NEW } from 'boost/actions'
|
||||
import FolderMark from 'boost/components/FolderMark'
|
||||
|
||||
export default class ArticleList extends React.Component {
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import ProfileImage from 'boost/components/ProfileImage'
|
||||
import { findWhere } from 'lodash'
|
||||
import { switchMode, CREATE_MODE } from '../actions'
|
||||
import { switchMode, CREATE_MODE } from 'boost/actions'
|
||||
import { openModal } from 'boost/modal'
|
||||
import CreateNewFolder from 'boost/components/modal/CreateNewFolder'
|
||||
import FolderMark from 'boost/components/FolderMark'
|
||||
import Preferences from 'boost/components/modal/Preferences'
|
||||
import CreateNewFolder from 'boost/components/modal/CreateNewFolder'
|
||||
|
||||
export default class ArticleNavigator extends React.Component {
|
||||
componentDidMount () {
|
||||
this.handlePreferencesButtonClick()
|
||||
}
|
||||
|
||||
handlePreferencesButtonClick (e) {
|
||||
openModal(Preferences)
|
||||
}
|
||||
|
||||
handleNewPostButtonClick (e) {
|
||||
let { dispatch } = this.props
|
||||
|
||||
@@ -27,7 +36,7 @@ export default class ArticleNavigator extends React.Component {
|
||||
let folders = activeUser.Folders.map((folder, index) => {
|
||||
return (
|
||||
<button key={'folder-' + folder.id} className={activeFolder != null && activeFolder.id === folder.id ? 'active' : ''}>
|
||||
<FolderMark id={folder.id}/> {folder.name}</button>
|
||||
<FolderMark id={folder.id}/> {folder.name} {folder.public ? <i className='fa fa-fw fa-lock'/> : null}</button>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -47,7 +56,7 @@ export default class ArticleNavigator extends React.Component {
|
||||
<div className='userInfo'>
|
||||
<div className='userProfileName'>{activeUser.profileName}</div>
|
||||
<div className='userName'>{activeUser.name}</div>
|
||||
<button className='settingBtn'><i className='fa fa-fw fa-chevron-down'/></button>
|
||||
<button onClick={e => this.handlePreferencesButtonClick(e)} className='settingBtn'><i className='fa fa-fw fa-chevron-down'/></button>
|
||||
</div>
|
||||
|
||||
<div className='controlSection'>
|
||||
@@ -89,3 +98,4 @@ ArticleNavigator.propTypes = {
|
||||
}),
|
||||
dispatch: PropTypes.func
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user