mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
made escButton ReactComponent
This commit is contained in:
18
browser/components/ModalEscButton.js
Normal file
18
browser/components/ModalEscButton.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import React, {PropTypes} from 'react'
|
||||||
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
|
import styles from './ModalEscButton.styl'
|
||||||
|
|
||||||
|
const ModalEscButton = ({
|
||||||
|
handleEscButtonClick
|
||||||
|
}) => (
|
||||||
|
<button styleName='escButton' onClick={handleEscButtonClick}>
|
||||||
|
<div styleName='esc-mark'>x</div>
|
||||||
|
<div styleName='esc-text'>esc</div>
|
||||||
|
</button>
|
||||||
|
)
|
||||||
|
|
||||||
|
ModalEscButton.propTypes = {
|
||||||
|
handleEscButtonClick: PropTypes.func.isRequired
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CSSModules(ModalEscButton, styles)
|
||||||
14
browser/components/ModalEscButton.styl
Normal file
14
browser/components/ModalEscButton.styl
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.escButton
|
||||||
|
height 50px
|
||||||
|
position absolute
|
||||||
|
background-color transparent
|
||||||
|
color $ui-inactive-text-color
|
||||||
|
border none
|
||||||
|
top 1px
|
||||||
|
right 10px
|
||||||
|
text-align center
|
||||||
|
width top-bar--height
|
||||||
|
height top-bar-height
|
||||||
|
|
||||||
|
.esc-mark
|
||||||
|
font-size 15px
|
||||||
@@ -4,6 +4,7 @@ import styles from './CreateFolderModal.styl'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import consts from 'browser/lib/consts'
|
import consts from 'browser/lib/consts'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
class CreateFolderModal extends React.Component {
|
class CreateFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -77,11 +78,7 @@ class CreateFolderModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Create new folder</div>
|
<div styleName='title'>Create new folder</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='close' onClick={(e) => this.handleCloseButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='close-mark'>×</div>
|
|
||||||
<div styleName='close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<div styleName='control-folder'>
|
<div styleName='control-folder'>
|
||||||
<div styleName='control-folder-label'>Folder name</div>
|
<div styleName='control-folder-label'>Folder name</div>
|
||||||
|
|||||||
@@ -15,21 +15,6 @@
|
|||||||
background-color $ui-backgroundColor
|
background-color $ui-backgroundColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.close-mark
|
|
||||||
font-size 15px
|
|
||||||
|
|
||||||
.close
|
|
||||||
height 70px
|
|
||||||
position absolute
|
|
||||||
background-color transparent
|
|
||||||
color $ui-inactive-text-color
|
|
||||||
border none
|
|
||||||
top 7px
|
|
||||||
right 30px
|
|
||||||
text-align center
|
|
||||||
width top-bar--height
|
|
||||||
height top-bar--height
|
|
||||||
|
|
||||||
.control-folder-label
|
.control-folder-label
|
||||||
text-align left
|
text-align left
|
||||||
font-size 12px
|
font-size 12px
|
||||||
@@ -85,12 +70,7 @@ body[data-theme="dark"]
|
|||||||
border 1px solid #C9C9C9 // TODO: use variable.
|
border 1px solid #C9C9C9 // TODO: use variable.
|
||||||
color white
|
color white
|
||||||
|
|
||||||
.closeButton
|
.description
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
color $ui-dark-text-color
|
|
||||||
colorDarkDefaultButton()
|
|
||||||
|
|
||||||
.description
|
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.control-confirmButton
|
.control-confirmButton
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import dataApi from 'browser/main/lib/dataApi'
|
|||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
const CSON = require('@rokt33r/season')
|
const CSON = require('@rokt33r/season')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
@@ -199,6 +200,7 @@ class InitModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='header-title'>Initialize Storage</div>
|
<div styleName='header-title'>Initialize Storage</div>
|
||||||
</div>
|
</div>
|
||||||
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='body'>
|
<div styleName='body'>
|
||||||
<div styleName='body-welcome'>
|
<div styleName='body-welcome'>
|
||||||
Welcome!
|
Welcome!
|
||||||
|
|||||||
@@ -22,15 +22,6 @@
|
|||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
position absolute
|
|
||||||
top 10px
|
|
||||||
right 10px
|
|
||||||
height 30px
|
|
||||||
padding 0 25px
|
|
||||||
color $ui-text-color
|
|
||||||
colorDefaultButton()
|
|
||||||
|
|
||||||
.body
|
.body
|
||||||
padding 30px
|
padding 30px
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import styles from './NewNoteModal.styl'
|
|||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import { hashHistory } from 'react-router'
|
import { hashHistory } from 'react-router'
|
||||||
import ee from 'browser/main/lib/eventEmitter'
|
import ee from 'browser/main/lib/eventEmitter'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
class NewNoteModal extends React.Component {
|
class NewNoteModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -102,11 +103,7 @@ class NewNoteModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Make a Note</div>
|
<div styleName='title'>Make a Note</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='closeButton' onClick={(e) => this.handleCloseButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
<div styleName='close-mark'>×</div>
|
|
||||||
<div styleName='close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<button styleName='control-button'
|
<button styleName='control-button'
|
||||||
onClick={(e) => this.handleMarkdownNoteButtonClick(e)}
|
onClick={(e) => this.handleMarkdownNoteButtonClick(e)}
|
||||||
|
|||||||
@@ -13,25 +13,10 @@
|
|||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
height 50px
|
|
||||||
position absolute
|
|
||||||
background-color transparent
|
|
||||||
color $ui-inactive-text-color
|
|
||||||
border none
|
|
||||||
top 1px
|
|
||||||
right 10px
|
|
||||||
text-align center
|
|
||||||
width top-bar--height
|
|
||||||
height top-bar--height
|
|
||||||
|
|
||||||
.control
|
.control
|
||||||
padding 25px 15px 15px
|
padding 25px 15px 15px
|
||||||
text-align center
|
text-align center
|
||||||
|
|
||||||
.close-mark
|
|
||||||
font-size 15px
|
|
||||||
|
|
||||||
.control-button
|
.control-button
|
||||||
width 220px
|
width 220px
|
||||||
height 220px
|
height 220px
|
||||||
|
|||||||
@@ -20,17 +20,6 @@ top-bar--height = 50px
|
|||||||
font-size 18px
|
font-size 18px
|
||||||
line-height top-bar--height
|
line-height top-bar--height
|
||||||
|
|
||||||
.top-bar-close
|
|
||||||
position absolute
|
|
||||||
background-color transparent
|
|
||||||
color $ui-inactive-text-color
|
|
||||||
border none
|
|
||||||
top 0
|
|
||||||
right 0
|
|
||||||
text-align center
|
|
||||||
width top-bar--height
|
|
||||||
height top-bar--height
|
|
||||||
|
|
||||||
.nav
|
.nav
|
||||||
absolute top left right
|
absolute top left right
|
||||||
top top-bar--height
|
top top-bar--height
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import HotkeyTab from './HotkeyTab'
|
|||||||
import UiTab from './UiTab'
|
import UiTab from './UiTab'
|
||||||
import InfoTab from './InfoTab'
|
import InfoTab from './InfoTab'
|
||||||
import StoragesTab from './StoragesTab'
|
import StoragesTab from './StoragesTab'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './PreferencesModal.styl'
|
import styles from './PreferencesModal.styl'
|
||||||
|
|
||||||
@@ -117,10 +118,7 @@ class Preferences extends React.Component {
|
|||||||
<div styleName='top-bar'>
|
<div styleName='top-bar'>
|
||||||
<p>Your menu for Boostnote</p>
|
<p>Your menu for Boostnote</p>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='top-bar-close' onClick={(e) => this.handleEscButtonClick(e)}>
|
<ModalEscButton handleEscButtonClick={(e) => this.handleEscButtonClick(e)} />
|
||||||
<div styleName='top-bar-close-mark'>×</div>
|
|
||||||
<div styleName='top-bar-close-text'>esc</div>
|
|
||||||
</button>
|
|
||||||
<div styleName='nav'>
|
<div styleName='nav'>
|
||||||
{navButtons}
|
{navButtons}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import CSSModules from 'browser/lib/CSSModules'
|
|||||||
import styles from './RenameFolderModal.styl'
|
import styles from './RenameFolderModal.styl'
|
||||||
import dataApi from 'browser/main/lib/dataApi'
|
import dataApi from 'browser/main/lib/dataApi'
|
||||||
import store from 'browser/main/store'
|
import store from 'browser/main/store'
|
||||||
|
import ModalEscButton from 'browser/components/ModalEscButton'
|
||||||
|
|
||||||
class RenameFolderModal extends React.Component {
|
class RenameFolderModal extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -72,9 +73,7 @@ class RenameFolderModal extends React.Component {
|
|||||||
<div styleName='header'>
|
<div styleName='header'>
|
||||||
<div styleName='title'>Rename Folder</div>
|
<div styleName='title'>Rename Folder</div>
|
||||||
</div>
|
</div>
|
||||||
<button styleName='closeButton'
|
<ModalEscButton handleEscButtonClick={(e) => this.handleCloseButtonClick(e)} />
|
||||||
onClick={(e) => this.handleCloseButtonClick(e)}
|
|
||||||
>Close</button>
|
|
||||||
|
|
||||||
<div styleName='control'>
|
<div styleName='control'>
|
||||||
<input styleName='control-input'
|
<input styleName='control-input'
|
||||||
|
|||||||
@@ -13,17 +13,6 @@
|
|||||||
border-bottom solid 1px $ui-borderColor
|
border-bottom solid 1px $ui-borderColor
|
||||||
color $ui-text-color
|
color $ui-text-color
|
||||||
|
|
||||||
.closeButton
|
|
||||||
position absolute
|
|
||||||
top 10px
|
|
||||||
right 10px
|
|
||||||
height 30px
|
|
||||||
width 0 25px
|
|
||||||
border $ui-border
|
|
||||||
border-radius 2px
|
|
||||||
color $ui-text-color
|
|
||||||
colorDefaultButton()
|
|
||||||
|
|
||||||
.control
|
.control
|
||||||
padding 25px 15px 15px
|
padding 25px 15px 15px
|
||||||
text-align center
|
text-align center
|
||||||
@@ -65,12 +54,7 @@ body[data-theme="dark"]
|
|||||||
border-color $ui-dark-borderColor
|
border-color $ui-dark-borderColor
|
||||||
color $ui-dark-text-color
|
color $ui-dark-text-color
|
||||||
|
|
||||||
.closeButton
|
.description
|
||||||
border-color $ui-dark-borderColor
|
|
||||||
color $ui-dark-text-color
|
|
||||||
colorDarkDefaultButton()
|
|
||||||
|
|
||||||
.description
|
|
||||||
color $ui-inactive-text-color
|
color $ui-inactive-text-color
|
||||||
|
|
||||||
.control-input
|
.control-input
|
||||||
|
|||||||
Reference in New Issue
Block a user