diff --git a/browser/finder/index.js b/browser/finder/index.js
index ffe6bb4e..0f6e3735 100644
--- a/browser/finder/index.js
+++ b/browser/finder/index.js
@@ -9,6 +9,7 @@ import styles from './FinderMain.styl'
import StorageSection from './StorageSection'
import NoteList from './NoteList'
import NoteDetail from './NoteDetail'
+import SideNavFilter from 'browser/components/SideNavFilter'
require('!!style!css!stylus?sourceMap!../main/global.styl')
require('../lib/customMeta')
@@ -307,18 +308,12 @@ class FinderMain extends React.Component {
/> Only Markdown
- this.handleAllNotesButtonClick(e)}
+ isStarredActive={filter.type === 'STARRED'}
+ handleStarredButtonClick={(e) => this.handleStarredButtonClick(e)}
+ />
{storageList}
diff --git a/browser/lib/date-formatter.js b/browser/lib/date-formatter.js
new file mode 100644
index 00000000..c30f9826
--- /dev/null
+++ b/browser/lib/date-formatter.js
@@ -0,0 +1,18 @@
+/**
+ * @fileoverview Formatting date string.
+ */
+import moment from 'moment';
+
+/**
+ * @description Return date string. For example, 'Sep.9, 2016 12:00'.
+ * @param {mixed}
+ * @return {string}
+ */
+export function getLastUpdated(date) {
+ const m = moment(date)
+ if (!m.isValid()) {
+ throw Error('Invalid argument.');
+ }
+
+ return m.format('MMM D, gggg H:mm')
+}
diff --git a/browser/main/Detail/DetailVars.styl b/browser/main/Detail/DetailVars.styl
new file mode 100644
index 00000000..ad492c54
--- /dev/null
+++ b/browser/main/Detail/DetailVars.styl
@@ -0,0 +1,9 @@
+/**
+ * Varibales for note detail space.
+ */
+
+// Margin on the left side and the right side for NoteDetail component.
+$note-detail-left-margin = 25px
+$note-detail-right-margin = 25px
+
+$note-detail-box-shadow = 2px 0 15px -8px #b1b1b1 inset
diff --git a/browser/main/Detail/LastUpdatedString.js b/browser/main/Detail/LastUpdatedString.js
new file mode 100644
index 00000000..764709ef
--- /dev/null
+++ b/browser/main/Detail/LastUpdatedString.js
@@ -0,0 +1,27 @@
+/**
+ * @fileoverview Component for show updated date of the detail.
+ */
+import React, { PropTypes } from 'react'
+import { getLastUpdated } from 'browser/lib/date-formatter'
+import CSSModules from 'browser/lib/CSSModules'
+import styles from './LastUpdatedString.styl'
+
+const LastUpdatedString = ({ date }) => {
+ let text = ''
+
+ try {
+ text = `Last updated at ${getLastUpdated(date)}`
+ } catch (e) {
+ text = ''
+ }
+
+ return (
+ {text}
+ )
+}
+
+LastUpdatedString.propTypes = {
+ date: PropTypes.string,
+}
+
+export default CSSModules(LastUpdatedString, styles)
diff --git a/browser/main/Detail/LastUpdatedString.styl b/browser/main/Detail/LastUpdatedString.styl
new file mode 100644
index 00000000..a6c94c62
--- /dev/null
+++ b/browser/main/Detail/LastUpdatedString.styl
@@ -0,0 +1,8 @@
+.info-right-date
+ display inline
+ font-size 11px
+ color $ui-button-color
+
+body[data-theme="dark"]
+ .info-right-date
+ color $ui-dark-button-color
diff --git a/browser/main/Detail/MarkdownNoteDetail.js b/browser/main/Detail/MarkdownNoteDetail.js
index 04d7770d..7b0a2411 100644
--- a/browser/main/Detail/MarkdownNoteDetail.js
+++ b/browser/main/Detail/MarkdownNoteDetail.js
@@ -4,7 +4,7 @@ import styles from './MarkdownNoteDetail.styl'
import MarkdownEditor from 'browser/components/MarkdownEditor'
import StarButton from './StarButton'
import TagSelect from './TagSelect'
-import FolderSelect from './FolderSelect'
+import LastUpdatedString from './LastUpdatedString'
import dataApi from 'browser/main/lib/dataApi'
import { hashHistory } from 'react-router'
import ee from 'browser/main/lib/eventEmitter'
@@ -166,20 +166,6 @@ class MarkdownNoteDetail extends React.Component {
}
- handleShareButtonClick (e) {
- let menu = new Menu()
- menu.append(new MenuItem({
- label: 'Export as a File',
- click: (e) => this.handlePreferencesButtonClick(e)
- }))
- menu.append(new MenuItem({
- label: 'Export to Web',
- disabled: true,
- click: (e) => this.handlePreferencesButtonClick(e)
- }))
- menu.popup(remote.getCurrentWindow())
- }
-
handleContextButtonClick (e) {
let menu = new Menu()
menu.append(new MenuItem({
@@ -229,44 +215,22 @@ class MarkdownNoteDetail extends React.Component {
>
-
- this.handleFolderChange(e)}
- />
-
-
- this.handleChange(e)}
- />
-
-
-
- this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
-
+ this.handleChange(e)}
+ />
+
+
+
diff --git a/browser/main/Detail/MarkdownNoteDetail.styl b/browser/main/Detail/MarkdownNoteDetail.styl
index 0e801787..e23296a4 100644
--- a/browser/main/Detail/MarkdownNoteDetail.styl
+++ b/browser/main/Detail/MarkdownNoteDetail.styl
@@ -1,68 +1,19 @@
-$info-height = 75px
+@import('NoteDetailInfo')
+@import('DetailVars')
.root
absolute top right bottom
border-width 0 0 1px
border-style solid
border-color $ui-borderColor
-
-.info
- absolute top left right
- height $info-height
- border-bottom $ui-border
- background-color $ui-backgroundColor
-
-.info-left
- float left
- padding 0 5px
-
-.info-left-top
- height 40px
- line-height 40px
-
-.info-left-top-folderSelect
- display inline-block
- height 34px
- width 200px
- vertical-align middle
-
-.info-left-bottom
- height 30px
-
-.info-left-bottom-tagSelect
- height 30px
- line-height 30px
-
-.info-right
- float right
-
-.info-right-button
- width 34px
- height 34px
- border-radius 17px
- navButtonColor()
- border $ui-border
- font-size 14px
- margin 8px 2px
- padding 0
- &:active
- border-color $ui-button--focus-borderColor
- &:hover .info-right-button-tooltip
- opacity 1
- &:focus
- border-color $ui-button--focus-borderColor
-
-.info-right-button-tooltip
- tooltip()
- position fixed
- top 45px
- padding 5px
- opacity 0
- border-radius 2px
+ background-color $ui-noteDetail-backgroundColor
+ box-shadow $note-detail-box-shadow
.body
absolute left right
- top $info-height
+ left $note-detail-left-margin
+ right $note-detail-right-margin
+ top $info-height + $info-margin-under-border
bottom $statusBar-height
.body-noteEditor
@@ -71,32 +22,5 @@ $info-height = 75px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
-
- .info
- border-color $ui-dark-borderColor
- background-color $ui-dark-backgroundColor
-
- .info-delete
- color $ui-dark-text-color
-
- .info-delete-confirmButton
- colorDarkDangerButton()
- color $ui-dark-text-color
-
- .info-delete-cancelButton
- colorDarkDefaultButton()
- border-color $ui-dark-borderColor
- color $ui-dark-text-color
-
- .info-right-button
- navDarkButtonColor()
- border-color $ui-dark-borderColor
- &:active
- border-color $ui-dark-button--focus-borderColor
- &:hover .info-right-button-tooltip
- opacity 1
- &:focus
- border-color $ui-button--focus-borderColor
-
- .info-right-button-tooltip
- darkTooltip()
+ background-color $ui-dark-noteDetail-backgroundColor
+ box-shadow none
diff --git a/browser/main/Detail/NoteDetailInfo.styl b/browser/main/Detail/NoteDetailInfo.styl
new file mode 100644
index 00000000..4d27093c
--- /dev/null
+++ b/browser/main/Detail/NoteDetailInfo.styl
@@ -0,0 +1,85 @@
+@import('DetailVars')
+
+$info-height = 60px
+$info-margin-under-border = 27px
+
+.info
+ absolute top left right
+ left $note-detail-left-margin
+ right $note-detail-right-margin
+ height $info-height
+ border-bottom $ui-border
+ background-color $ui-noteDetail-backgroundColor
+
+.info-left
+ float left
+ padding 0 5px
+ margin 0px 2px
+
+.info-left-button
+ width 34px
+ height 34px
+ navButtonColor()
+ color $ui-favorite-star-button-color
+ font-size 14px
+ margin 13px 2px
+ padding 0
+ border-radius 17px
+ &:hover .info-right-button-tooltip
+ opacity 1
+ &:focus
+ border-color $ui-favorite-star-button-color
+ &:active, &:active:hover
+ background-color $ui-favorite-star-button-color
+ color $ui-button--active-color
+
+.info-right
+ position absolute
+ right 0
+ top 0
+ background $ui-noteDetail-backgroundColor
+ bottom 1px
+ padding-left 30px
+
+.info-right-button
+ width 34px
+ height 34px
+ border-radius 17px
+ font-size 14px
+ margin 13px 7px
+ padding 0
+ border none
+ color $ui-button-color
+ background-color transparent
+ &:hover
+ opacity 1
+ background-color $ui-button--hover-backgroundColor
+
+
+body[data-theme="dark"]
+ .info
+ border-color $ui-dark-borderColor
+ background-color $ui-dark-noteDetail-backgroundColor
+
+ .info-delete
+ color $ui-dark-text-color
+
+ .info-delete-confirmButton
+ colorDarkDangerButton()
+ color $ui-dark-text-color
+
+ .info-delete-cancelButton
+ colorDarkDefaultButton()
+ border-color $ui-dark-borderColor
+ color $ui-dark-text-color
+
+ .info-right
+ background-color $ui-dark-noteDetail-backgroundColor
+
+ .info-right-button
+ navDarkButtonColor()
+ border-color $ui-dark-borderColor
+ &:active
+ border-color $ui-dark-button--focus-borderColor
+ &:focus
+ border-color $ui-button--focus-borderColor
diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js
index 9ad8e2e7..fdc76262 100644
--- a/browser/main/Detail/SnippetNoteDetail.js
+++ b/browser/main/Detail/SnippetNoteDetail.js
@@ -5,12 +5,12 @@ import CodeEditor from 'browser/components/CodeEditor'
import MarkdownEditor from 'browser/components/MarkdownEditor'
import StarButton from './StarButton'
import TagSelect from './TagSelect'
-import FolderSelect from './FolderSelect'
+import LastUpdatedString from './LastUpdatedString'
import dataApi from 'browser/main/lib/dataApi'
import { hashHistory } from 'react-router'
import ee from 'browser/main/lib/eventEmitter'
import CodeMirror from 'codemirror'
-import SnippetTab from './SnippetTab'
+import SnippetTab from 'browser/components/SnippetTab'
import StatusBar from '../StatusBar'
import context from 'browser/lib/context'
import ConfigManager from 'browser/main/lib/ConfigManager'
@@ -188,21 +188,6 @@ class SnippetNoteDetail extends React.Component {
}
- handleShareButtonClick (e) {
- let menu = new Menu()
- menu.append(new MenuItem({
- label: 'Export as a File',
- disabled: true,
- click: (e) => this.handlePreferencesButtonClick(e)
- }))
- menu.append(new MenuItem({
- label: 'Export to Web',
- disabled: true,
- click: (e) => this.handlePreferencesButtonClick(e)
- }))
- menu.popup(remote.getCurrentWindow())
- }
-
handleContextButtonClick (e) {
context.popup([{
label: 'Delete',
@@ -538,44 +523,22 @@ class SnippetNoteDetail extends React.Component {
>
-
- this.handleFolderChange(e)}
- />
-
-
- this.handleChange(e)}
- />
-
-
-
- this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
-
+ this.handleChange(e)}
+ />
+
+
+
diff --git a/browser/main/Detail/SnippetNoteDetail.styl b/browser/main/Detail/SnippetNoteDetail.styl
index 3ecec069..9356f6b2 100644
--- a/browser/main/Detail/SnippetNoteDetail.styl
+++ b/browser/main/Detail/SnippetNoteDetail.styl
@@ -1,72 +1,25 @@
-$info-height = 75px
+@import('NoteDetailInfo')
+@import('DetailVars')
.root
absolute top bottom right
border-width 0 0 1px
border-style solid
border-color $ui-borderColor
-
-.info
- absolute top left right
- height $info-height
- border-bottom $ui-border
- background-color $ui-backgroundColor
-
-.info-left
- float left
- padding 0 5px
-
-.info-left-top
- height 40px
- line-height 40px
-
-.info-left-top-folderSelect
- display inline-block
- height 34px
- width 200px
- vertical-align middle
-
-.info-left-bottom
- height 30px
-
-.info-left-bottom-tagSelect
- height 30px
- line-height 30px
-
-.info-right
- float right
-
-.info-right-button
- width 34px
- height 34px
- border-radius 17px
- navButtonColor()
- border $ui-border
- font-size 14px
- margin 8px 2px
- padding 0
- &:active
- border-color $ui-button--focus-borderColor
- &:hover .info-right-button-tooltip
- opacity 1
- &:focus
- border-color $ui-button--focus-borderColor
-.info-right-button-tooltip
- tooltip()
- position fixed
- top 45px
- padding 5px
- opacity 0
+ background-color $ui-noteDetail-backgroundColor
+ box-shadow $note-detail-box-shadow
.body
absolute left right
- top $info-height
+ left $note-detail-left-margin
+ right $note-detail-right-margin
+ top $info-height + $info-margin-under-border
bottom $statusBar-height
+ background-color $ui-noteDetail-backgroundColor
.body .description
absolute top left right
height 80px
- border-bottom $ui-border
.body .description textarea
display block
@@ -76,20 +29,19 @@ $info-height = 75px
border none
padding 10px
line-height 1.6
+ background-color $ui-noteDetail-backgroundColor
.tabList
absolute left right
top 80px
height 30px
- border-bottom $ui-border
display flex
- background-color $ui-backgroundColor
+ background-color $ui-noteDetail-backgroundColor
.tabList .list
flex 1
display flex
overflow hidden
- border-right $ui-border
.tabList .plusButton
navButtonColor()
@@ -97,7 +49,7 @@ $info-height = 75px
.tabView
absolute left right bottom
- top 110px
+ top 130px
.tabView-content
absolute top left right bottom
@@ -118,47 +70,19 @@ $info-height = 75px
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
+ background-color $ui-dark-noteDetail-backgroundColor
+ box-shadow none
- .info
- border-bottom-color $ui-dark-borderColor
- background-color $ui-dark-backgroundColor
-
- .info-delete
- color $ui-dark-text-color
-
- .info-delete-confirmButton
- colorDarkDangerButton()
- color $ui-dark-text-color
-
- .info-delete-cancelButton
- colorDarkDefaultButton()
- border-color $ui-dark-borderColor
- color $ui-dark-text-color
-
- .info-right-button
- navDarkButtonColor()
- border-color $ui-dark-borderColor
- &:active
- border-color $ui-dark-button--focus-borderColor
- &:hover .info-right-button-tooltip
- opacity 1
- &:focus
- border-color $ui-button--focus-borderColor
-
- .info-right-button-tooltip
- darkTooltip()
-
- .body .description
- border-bottom-color $ui-dark-borderColor
+ .body
+ background-color $ui-dark-noteDetail-backgroundColor
.body .description textarea
- background-color $ui-dark-button--hover-backgroundColor
+ background-color $ui-dark-noteDetail-backgroundColor
color white
.tabList
background-color $ui-button--active-backgroundColor
- border-bottom-color $ui-dark-borderColor
- background-color $ui-dark-backgroundColor
+ background-color $ui-dark-noteDetail-backgroundColor
.tabList .list
border-color $ui-dark-borderColor
diff --git a/browser/main/Detail/StarButton.js b/browser/main/Detail/StarButton.js
index 055a4fff..8610c950 100644
--- a/browser/main/Detail/StarButton.js
+++ b/browser/main/Detail/StarButton.js
@@ -53,7 +53,6 @@ class StarButton extends React.Component {
: 'fa fa-star-o'
}
/>
- Star Note
)
}
diff --git a/browser/main/Detail/StarButton.styl b/browser/main/Detail/StarButton.styl
index 89b199dc..4362ab6b 100644
--- a/browser/main/Detail/StarButton.styl
+++ b/browser/main/Detail/StarButton.styl
@@ -1,5 +1,7 @@
.root
- position relative
+ position absolute
+ left 7px
+ top 0
padding 0
&:hover
.icon
@@ -9,19 +11,11 @@
.root--active
@extend .root
- color $brand-color
+ color $ui-favorite-star-button-color
&:hover
- color $brand-color !important
+ color $ui-favorite-star-button-color
.icon
transform rotate(-72deg)
+
.icon
transition transform 0.15s
-
-.tooltip
- tooltip()
- position fixed
- top 45px
- right 65px
- padding 5px
- opacity 0
- border-radius 2px
diff --git a/browser/main/Detail/TagSelect.js b/browser/main/Detail/TagSelect.js
index 14316dae..ff264763 100644
--- a/browser/main/Detail/TagSelect.js
+++ b/browser/main/Detail/TagSelect.js
@@ -8,7 +8,7 @@ class TagSelect extends React.Component {
super(props)
this.state = {
- newTag: ''
+ newTag: '',
}
}
@@ -107,12 +107,12 @@ class TagSelect extends React.Component {
+ {tag}
- {tag}
)
})
@@ -125,10 +125,7 @@ class TagSelect extends React.Component {
}
styleName='root'
>
-
- {tagList}
+ {tagList}
this.handleNewTagInputChange(e)}
onKeyDown={(e) => this.handleNewTagInputKeyDown(e)}
/>
-
)
}
diff --git a/browser/main/Detail/TagSelect.styl b/browser/main/Detail/TagSelect.styl
index ba7e309c..54a7e70c 100644
--- a/browser/main/Detail/TagSelect.styl
+++ b/browser/main/Detail/TagSelect.styl
@@ -1,46 +1,48 @@
.root
- position relative
+ position absolute
+ top 19px
+ left 44px
user-select none
-
-.icon
- display inline-block
- width 30px
vertical-align middle
- text-align center
- color $ui-button-color
+ width 300px
+ overflow-x scroll
+ white-space nowrap
+
+.root::-webkit-scrollbar
+ display none
.tag
display inline-block
margin 0 2px
+ padding-left 10px
vertical-align middle
height 20px
- background-color white
- border-radius 3px
+ background-color $ui-tag-backgroundColor
+ border-radius 20px
overflow hidden
clearfix()
.tag-removeButton
- float left
+ float right
height 20px
width 18px
margin 0
padding 0
border-style solid
- border-color $ui-button--focus-borderColor
- border-width 0 0 0 3px
+ border-width 0
+ border-radius 20px
line-height 18px
background-color transparent
color $ui-button-color
- &:hover
- background-color $ui-button--hover-backgroundColor
- &:active, &:active:hover
- color $ui-button--active-color
- background-color $ui-button--active-backgroundColor
- border-color $ui-button--focus-borderColor
- &:focus
- border-color $ui-button--focus-borderColor
+
+.tag-removeButton-icon
+ width 5px
+ padding-right 4px
.tag-label
+ font-size 12px
+ font-weight bold
+ color: #FFFFFF
float left
height 20px
line-height 20px
@@ -62,12 +64,27 @@
&:disabled
background-color $ui-input--disabled-backgroundColor = #DDD
+.add-tag-button
+ display inline
+ margin-left 5px
+ width 20px
+ height 20px
+ border none
+ border-radius 20px
+ padding 0
+ color #FFFFFF
+ &:hover
+ background-color rgba(0, 0, 0, 0.3)
+ &:active, &:active:hover
+ background-color rgba(0, 0, 0, 0.5)
+ color $ui-button--active-color
+
body[data-theme="dark"]
.icon
color $ui-dark-button-color
.tag
- background-color $ui-dark-button--hover-backgroundColor
+ background-color $ui-dark-tag-backgroundColor
.tag-removeButton
border-color $ui-button--focus-borderColor
@@ -85,3 +102,10 @@ body[data-theme="dark"]
border-color $ui-input--focus-borderColor = #369DCD
&:disabled
background-color $ui-input--disabled-backgroundColor = #DDD
+
+ .add-tag-button
+ &:hover
+ background-color rgba(255, 255, 255, 0.3)
+ &:active, &:active:hover
+ background-color rgba(255, 255, 255, 0.5)
+ color $ui-button--active-color
diff --git a/browser/main/Main.js b/browser/main/Main.js
index e3d40759..0033fa89 100644
--- a/browser/main/Main.js
+++ b/browser/main/Main.js
@@ -26,7 +26,7 @@ class Main extends React.Component {
this.state = {
isRightSliderFocused: false,
listWidth: config.listWidth,
- navWidth: config.listWidth,
+ navWidth: config.navWidth,
isLeftSliderFocused: false
}
}
@@ -85,6 +85,7 @@ class Main extends React.Component {
}
handleMouseUp (e) {
+ // Change width of NoteList component.
if (this.state.isRightSliderFocused) {
this.setState({
isRightSliderFocused: false
@@ -99,6 +100,8 @@ class Main extends React.Component {
})
})
}
+
+ // Change width of SideNav component.
if (this.state.isLeftSliderFocused) {
this.setState({
isLeftSliderFocused: false
@@ -106,10 +109,10 @@ class Main extends React.Component {
let { dispatch } = this.props
let navWidth = this.state.navWidth
// TODO: ConfigManager should dispatch itself.
- ConfigManager.set({listWidth: navWidth})
+ ConfigManager.set({ navWidth })
dispatch({
type: 'SET_NAV_WIDTH',
- listWidth: navWidth
+ navWidth,
})
})
}
@@ -162,7 +165,7 @@ class Main extends React.Component {
/>
{!config.isSideNavFolded &&
this.handleLeftSlideMouseDown(e)}
draggable='false'
>
@@ -191,15 +194,15 @@ class Main extends React.Component {
'location'
])}
/>
-
this.handleRightSlideMouseDown(e)}
draggable='false'
>
Copied!
- copied: false,
- failed: false
- }
-}
-
-export default class ShareButton extends React.Component {
- constructor (props) {
- super(props)
- this.state = getDefault()
- }
-
- componentWillReceiveProps (nextProps) {
- this.setState(getDefault())
- }
-
- componentDidMount () {
- this.dropdownInterceptor = e => {
- this.dropdownClicked = true
- }
- ReactDOM.findDOMNode(this.refs.dropdown).addEventListener('click', this.dropdownInterceptor)
- this.shareViaPublicURLHandler = e => {
- this.handleShareViaPublicURLClick(e)
- }
- }
-
- componentWillUnmount () {
- document.removeEventListener('click', this.dropdownHandler)
- ReactDOM.findDOMNode(this.refs.dropdown).removeEventListener('click', this.dropdownInterceptor)
- }
-
- handleOpenButtonClick (e) {
- this.openDropdown()
- if (this.dropdownHandler == null) {
- this.dropdownHandler = e => {
- if (!this.dropdownClicked) {
- this.closeDropdown()
- } else {
- this.dropdownClicked = false
- }
- }
- }
- document.removeEventListener('click', this.dropdownHandler)
- document.addEventListener('click', this.dropdownHandler)
- }
-
- openDropdown () {
- this.setState({openDropdown: true})
- }
-
- closeDropdown () {
- document.removeEventListener('click', this.dropdownHandler)
- this.setState({openDropdown: false})
- }
-
- handleClipboardButtonClick (e) {
- activityRecord.emit('MAIN_DETAIL_COPY')
- clipboard.writeText(this.props.article.content)
- notify('Saved to Clipboard!', {
- body: 'Paste it wherever you want!'
- })
- this.setState({openDropdown: false})
- }
-
- handleShareViaPublicURLClick (e) {
- let { user } = this.props
- let input = Object.assign({}, this.props.article, {
- clientKey: clientKey.get(),
- writerName: user.name
- })
- this.setState({
- isSharing: true,
- failed: false
- }, () => {
- api.shareViaPublicURL(input)
- .then(res => {
- let url = res.body.url
- this.setState({url: url, isSharing: false})
- activityRecord.emit('ARTICLE_SHARE')
- })
- .catch(err => {
- console.log(err)
- this.setState({isSharing: false, failed: true})
- })
- })
- }
-
- handleCopyURLClick () {
- clipboard.writeText(this.state.url)
- this.setState({copied: true})
- }
-
- // Restore copy url tooltip
- handleCopyURLMouseLeave () {
- this.setState({copied: false})
- }
-
- render () {
- let hasPublicURL = this.state.url != null
- return (
-
-
-
- {
- !hasPublicURL ? (
-
- ) : (
-
-
-
-
This url is valid for 7 days.
-
- )
- }
-
-
-
- )
- }
-}
-
-ShareButton.propTypes = {
- article: PropTypes.shape({
- publicURL: PropTypes.string,
- content: PropTypes.string
- }),
- user: PropTypes.shape({
- name: PropTypes.string
- })
-}
diff --git a/browser/main/NoteList/NoteList.styl b/browser/main/NoteList/NoteList.styl
index a20485e4..0adb3678 100644
--- a/browser/main/NoteList/NoteList.styl
+++ b/browser/main/NoteList/NoteList.styl
@@ -1,25 +1,28 @@
+$control-height = 30px
+
.root
absolute left bottom
- border-top $ui-border
top $topBar-height - 1
+ background-color $ui-noteList-backgroundColor
.control
absolute top left right
user-select none
- height 25px
- font-size 10px
- border-bottom $ui-border
+ height $control-height
+ font-size 12px
line-height 25px
display flex
- background-color $ui-backgroundColor
+ background-color $ui-noteList-backgroundColor
color $ui-inactive-text-color
.control-sortBy
flex 1
- padding-left 5px
+ padding-left 25px
.control-sortBy-select
- margin-left 5px
+ margin-left 0
+ font-size 12px
+ color $ui-inactive-text-color
padding 0
border none
background-color transparent
@@ -36,8 +39,6 @@
color $ui-active-color
&:hover
color $ui-text-color
- .control-button-tooltip
- opacity 1
.control-button--active
@extend .control-button
@@ -45,178 +46,22 @@
&:hover
color $ui-active-color
-.control-button-tooltip
- tooltip()
- position absolute
- top 20px
- right 5px
- padding 5px
- opacity 0
- white-space nowrap
- border-radius 2px
- z-index 1
-
.list
absolute left right bottom
- top 24px
+ top $control-height
overflow auto
-.item
- position relative
- border-bottom $ui-border
- padding 2px 5px
- user-select none
- cursor pointer
- transition background-color 0.15s
- &:hover
- background-color alpha($ui-active-color, 20%)
- &:active
- background-color $ui-active-color
- color white
- .item-title
- .item-title-empty
- .item-title-icon
- .item-bottom-tagIcon
- .item-bottom-tagList-empty
- .item-bottom-time
- color white
- .item-bottom-tagList-item
- background-color transparent
- color white
-
-.item--active
- @extend .item
- background-color $ui-active-color
- color white
- .item-title
- .item-title-empty
- .item-title-icon
- .item-bottom-tagIcon
- .item-bottom-tagList-empty
- .item-bottom-time
- color white
- .item-bottom-tagList-item
- background-color transparent
- color white
- &:hover
- background-color $ui-active-color
-
-.item-border
- absolute top bottom left right
- border-style solid
- border-width 2px
- border-color transparent
- transition 0.15s
-
-.item-title
- height 24px
- box-sizing border-box
- line-height 24px
- padding 0
- overflow ellipsis
- color $ui-text-color
-
-.item-title-icon
- font-size 12px
- color $ui-inactive-text-color
- padding-right 3px
-
-.item-title-empty
- font-weight normal
- color $ui-inactive-text-color
-
-.item-bottom
- margin-top 2px
- height 20px
- font-size 12px
- line-height 20px
- overflow ellipsis
- display flex
-
-.item-bottom-tagIcon
- vertical-align middle
- color $ui-button-color
- height 20px
- line-height 20px
-
-.item-bottom-tagList
- flex 1
- overflow ellipsis
- line-height 20px
-
-.item-bottom-tagList-item
- margin 0 4px
- padding 0 4px
- height 20px
- box-sizing border-box
- border-radius 3px
- vertical-align middle
- border-style solid
- border-color $ui-button--focus-borderColor
- border-width 0 0 0 3px
- background-color $ui-backgroundColor
- color $ui-text-color
-
-.item-bottom-tagList-empty
- color $ui-inactive-text-color
- vertical-align middle
- font-size 10px
- margin-left 5px
-
-.item-bottom-time
- color $ui-inactive-text-color
- margin-left 5px
- font-size 10px
-
body[data-theme="dark"]
.root
border-color $ui-dark-borderColor
- background-color $ui-dark-backgroundColor
-
- .item
- border-color $ui-dark-borderColor
- &:hover
- background-color alpha($ui-active-color, 20%)
-
- .item--active
- @extend .item
- border-color $ui-dark-borderColor
- .item-title
- color white
- .item-bottom-tagList-item
- background-color transparent
- color white
- .item-bottom-tagList-empty
- color white
- &:hover
- background-color $ui-active-color
-
- .item-title
- color $ui-dark-text-color
-
- .item-title-icon
- color $ui-darkinactive-text-color
-
- .item-title-empty
- color $ui-dark-inactive-text-color
-
- .item-bottom-tagIcon
- color $ui-dark-button-color
-
- .item-bottom-tagList-item
- border-color $ui-dark-button--focus-borderColor
- background-color $ui-dark-button--hover-backgroundColor
- color $ui-dark-text-color
-
- .item-bottom-tagList-empty
- color $ui-inactive-text-color
- vertical-align middle
+ background-color $ui-dark-noteList-backgroundColor
.control
- background-color $ui-dark-backgroundColor
+ background-color $ui-dark-noteList-backgroundColor
+
+ .control
+ background-color $ui-dark-noteList-backgroundColor
border-color $ui-dark-borderColor
- .control-sortBy-select
- color $ui-dark-text-color
.control-button
color $ui-dark-inactive-text-color
diff --git a/browser/main/NoteList/index.js b/browser/main/NoteList/index.js
index b6519db8..6fc34763 100644
--- a/browser/main/NoteList/index.js
+++ b/browser/main/NoteList/index.js
@@ -6,6 +6,8 @@ import _ from 'lodash'
import ee from 'browser/main/lib/eventEmitter'
import dataApi from 'browser/main/lib/dataApi'
import ConfigManager from 'browser/main/lib/ConfigManager'
+import NoteItem from 'browser/components/NoteItem'
+import NoteItemSimple from 'browser/components/NoteItemSimple'
const { remote } = require('electron')
const { Menu, MenuItem, dialog } = remote
@@ -314,57 +316,40 @@ class NoteList extends React.Component {
.sort(sortFunc)
let noteList = notes
- .map((note) => {
- if (note == null) return null
- let tagElements = _.isArray(note.tags)
- ? note.tags.map((tag) => {
- return (
-
- {tag}
-
- )
- })
- : []
- let isActive = location.query.key === note.storage + '-' + note.key
+ .map(note => {
+ if (note == null) {
+ return null
+ }
+
+ const isDefault = config.listStyle === 'DEFAULT'
+ const isActive = location.query.key === note.storage + '-' + note.key
+ const dateDisplay = moment(
+ config.sortBy === 'CREATED_AT' ?
+ note.createdAt : note.updatedAt
+ ).fromNow()
+ const key = `${note.storage}-${note.key}`
+
+ if (isDefault) {
+ return (
+
+ )
+ }
+
return (
- this.handleNoteClick(e, note.storage + '-' + note.key)}
- onContextMenu={(e) => this.handleNoteContextMenu(e, note.storage + '-' + note.key)}
- >
-
- {note.type === 'SNIPPET_NOTE'
- ?
- :
- }
- {note.title.trim().length > 0
- ? note.title
- : Empty
- }
-
-
- {config.listStyle === 'DEFAULT' &&
-
-
-
- {tagElements.length > 0
- ? tagElements
- : Not tagged yet
- }
-
-
-
- {moment(config.sortBy === 'CREATED_AT' ? note.createdAt : note.updatedAt).fromNow()}
-
-
- }
-
+
)
})
@@ -391,10 +376,7 @@ class NoteList extends React.Component {
}
onClick={(e) => this.handleListStyleButtonClick(e, 'DEFAULT')}
>
-
-
- Default Size
-
+
{
- let isActive = location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key))
+ let isActive = !!(location.pathname.match(new RegExp('\/storages\/' + storage.key + '\/folders\/' + folder.key)))
let noteSet = folderNoteMap.get(storage.key + '-' + folder.key)
let noteCount = noteSet != null
? noteSet.size
: 0
- return
+ return (
+ this.handleFolderButtonClick(folder.key)(e)}
+ handleContextMenu={(e) => this.handleFolderButtonContextMenu(e, folder)}
+ folderName={folder.name}
+ folderColor={folder.color}
+ isFolded={isFolded}
+ noteCount={noteCount}
+ />
+ )
})
let isActive = location.pathname.match(new RegExp('\/storages\/' + storage.key + '$'))
diff --git a/browser/main/SideNav/StorageItem.styl b/browser/main/SideNav/StorageItem.styl
index 28f28be3..eeef3bf4 100644
--- a/browser/main/SideNav/StorageItem.styl
+++ b/browser/main/SideNav/StorageItem.styl
@@ -1,10 +1,12 @@
.root
width 100%
user-select none
+
.header
position relative
height 26px
width 100%
+ margin-bottom 5px
transition 0.15s
&:hover
background-color $ui-button--hover-backgroundColor
@@ -45,7 +47,7 @@
.header-info
display block
width 100%
- height 26px
+ height 30px
padding-left 25px
padding-right 10px
line-height 26px
@@ -78,63 +80,6 @@
&:active
color $ui-active-color
-.folderList-item
- display flex
- width 100%
- height 26px
- background-color transparent
- color $ui-inactive-text-color
- padding 0
- margin-bottom 2px
- text-align left
- border none
- overflow ellipsis
- font-size 14px
- &:first-child
- margin-top 0
- &:hover
- background-color $ui-button--hover-backgroundColor
- &:active
- color $ui-button--active-color
- background-color $ui-button--active-backgroundColor
-
-.folderList-item--active
- @extend .folderList-item
- color $ui-button--active-color
- background-color $ui-button--active-backgroundColor
- &:hover
- color $ui-button--active-color
- background-color $ui-button--active-backgroundColor
-
-.folderList-item-name
- display block
- flex 1
- padding 0 10px
- height 26px
- line-height 26px
- border-width 0 0 0 6px
- border-style solid
- border-color transparent
-
-.folderList-item-noteCount
- float right
- line-height 26px
- padding-right 5px
- font-size 12px
-
-.folderList-item-tooltip
- tooltip()
- position fixed
- padding 0 10px
- left 44px
- z-index 10
- pointer-events none
- opacity 0
- border-top-right-radius 2px
- border-bottom-right-radius 2px
- height 26px
- line-height 26px
-
.root--folded
@extend .root
.header
@@ -161,11 +106,7 @@
.header-info--folded-tooltip-path
font-size 10px
margin 0 5px
- .folderList-item:hover, .folderList-item--active:hover
- .folderList-item-tooltip
- opacity 1
- .folderList-item-name
- padding-left 14px
+
body[data-theme="dark"]
.header-toggleButton
.header-addFolderButton
diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js
index 9b80791b..c0fe0fd2 100644
--- a/browser/main/SideNav/index.js
+++ b/browser/main/SideNav/index.js
@@ -5,6 +5,7 @@ import { openModal } from 'browser/main/lib/modal'
import PreferencesModal from '../modals/PreferencesModal'
import ConfigManager from 'browser/main/lib/ConfigManager'
import StorageItem from './StorageItem'
+import SideNavFilter from 'browser/components/SideNavFilter'
const electron = require('electron')
const { remote } = electron
@@ -39,8 +40,8 @@ class SideNav extends React.Component {
let { data, location, config, dispatch } = this.props
let isFolded = config.isSideNavFolded
- let isHomeActive = location.pathname.match(/^\/home$/)
- let isStarredActive = location.pathname.match(/^\/starred$/)
+ let isHomeActive = !!location.pathname.match(/^\/home$/)
+ let isStarredActive = !!location.pathname.match(/^\/starred$/)
let storageList = data.storageMap.map((storage, key) => {
return
-
-
-
-
+ this.handleHomeButtonClick(e)}
+ isStarredActive={isStarredActive}
+ handleStarredButtonClick={(e) => this.handleStarredButtonClick(e)}
+ />
{storageList.length > 0 ? storageList : (
diff --git a/browser/main/StatusBar/StatusBar.styl b/browser/main/StatusBar/StatusBar.styl
index 38083bb8..6c14b86b 100644
--- a/browser/main/StatusBar/StatusBar.styl
+++ b/browser/main/StatusBar/StatusBar.styl
@@ -1,9 +1,12 @@
+@import('../Detail/DetailVars')
+
.root
absolute bottom left right
height $statusBar-height
- background-color $ui-backgroundColor
+ background-color $ui-noteDetail-backgroundColor
border-top $ui-border
display flex
+ box-shadow $note-detail-box-shadow
.blank
flex 1
@@ -39,8 +42,9 @@
body[data-theme="dark"]
.root
- background-color $ui-dark-backgroundColor
+ background-color $ui-dark-noteDetail-backgroundColor
border-color $ui-dark-borderColor
+ box-shadow none
.zoom
border-color $ui-dark-borderColor
diff --git a/browser/main/TopBar/TopBar.styl b/browser/main/TopBar/TopBar.styl
index b2cfef67..9eccccb4 100644
--- a/browser/main/TopBar/TopBar.styl
+++ b/browser/main/TopBar/TopBar.styl
@@ -1,19 +1,19 @@
.root
position relative
- background-color $ui-backgroundColor
+ background-color $ui-noteList-backgroundColor
height $topBar-height - 1
+
.root--expanded
@extend .root
+
$control-height = 34px
.control
position absolute
- top 8px
+ top 13px
left 8px
right 8px
height $control-height
- border $ui-border
- border-radius 20px
overflow hidden
display flex
@@ -28,6 +28,7 @@ $control-height = 34px
line-height 32px
width 35px
color $ui-inactive-text-color
+ background-color $ui-noteList-backgroundColor
.control-search-input
display block
@@ -38,6 +39,7 @@ $control-height = 34px
height 100%
outline none
border none
+ background-color $ui-noteList-backgroundColor
.control-search-optionList
position fixed
@@ -58,6 +60,7 @@ $control-height = 34px
overflow ellipsis
&:hover
background-color alpha($ui-active-color, 10%)
+
.control-search-optionList-item-folder
border-left 4px solid transparent
padding 2px 5px
@@ -66,40 +69,30 @@ $control-height = 34px
font-size 12px
height 16px
margin-bottom 4px
+
.control-search-optionList-item-folder-surfix
font-size 10px
margin-left 5px
color $ui-inactive-text-color
+
.control-search-optionList-item-type
font-size 12px
color $ui-inactive-text-color
padding-right 3px
+
.control-search-optionList-empty
height 150px
color $ui-inactive-text-color
line-height 150px
text-align center
-.control-contextButton
- display block
- width 20px
- height $control-height - 2
- navButtonColor()
- border-left $ui-border
- font-size 14px
- line-height 28px
- padding 0
- &:active
- border-color $ui-button--active-backgroundColor
- &:hover .control-newPostButton-tooltip
- opacity 1
-
.control-newPostButton
display block
- width 36px
+ width 32px
height $control-height - 2
navButtonColor()
- border-left $ui-border
+ border $ui-border
+ border-radius 32px
font-size 14px
line-height 28px
padding 0
@@ -112,17 +105,18 @@ $control-height = 34px
tooltip()
position fixed
pointer-events none
- top 45px
- left 385px
- z-index 10
+ top 50px
+ left 433px
+ z-index 200
padding 5px
line-height normal
+ border-radius 2px
opacity 0
transition 0.1s
body[data-theme="dark"]
.root, .root--expanded
- background-color $ui-dark-backgroundColor
+ background-color $ui-dark-noteList-backgroundColor
.control
border-color $ui-dark-borderColor
@@ -134,11 +128,13 @@ body[data-theme="dark"]
line-height 32px
width 35px
color $ui-dark-inactive-text-color
+ background-color $ui-dark-noteList-backgroundColor
.control-search-input
input
- background-color $dark-background-color
+ background-color $ui-dark-noteList-backgroundColor
color $ui-dark-text-color
+
.control-search-optionList
color white
background-color $ui-dark-button--hover-backgroundColor
@@ -162,10 +158,10 @@ body[data-theme="dark"]
.control-search-optionList-empty
color $ui-inactive-text-color
- .control-contextButton,
.control-newPostButton
colorDarkDefaultButton()
border-color $ui-dark-borderColor
+ background-color $ui-dark-noteList-backgroundColor
&:active
border-color $ui-dark-button--active-backgroundColor
diff --git a/browser/main/TopBar/index.js b/browser/main/TopBar/index.js
index 2e4e6ccf..c1094198 100644
--- a/browser/main/TopBar/index.js
+++ b/browser/main/TopBar/index.js
@@ -192,47 +192,6 @@ class TopBar extends React.Component {
}
}
- handleContextButtonClick (e) {
- let { config } = this.props
-
- let menu = new Menu()
- menu.append(new MenuItem({
- label: 'Create Markdown Note',
- click: (e) => this.createNote('MARKDOWN_NOTE')
- }))
- menu.append(new MenuItem({
- label: 'Create Snippet Note',
- click: (e) => this.createNote('SNIPPET_NOTE')
- }))
- menu.append(new MenuItem({
- type: 'separator'
- }))
- menu.append(new MenuItem({
- label: 'Change Default Note',
- submenu: [
- {
- type: 'radio',
- label: 'Markdown Note',
- checked: config.ui.defaultNote === 'MARKDOWN_NOTE',
- click: (e) => this.setDefaultNote('MARKDOWN_NOTE')
- },
- {
- type: 'radio',
- label: 'Snippet Note',
- checked: config.ui.defaultNote === 'SNIPPET_NOTE',
- click: (e) => this.setDefaultNote('SNIPPET_NOTE')
- },
- {
- type: 'radio',
- label: 'Always Ask',
- checked: config.ui.defaultNote === 'ALWAYS_ASK',
- click: (e) => this.setDefaultNote('ALWAYS_ASK')
- }
- ]
- }))
- menu.popup(remote.getCurrentWindow())
- }
-
createNote (noteType) {
let { dispatch, location } = this.props
if (noteType !== 'MARKDOWN_NOTE' && noteType !== 'SNIPPET_NOTE') throw new Error('Invalid note type.')
@@ -353,14 +312,9 @@ class TopBar extends React.Component {
onClick={(e) => this.handleNewPostButtonClick(e)}>
- New Note {OSX ? '⌘' : '^'} + n
+ Make a Note {OSX ? '⌘' : '^'} + n
-
)
diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js
index 3df57b1b..4008b881 100644
--- a/browser/main/lib/ConfigManager.js
+++ b/browser/main/lib/ConfigManager.js
@@ -10,7 +10,7 @@ let isInitialized = false
export const DEFAULT_CONFIG = {
zoom: 1,
isSideNavFolded: false,
- listWidth: 250,
+ listWidth: 280,
navWidth: 200,
sortBy: 'UPDATED_AT', // 'CREATED_AT', 'UPDATED_AT', 'APLHABETICAL'
listStyle: 'DEFAULT', // 'DEFAULT', 'SMALL'
diff --git a/browser/main/modals/CreateFolderModal.js b/browser/main/modals/CreateFolderModal.js
index 0b8adeca..2dc61271 100644
--- a/browser/main/modals/CreateFolderModal.js
+++ b/browser/main/modals/CreateFolderModal.js
@@ -75,24 +75,27 @@ class CreateFolderModal extends React.Component {
onKeyDown={(e) => this.handleKeyDown(e)}
>
-
New Folder
+
Create new folder
-
+
-
this.handleChange(e)}
- onKeyDown={(e) => this.handleInputKeyDown(e)}
- />
+
+
Folder name
+
this.handleChange(e)}
+ onKeyDown={(e) => this.handleInputKeyDown(e)}
+ />
+
diff --git a/browser/main/modals/CreateFolderModal.styl b/browser/main/modals/CreateFolderModal.styl
index ff0ddfa4..6b1d208b 100644
--- a/browser/main/modals/CreateFolderModal.styl
+++ b/browser/main/modals/CreateFolderModal.styl
@@ -1,47 +1,52 @@
.root
modal()
- max-width 340px
+ width 700px
+ height 200px
overflow hidden
position relative
+ padding 0 40px
.header
height 50px
+ margin-bottom 10px
+ margin-top 10px
font-size 18px
line-height 50px
- padding 0 15px
background-color $ui-backgroundColor
- border-bottom solid 1px $ui-borderColor
color $ui-text-color
-.closeButton
+.close-mark
+ font-size 15px
+
+.close
+ height 50px
position absolute
- top 10px
+ background-color transparent
+ color $ui-inactive-text-color
+ border none
+ top 7px
right 10px
- height 30px
- width 0 25px
- border $ui-border
- border-radius 2px
- color $ui-text-color
- colorDefaultButton()
-
-.control
- padding 25px 15px 15px
text-align center
+ width top-bar--height
+ height top-bar--height
-.control-input
+.control-folder-label
+ text-align left
+ font-size 14px
+ color $ui-text-color
+
+.control-folder-input
display block
height 30px
- width 240px
+ width 620px
padding 0 5px
- margin 0 auto 15px
- border none
- border-bottom solid 1px $border-color
- border-radius 2px
+ margin 10px auto 15px
+ border 1px solid #C9C9C9 // TODO: use variable.
+ border-radius 5px
background-color transparent
outline none
vertical-align middle
font-size 18px
- text-align center
&:disabled
background-color $ui-input--disabled-backgroundColor
&:focus, &:active
@@ -50,21 +55,35 @@
.control-confirmButton
display block
height 30px
+ width 620px
border none
- border-radius 2px
+ border-radius 5px
padding 0 25px
- margin 0 auto
+ margin 20px auto
+ font-size 14px
colorPrimaryButton()
body[data-theme="dark"]
.root
modalDark()
+ width 700px
+ height 200px
+ overflow hidden
+ position relative
+ padding 0 40px
.header
- background-color $ui-dark-button--hover-backgroundColor
+ background-color transparent
border-color $ui-dark-borderColor
color $ui-dark-text-color
+ .control-folder-label
+ color $ui-dark-text-color
+
+ .control-folder-input
+ border 1px solid #C9C9C9 // TODO: use variable.
+ color white
+
.closeButton
border-color $ui-dark-borderColor
color $ui-dark-text-color
@@ -72,8 +91,3 @@ body[data-theme="dark"]
.description
color $ui-inactive-text-color
-
- .control-input
- border-color $ui-dark-borderColor
- color white
-
diff --git a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js
index a4562eaf..554652a3 100644
--- a/browser/main/modals/NewNoteModal.js
+++ b/browser/main/modals/NewNoteModal.js
@@ -100,7 +100,7 @@ class NewNoteModal extends React.Component {
onKeyDown={(e) => this.handleKeyDown(e)}
>