Skip to content

Commit 1fea39f

Browse files
committed
modify: add esc button for config modal
1 parent ae97ff0 commit 1fea39f

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

browser/main/modals/PreferencesModal/PreferencesModal.styl

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
@import('./Tab')
22

3+
top-bar--height = 50px
4+
35
.root
46
modal()
57
max-width 800px
@@ -10,17 +12,27 @@
1012

1113
.top-bar
1214
absolute top left right
13-
height 50px
15+
height top-bar--height
1416
background-color $ui-backgroundColor
1517
border-bottom solid 1px $ui-borderColor
1618
p
1719
text-align center
1820
font-size 18px
19-
line-height 50px
21+
line-height top-bar--height
22+
23+
.top-bar-close
24+
position absolute
25+
background-color transparent
26+
border none
27+
top 0
28+
right 0
29+
text-align center
30+
width top-bar--height
31+
height top-bar--height
2032

2133
.nav
2234
absolute top left right
23-
top 50px
35+
top top-bar--height
2436
left 0
2537
width 140px
2638
margin-left 30px
@@ -54,7 +66,7 @@
5466

5567
.content
5668
absolute left right bottom
57-
top 50px
69+
top top-bar--height
5870
left 140px
5971
margin-top 10px
6072
overflow-y auto

browser/main/modals/PreferencesModal/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ class Preferences extends React.Component {
3333
}
3434
}
3535

36+
handleEscButtonClick () {
37+
this.props.close()
38+
}
39+
3640
renderContent () {
3741
const { boundingBox } = this.state
3842
let { dispatch, config, data } = this.props
@@ -113,6 +117,10 @@ class Preferences extends React.Component {
113117
<div styleName='top-bar'>
114118
<p>Your menu for Boostnote</p>
115119
</div>
120+
<button styleName='top-bar-close' onClick={(e) => this.handleEscButtonClick(e)}>
121+
<div styleName='top-bar-close-mark'>X</div>
122+
<div styleName='top-bar-close-text'>esc</div>
123+
</button>
116124
<div styleName='nav'>
117125
{navButtons}
118126
</div>

0 commit comments

Comments
 (0)