Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Componentnize NewNoteButton#800

Merged
asmsuechan merged 9 commits into
BoostIO:masterfrom
asmsuechan:componentnize-NewNoteButton
Aug 14, 2017
Merged

Componentnize NewNoteButton#800
asmsuechan merged 9 commits into
BoostIO:masterfrom
asmsuechan:componentnize-NewNoteButton

Conversation

@asmsuechan

@asmsuechan asmsuechan commented Aug 13, 2017

Copy link
Copy Markdown
Contributor

context

Separation NewNoteButton from TopBar.

before

image

image

before(Trash)

8fb0f4979a82c703b4c74d14d61a1e6e

after

I hope the layout isn't changed.
image

image

after(Trash)

image

for tests

  • open modal
  • create Markdown note
  • create Snippet note
  • show tooltip (and the content is correct on Mac or others)
  • open modal (first-time Boostntoe launched)
  • cannot be shown this in trash
  • shown properly on dark theme and light theme
  • shown properly even the width of the list is changed

note

I just move the code, so I'll have to refactor them.

memo: delete DeleteArticleModal

Make sure whether all props are passed properly.

@BoostnoteBot

Copy link
Copy Markdown
Collaborator

Please make sure to be pasted screenshots of all your changes.


// Find first storage
if (storage == null) {
for (let kv of data.storageMap) {

@asmsuechan asmsuechan Aug 13, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to seek better way: for

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I know this if condition is not good, but I don't know what exactly it is. So I choose a way not to change them.

Comment thread browser/main/NewNoteButton/index.js Outdated
break
}
}
if (storage == null) window.alert('No storage to create a note')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to seek better way: window.alert

Comment thread browser/main/NewNoteButton/index.js Outdated

createNote (noteType) {
let { dispatch, location } = this.props
if (noteType !== 'MARKDOWN_NOTE' && noteType !== 'SNIPPET_NOTE') throw new Error('Invalid note type.')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this really needed?

Comment thread browser/main/NewNoteButton/index.js Outdated

let { storage, folder } = this.resolveTargetFolder()

let newNote = noteType === 'MARKDOWN_NOTE'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I want to seek better way

Comment thread browser/main/NewNoteButton/index.js Outdated
})
}

setDefaultNote (defaultNote) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is this really used?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It was used in the old version, but not used now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Understood.

height $topBar-height - 1
margin-left: auto;
width: 64px;
margin-right: -15px;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added these three lines for this change.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

return
}

switch (config.ui.defaultNote) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted because defaultNote is not configurable in Preferences now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

}
}

createNote (noteType) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted accompanied with handleNewPostButtonClick()

})
}

setDefaultNote (defaultNote) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted because it's no longer used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@@ -1,51 +0,0 @@
import React, { PropTypes } from 'react'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Deleted because this file is no longer used.

Comment thread browser/main/NewNoteButton/index.js Outdated

render () {
const { config, style, data, location } = this.props
if (location.pathname === '/trashed') {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed a specification.

before

NewNoteButton was shown in Trash but a warning appeared when a user clicked this.

after

NewNoteButton is no longer shown in Trash.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great🎉

@asmsuechan asmsuechan changed the title [WIP] Componentnize NewNoteButton Aug 14, 2017
@asmsuechan

Copy link
Copy Markdown
Contributor Author

The layout is a bit strange.
image

@asmsuechan asmsuechan merged commit f2a03e4 into BoostIO:master Aug 14, 2017
@asmsuechan asmsuechan deleted the componentnize-NewNoteButton branch August 14, 2017 02:45
@kazup01 kazup01 mentioned this pull request Sep 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants