1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 02:06:29 +00:00

Merge pull request #1121 from BoostIO/fix-note-detail-layout

Fix note detail layout
This commit is contained in:
Kazz Yokomizo
2017-11-14 21:36:13 +09:00
committed by GitHub
18 changed files with 111 additions and 104 deletions

View File

@@ -9,16 +9,20 @@ Boostnote is an open source project. It's an independent project with its ongoin
## Backers via OpenCollective ## Backers via OpenCollective
<a href="https://opencollective.com/boostnoteio#backers" target="_blank"><img src="https://opencollective.com/boostnoteio/backers.svg?width=890"></a> <a href="https://opencollective.com/boostnoteio#backers" target="_blank"><img src="https://opencollective.com/boostnoteio/backers.svg?width=890"></a>
- [Kazu Yokomizo](https://twitter.com/kazup_bot) - $20 - [Ralph03](https://opencollective.com/ralph03) - $24
- [Nikolas Dan](https://opencollective.com/nikolas-dan) - $20 - [Nikolas Dan](https://opencollective.com/nikolas-dan) - $20
- [tatoosh11](https://twitter.com/ta11) - $10 - [tatoosh11](https://twitter.com/ta11) - $10
- [Alexander Borovkov](https://opencollective.com/alexander-borovkov) - $10
- [Yeojong Kim](https://twitter.com/yeojoy) - $5 - [Yeojong Kim](https://twitter.com/yeojoy) - $5
- [Scotia Draven](https://opencollective.com/scotia-draven) - $5 - [Scotia Draven](https://opencollective.com/scotia-draven) - $5
- [spoonhoop](https://opencollective.com/spoonhoop) - $5
## Backers via Bountysource ## Backers via Bountysource
https://salt.bountysource.com/teams/boostnote https://salt.bountysource.com/teams/boostnote

View File

@@ -149,13 +149,15 @@ body[data-theme="white"]
.item .item
background-color $ui-white-noteList-backgroundColor background-color $ui-white-noteList-backgroundColor
&:hover &:hover
background-color alpha($ui-button--active-backgroundColor, 40%) background-color alpha($ui-button--active-backgroundColor, 60%)
&:active &:active
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
.item--active .item--active
@extend .item @extend .item
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
&:hover
background-color alpha($ui-button--active-backgroundColor, 60%)
body[data-theme="dark"] body[data-theme="dark"]
.root .root
@@ -208,7 +210,7 @@ body[data-theme="dark"]
background-color alpha(white, 10%) background-color alpha(white, 10%)
color $ui-dark-text-color color $ui-dark-text-color
&:hover &:hover
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color #c0392b color #c0392b
.item-bottom-tagList-item .item-bottom-tagList-item
background-color alpha(#fff, 20%) background-color alpha(#fff, 20%)

View File

@@ -71,13 +71,15 @@ body[data-theme="white"]
.item-simple .item-simple
background-color $ui-white-noteList-backgroundColor background-color $ui-white-noteList-backgroundColor
&:hover &:hover
background-color alpha($ui-button--active-backgroundColor, 40%) background-color alpha($ui-button--active-backgroundColor, 60%)
&:active &:active
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
.item-simple--active .item-simple--active
@extend .item-simple @extend .item-simple
background-color $ui-button--active-backgroundColor background-color $ui-button--active-backgroundColor
&:hover
background-color alpha($ui-button--active-backgroundColor, 60%)
body[data-theme="dark"] body[data-theme="dark"]
.root .root
@@ -127,7 +129,7 @@ body[data-theme="dark"]
background-color alpha(white, 10%) background-color alpha(white, 10%)
color $ui-dark-text-color color $ui-dark-text-color
&:hover &:hover
background-color alpha($ui-dark-button--active-backgroundColor, 50%) background-color alpha($ui-dark-button--active-backgroundColor, 60%)
color #c0392b color #c0392b
.item-simple-bottom-tagList-item .item-simple-bottom-tagList-item
background-color alpha(#fff, 20%) background-color alpha(#fff, 20%)

View File

@@ -1,7 +1,7 @@
.percentageBar .percentageBar
position absolute position absolute
top 58px top 40px
right: 0px right 0px
left 0px left 0px
background-color #DADFE1 background-color #DADFE1
width 100% width 100%

View File

@@ -3,7 +3,7 @@
*/ */
// Margin on the left side and the right side for NoteDetail component. // Margin on the left side and the right side for NoteDetail component.
$note-detail-left-margin = 25px $note-detail-left-margin = 50px
$note-detail-right-margin = 25px $note-detail-right-margin = 70px
$note-detail-box-shadow = 2px 0 15px -8px #b1b1b1 inset $note-detail-box-shadow = 2px 0 15px -8px #b1b1b1 inset

View File

@@ -8,7 +8,7 @@ const InfoButton = ({
<button styleName='control-infoButton' <button styleName='control-infoButton'
onClick={onClick} onClick={onClick}
> >
<i className='fa fa-info infoButton' styleName='info-button' /> <i className='fa fa-info-circle infoButton' styleName='info-button' />
</button> </button>
) )

View File

@@ -1,5 +1,5 @@
.control-infoButton .control-infoButton
float right top 10px
topBarButtonLight() topBarButtonLight()
.control-infoPanel .control-infoPanel

View File

@@ -11,7 +11,7 @@
.control-infoButton-panel .control-infoButton-panel
z-index 200 z-index 200
margin-top 38px margin-top 38px
margin-left -140px right 0px
position absolute position absolute
padding 20px 25px 0 25px padding 20px 25px 0 25px
width 300px width 300px
@@ -33,7 +33,7 @@
.control-infoButton-panel-trash .control-infoButton-panel-trash
z-index 200 z-index 200
margin-top 45px margin-top 45px
margin-left -190px right 0px
position absolute position absolute
padding 20px 25px 0 25px padding 20px 25px 0 25px
width 300px width 300px

View File

@@ -15,6 +15,7 @@ import _ from 'lodash'
import { findNoteTitle } from 'browser/lib/findNoteTitle' import { findNoteTitle } from 'browser/lib/findNoteTitle'
import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig' import AwsMobileAnalyticsConfig from 'browser/main/lib/AwsMobileAnalyticsConfig'
import TrashButton from './TrashButton' import TrashButton from './TrashButton'
import PermanentDeleteButton from './PermanentDeleteButton'
import InfoButton from './InfoButton' import InfoButton from './InfoButton'
import InfoPanel from './InfoPanel' import InfoPanel from './InfoPanel'
import InfoPanelTrashed from './InfoPanelTrashed' import InfoPanelTrashed from './InfoPanelTrashed'
@@ -231,7 +232,7 @@ class MarkdownNoteDetail extends React.Component {
} }
getToggleLockButton () { getToggleLockButton () {
return this.state.isLocked ? 'fa-lock' : 'fa-unlock' return this.state.isLocked ? 'fa-eye-slash' : 'fa-eye'
} }
handleDeleteKeyDown (e) { handleDeleteKeyDown (e) {
@@ -285,7 +286,7 @@ class MarkdownNoteDetail extends React.Component {
/> />
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} /> <PermanentDeleteButton onClick={(e) => this.handleTrashButtonClick(e)} />
<InfoButton <InfoButton
onClick={(e) => this.handleInfoButtonClick(e)} onClick={(e) => this.handleInfoButtonClick(e)}
/> />
@@ -302,10 +303,6 @@ class MarkdownNoteDetail extends React.Component {
const detailTopBar = <div styleName='info'> const detailTopBar = <div styleName='info'>
<div styleName='info-left'> <div styleName='info-left'>
<StarButton styleName='info-left-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<div styleName='info-left-top'> <div styleName='info-left-top'>
<FolderSelect styleName='info-left-top-folderSelect' <FolderSelect styleName='info-left-top-folderSelect'
value={this.state.note.storage + '-' + this.state.note.folder} value={this.state.note.storage + '-' + this.state.note.folder}
@@ -325,6 +322,15 @@ class MarkdownNoteDetail extends React.Component {
/> />
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<InfoButton
onClick={(e) => this.handleInfoButtonClick(e)}
/>
<StarButton
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
{(() => { {(() => {
const faClassName = `fa ${this.getToggleLockButton()}` const faClassName = `fa ${this.getToggleLockButton()}`
const lockButtonComponent = const lockButtonComponent =
@@ -333,23 +339,20 @@ class MarkdownNoteDetail extends React.Component {
onMouseDown={(e) => this.handleLockButtonMouseDown(e)} onMouseDown={(e) => this.handleLockButtonMouseDown(e)}
> >
<i className={faClassName} styleName='lock-button' /> <i className={faClassName} styleName='lock-button' />
<span styleName='control-lockButton-tooltip'>
{this.state.isLocked ? 'Unlock Editor' : 'Keep Editor Locked'}
</span>
</button> </button>
return ( return (
this.state.isLockButtonShown ? lockButtonComponent : '' this.state.isLockButtonShown ? lockButtonComponent : ''
) )
})()} })()}
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
<button styleName='control-fullScreenButton' <button styleName='control-fullScreenButton'
onMouseDown={(e) => this.handleFullScreenButton(e)} onMouseDown={(e) => this.handleFullScreenButton(e)}
> >
<i className='fa fa-window-maximize' styleName='fullScreen-button' /> <i className='fa fa-window-maximize' styleName='fullScreen-button' />
</button> </button>
<InfoButton
onClick={(e) => this.handleInfoButtonClick(e)} <TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
/>
<InfoPanel <InfoPanel
storageName={currentOption.storage.name} storageName={currentOption.storage.name}
folderName={currentOption.folder.name} folderName={currentOption.folder.name}

View File

@@ -11,23 +11,15 @@
padding-bottom 3px padding-bottom 3px
.control-lockButton .control-lockButton
top 160px
topBarButtonLight() topBarButtonLight()
.control-lockButton-tooltip .trashed-infopanel
tooltip() top 40px
position fixed position relative
pointer-events none
top 50px
z-index 200
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
.control-fullScreenButton .control-fullScreenButton
float right top 80px
padding 0 0 2px 0
topBarButtonLight() topBarButtonLight()
.body .body

View File

@@ -1,7 +1,7 @@
@import('DetailVars') @import('DetailVars')
$info-height = 60px $info-height = 40px
$info-margin-under-border = 27px $info-margin-under-border = 15px
.info .info
absolute top left right absolute top left right
@@ -13,8 +13,10 @@ $info-margin-under-border = 27px
.info-left .info-left
float left float left
padding 0 5px padding 0 7px
margin 0px 2px width 100%
display flex
.info-left-top .info-left-top
display inline-block display inline-block
height $info-height height $info-height
@@ -22,12 +24,13 @@ $info-margin-under-border = 27px
.info-left-top-folderSelect .info-left-top-folderSelect
padding 0 3px padding 0 3px
height 34px height 40px
line-height 26px line-height 40px
display flex display flex
align-items center align-items center
justify-content center justify-content center
border-radius 3px border-radius 3px
.info-left-button .info-left-button
width 34px width 34px
height 34px height 34px
@@ -48,7 +51,7 @@ $info-margin-under-border = 27px
.info-right .info-right
position absolute position absolute
right 0 right -20px
top 0 top 0
background $ui-noteDetail-backgroundColor background $ui-noteDetail-backgroundColor
bottom 1px bottom 1px
@@ -59,7 +62,7 @@ $info-margin-under-border = 27px
height 34px height 34px
border-radius 17px border-radius 17px
font-size 14px font-size 14px
margin 15px 7px margin 5px 0px
border none border none
color $ui-button-color color $ui-button-color
display flex display flex
@@ -72,6 +75,7 @@ $info-margin-under-border = 27px
border-color $ui-button--active-backgroundColor border-color $ui-button--active-backgroundColor
&:hover &:hover
background-color alpha($ui-button--hover-backgroundColor, 60%) background-color alpha($ui-button--hover-backgroundColor, 60%)
transition 0.2s
.control-lockButton-tooltip .control-lockButton-tooltip
opacity 1 opacity 1

View File

@@ -0,0 +1,19 @@
import React, { PropTypes } from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './TrashButton.styl'
const PermanentDeleteButton = ({
onClick
}) => (
<button styleName='control-trashButton--in-trash'
onClick={(e) => onClick(e)}
>
<i className='fa fa-trash trashButton' styleName='info-button' />
</button>
)
PermanentDeleteButton.propTypes = {
onClick: PropTypes.func.isRequired
}
export default CSSModules(PermanentDeleteButton, styles)

View File

@@ -583,10 +583,6 @@ class SnippetNoteDetail extends React.Component {
const detailTopBar = <div styleName='info'> const detailTopBar = <div styleName='info'>
<div styleName='info-left'> <div styleName='info-left'>
<StarButton styleName='info-left-button'
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<div styleName='info-left-top'> <div styleName='info-left-top'>
<FolderSelect styleName='info-left-top-folderSelect' <FolderSelect styleName='info-left-top-folderSelect'
value={this.state.note.storage + '-' + this.state.note.folder} value={this.state.note.storage + '-' + this.state.note.folder}
@@ -603,15 +599,21 @@ class SnippetNoteDetail extends React.Component {
/> />
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
<button styleName='control-fullScreenButton'
onMouseDown={(e) => this.handleFullScreenButton(e)}
>
<i className='fa fa-window-maximize' styleName='fullScreen-button' />
</button>
<InfoButton <InfoButton
onClick={(e) => this.handleInfoButtonClick(e)} onClick={(e) => this.handleInfoButtonClick(e)}
/> />
<StarButton
onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred}
/>
<button styleName='control-fullScreenButton'
onMouseDown={(e) => this.handleFullScreenButton(e)}>
<i className='fa fa-window-maximize' styleName='fullScreen-button' />
</button>
<TrashButton onClick={(e) => this.handleTrashButtonClick(e)} />
<InfoPanel <InfoPanel
storageName={currentOption.storage.name} storageName={currentOption.storage.name}
folderName={currentOption.folder.name} folderName={currentOption.folder.name}

View File

@@ -43,7 +43,7 @@
overflow hidden overflow hidden
.tabList .plusButton .tabList .plusButton
navButtonColor() navWhiteButtonColor()
width 30px width 30px
.tabView .tabView
@@ -66,8 +66,7 @@
color white color white
.control-fullScreenButton .control-fullScreenButton
float right top 80px
padding 0 0 2px 0
topBarButtonLight() topBarButtonLight()
body[data-theme="white"] body[data-theme="white"]

View File

@@ -1,47 +1,24 @@
.root .root
left 7px top 45px
top 0 topBarButtonLight()
padding 0
color alpha($ui-favorite-star-button-color, 60%)
&:hover &:hover
transition 0.15s transition 0.2s
background-color alpha($ui-button--active-backgroundColor, 40%) color alpha($ui-favorite-star-button-color, 0.6)
color $ui-favorite-star-button-color
&:active
transition 0.15s
background-color alpha($ui-button--active-backgroundColor, 40%)
color $ui-favorite-star-button-color
.root--active .root--active
@extend .root @extend .root
transition 0.15s
color $ui-favorite-star-button-color color $ui-favorite-star-button-color
&:hover &:hover
transition 0.15s transition 0.2s
color $ui-favorite-star-button-color color alpha($ui-favorite-star-button-color, 0.6)
background-color alpha($ui-button--active-backgroundColor, 40%)
&:active
transition 0.15s
color $ui-favorite-star-button-color
background-color alpha($ui-button--active-backgroundColor, 40%)
.icon .icon
transition transform 0.15s transition transform 0.15s
body[data-theme="dark"] body[data-theme="dark"]
.root .root
topBarButtonDark()
&:hover &:hover
transition 0.15s transition 0.2s
background-color alpha($ui-dark-button--active-backgroundColor, 20%) color alpha($ui-favorite-star-button-color, 0.6)
color $ui-favorite-star-button-color
&:active
transition 0.15s
background-color alpha($ui-dark-button--active-backgroundColor, 20%)
color $ui-favorite-star-button-color
.root--active
@extend .root
color $ui-favorite-star-button-color
&:hover
transition 0.15s
color $ui-favorite-star-button-color
background-color alpha($ui-dark-button--active-backgroundColor, 20%)

View File

@@ -1,9 +1,10 @@
.root .root
display inline-block display inline-block
user-select none user-select none
height 23px line-height 50px
height 50px
vertical-align middle vertical-align middle
width 300px width 100%
overflow-x scroll overflow-x scroll
white-space nowrap white-space nowrap
@@ -12,9 +13,7 @@
.tag .tag
display inline-block display inline-block
margin 1px 3px margin 0px 2px
padding 0
height 20px
background-color alpha($ui-tag-backgroundColor, 10%) background-color alpha($ui-tag-backgroundColor, 10%)
border-radius 3px border-radius 3px
overflow hidden overflow hidden

View File

@@ -1,5 +1,9 @@
.control-trashButton .control-trashButton
float right top 120px
topBarButtonLight()
.control-trashButton--in-trash
top 60px
topBarButtonLight() topBarButtonLight()
.trashButton .trashButton

View File

@@ -180,19 +180,21 @@ modal()
border-radius $modal-border-radius border-radius $modal-border-radius
topBarButtonLight() topBarButtonLight()
position absolute
width 34px width 34px
height 34px height 34px
border-radius 17px border-radius 17px
font-size 14px font-size 14px
margin 15px 7px
border none border none
color $ui-button-color color alpha($ui-button-color, 0.4)
fill $ui-button-color fill $ui-button-color
background-color transparent background-color transparent
&:active &:active
border-color $ui-button--active-backgroundColor border-color $ui-button--active-backgroundColor
&:hover &:hover
background-color alpha($ui-button--hover-backgroundColor, 60%) transform scale(1.1)
transition 0.4s
color $ui-button-color
.control-lockButton-tooltip .control-lockButton-tooltip
opacity 1 opacity 1
@@ -282,12 +284,10 @@ topBarButtonDark()
border-color $ui-dark-borderColor border-color $ui-dark-borderColor
color $ui-dark-topbar-button-color color $ui-dark-topbar-button-color
&:hover &:hover
background-color $dark-default-button-background--hover
color $ui-dark-tooltip-text-color color $ui-dark-tooltip-text-color
&:active &:active
border-color $ui-dark-button--focus-borderColor border-color $ui-dark-button--focus-borderColor
&:active:hover &:active:hover
background-color $ui-dark-button--active-backgroundColor
color $ui-dark-tooltip-text-color color $ui-dark-tooltip-text-color
&:focus &:focus
border-color $ui-button--focus-borderColor border-color $ui-button--focus-borderColor