Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8311030
add the tag to routing
sosukesuzuki Sep 30, 2017
5248c05
switching view and change routing
sosukesuzuki Sep 30, 2017
3154110
list tags
sosukesuzuki Sep 30, 2017
ad0ac19
handling tagButton click
sosukesuzuki Sep 30, 2017
faede48
feature tag search
sosukesuzuki Sep 30, 2017
06bd2b2
add title "tags"
sosukesuzuki Sep 30, 2017
59e5c54
fix button style to change color when switch active/inactive
sosukesuzuki Sep 30, 2017
95e237d
fix style tagList
sosukesuzuki Sep 30, 2017
c2aa351
remove button width style
sosukesuzuki Sep 30, 2017
8526177
complete editting file
sosukesuzuki Sep 30, 2017
bf9ecb0
remove extra parens
sosukesuzuki Sep 30, 2017
2886da4
give the key props to tagList Item
sosukesuzuki Sep 30, 2017
0ca87ea
fix type description parens () -> {}
sosukesuzuki Oct 2, 2017
e300b33
fix a mistake in function naming
sosukesuzuki Oct 2, 2017
4689dde
some rename plural form or easy to understand
sosukesuzuki Oct 2, 2017
d09de09
use color variables
sosukesuzuki Oct 6, 2017
3192ce9
modify to use PropTypes
sosukesuzuki Oct 6, 2017
e8abd43
modify to remove unnecessary "return"
sosukesuzuki Oct 6, 2017
ad7a3c4
modify to use "const" from "let"
sosukesuzuki Oct 6, 2017
012e2dd
remove unnecessary "e" variables
sosukesuzuki Oct 6, 2017
86270dd
add the comment fot complicated condition
sosukesuzuki Oct 6, 2017
7691b66
remove unnecesarry "return"
sosukesuzuki Oct 6, 2017
d867292
remove unnecesarry "e" variable
sosukesuzuki Oct 6, 2017
3533903
duplicate conditions as a variable
sosukesuzuki Oct 6, 2017
6018cd5
get "data" from this.props
sosukesuzuki Oct 6, 2017
2fddc32
cut out StorageList component
sosukesuzuki Oct 6, 2017
f805e8a
cut out NavToggle component
sosukesuzuki Oct 6, 2017
046e6af
remove extra semicolon and fix indent
sosukesuzuki Oct 6, 2017
a22e97d
add a space after "//" in comment
sosukesuzuki Oct 6, 2017
e8564f6
modify propTypes "array" -> "arrayOf"
sosukesuzuki Oct 7, 2017
3c4fa83
modify the arg of arrayOf to the correct
sosukesuzuki Oct 9, 2017
9b60814
fix bug : isTrashedActive and isStarredActive are inverted
sosukesuzuki Oct 9, 2017
ff4b96b
implement tagItem active styleName
sosukesuzuki Oct 9, 2017
35beec3
insert necessary space
sosukesuzuki Oct 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions browser/components/NavToggleButton.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @fileoverview Micro component for toggle SideNav
*/
import React, { PropTypes } from 'react'
import styles from './NavToggleButton.styl'
import CSSModules from 'browser/lib/CSSModules'

/**
* @param {boolean} isFolded
* @param {Function} handleToggleButtonClick
*/

const NavToggleButton = ({isFolded, handleToggleButtonClick}) => (
<button styleName='navToggle'
onClick={(e) => handleToggleButtonClick(e)}
>
{isFolded
? <i className='fa fa-angle-double-right' />
: <i className='fa fa-angle-double-left' />
}
</button>
)

NavToggleButton.propTypes = {
isFolded: PropTypes.bool.isRequired,
handleToggleButtonClick: PropTypes.func.isRequired
}

export default CSSModules(NavToggleButton, styles)
19 changes: 19 additions & 0 deletions browser/components/NavToggleButton.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.navToggle
navButtonColor()
display block
position absolute
right 5px
bottom 5px
border-radius 16.5px
height 34px
width 34px
line-height 32px
padding 0

body[data-theme="dark"]
.navToggle
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color

23 changes: 23 additions & 0 deletions browser/components/StorageList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* @fileoverview Micro component for showing StorageList
*/
import React, { PropTypes } from 'react'
import styles from './StorgaeList.styl'
import CSSModules from 'browser/lib/CSSModules'

/**
* @param {Array} storgaeList
*/

const StorageList = ({storageList}) => (
<div styleName='storageList'>
{storageList.length > 0 ? storageList : (
<div styleName='storgaeList-empty'>No storage mount.</div>
)}
</div>
)

StorageList.propTypes = {
storgaeList: PropTypes.arrayOf(PropTypes.element).isRequired
}
export default CSSModules(StorageList, styles)
20 changes: 20 additions & 0 deletions browser/components/StorgaeList.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.storageList
absolute left right
bottom 37px
top 160px
overflow-y auto

.storageList-empty
padding 0 10px
margin-top 15px
line-height 24px
color $ui-inactive-text-color

body[data-theme="dark"]
.storageList-empty
color $ui-dark-inactive-text-color

.root-folded
.storageList-empty
white-space nowrap
transform rotate(90deg)
27 changes: 27 additions & 0 deletions browser/components/TagListItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @fileoverview Micro component for showing TagList.
*/
import React, { PropTypes } from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PropTypes is not used in this file.
Let's use it. handleClickTagListItem is a little bit complicated, so declaration type for it will help us to understand.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's true.
I forgot to use it ... I will modify it to use it.

import styles from './TagListItem.styl'
import CSSModules from 'browser/lib/CSSModules'

/**
* @param {string} name
* @param {Function} handleClickTagListItem
* @param {bool} isActive
*/

const TagListItem = ({name, handleClickTagListItem, isActive}) => (
<button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}>
<span styleName='tagList-item-name'>
{`# ${name}`}
</span>
</button>
)

TagListItem.propTypes = {
name: PropTypes.string.isRequired,
handleClickTagListItem: PropTypes.func.isRequired
}

export default CSSModules(TagListItem, styles)
45 changes: 45 additions & 0 deletions browser/components/TagListItem.styl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.tagList-item
display flex
width 100%
height 26px
background-color transparent
color $ui-inactive-text-color
padding 0
margin-bottom 5px
text-align left
border none
overflow ellipsis
font-size 12px
&:first-child
margin-top 0
&:hover
color $ui-text-color
background-color alpha($ui-button--active-backgroundColor, 20%)
transition background-color 0.15s
&:active
color $ui-text-color
background-color $ui-button--active-backgroundColor

.tagList-item-active
background-color $ui-button--active-backgroundColor
display flex
width 100%
height 26px
padding 0
margin-bottom 5px
text-align left
border none
overflow ellipsis
font-size 12px

.tagList-item-name
display block
flex 1
padding 0 25px
height 26px
line-height 26px
border-width 0 0 0 2px
border-style solid
border-color transparent
overflow hidden
text-overflow ellipsis
10 changes: 9 additions & 1 deletion browser/main/NoteList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ class NoteList extends React.Component {
let { data, params, location } = this.props
let { router } = this.context

if (location.pathname.match(/\/home/)) {
if (location.pathname.match(/\/home/) || location.pathname.match(/\alltags/)) {
const allNotes = data.noteMap.map((note) => note)
this.contextNotes = allNotes
return allNotes
Expand All @@ -255,6 +255,14 @@ class NoteList extends React.Component {
return trashedNotes
}

if (location.pathname.match(/\/tags/)) {
return data.noteMap.map(note => {
return note
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that note was not edit. Is it necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data.noteMap has map function, but it has not filter function.
We can get array of noteObject by usingdata.noteMap.map(note => { return note }.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢

}).filter(note => {
return note.tags.includes(params.tagname)
})
}

return this.getContextNotes()
}

Expand Down
44 changes: 10 additions & 34 deletions browser/main/SideNav/SideNav.styl
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,33 @@
height $topBar-height
padding 0 15px
font-size 12px
width 100%
text-align left
width 33%
text-align center
&:hover
color $ui-text-color
&:active, &:active:hover
color $ui-text-color
background-color alpha($ui-button--active-backgroundColor, 20%)

.active-button
background-color $ui-button--active-color

.non-active-button
background-color $ui-button-color

.top-menu-label
margin-left 5px
overflow ellipsis

.storageList
.tagList
absolute left right
bottom 37px
top 160px
top 80px
overflow-y auto

.storageList-empty
padding 0 10px
margin-top 15px
line-height 24px
color $ui-inactive-text-color

.navToggle
navButtonColor()
display block
position absolute
right 5px
bottom 5px
border-radius 16.5px
height 34px
width 34px
line-height 32px
padding 0

.root--folded
@extend .root
width 44px
.storageList-empty
white-space nowrap
transform rotate(90deg)
.top-menu
width 44px - 1
text-align center
Expand Down Expand Up @@ -119,12 +104,3 @@ body[data-theme="dark"]
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)

.storageList-empty
color $ui-dark-inactive-text-color

.navToggle
&:hover
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
transition 0.15s
color $ui-dark-text-color
Loading