1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

fix typo shareWith -> shareVia

This commit is contained in:
Rokt33r
2015-12-13 22:46:59 +09:00
parent 70fc0afbc4
commit 529c27aed5
2 changed files with 8 additions and 8 deletions

View File

@@ -32,8 +32,8 @@ export default class ShareButton extends React.Component {
this.dropdownClicked = true this.dropdownClicked = true
} }
ReactDOM.findDOMNode(this.refs.dropdown).addEventListener('click', this.dropdownInterceptor) ReactDOM.findDOMNode(this.refs.dropdown).addEventListener('click', this.dropdownInterceptor)
this.shareWithPublicURLHandler = e => { this.shareViaPublicURLHandler = e => {
this.handleShareWithPublicURLClick(e) this.handleShareViaPublicURLClick(e)
} }
} }
@@ -66,7 +66,7 @@ export default class ShareButton extends React.Component {
this.setState({openDropdown: false}) this.setState({openDropdown: false})
} }
handleShareWithPublicURLClick (e) { handleShareViaPublicURLClick (e) {
let { user } = this.props let { user } = this.props
let input = Object.assign({}, this.props.article, { let input = Object.assign({}, this.props.article, {
clientKey: clientKey.get(), clientKey: clientKey.get(),
@@ -76,7 +76,7 @@ export default class ShareButton extends React.Component {
isSharing: true, isSharing: true,
failed: false failed: false
}, () => { }, () => {
api.shareWithPublicURL(input) api.shareViaPublicURL(input)
.then(res => { .then(res => {
let url = res.body.url let url = res.body.url
this.setState({url: url, isSharing: false}) this.setState({url: url, isSharing: false})
@@ -115,10 +115,10 @@ export default class ShareButton extends React.Component {
{ {
!hasPublicURL ? ( !hasPublicURL ? (
<button <button
onClick={e => this.shareWithPublicURLHandler(e)} onClick={e => this.shareViaPublicURLHandler(e)}
ref='sharePublicURL' ref='sharePublicURL'
disabled={this.state.isSharing}> disabled={this.state.isSharing}>
<i className='fa fa-fw fa-external-link'/> {this.state.failed ? 'Failed : Click to Try again' : !this.state.isSharing ? 'Share with public URL' : 'Sharing...'} <i className='fa fa-fw fa-external-link'/> {this.state.failed ? 'Failed : Click to Try again' : !this.state.isSharing ? 'Share via public URL' : 'Sharing...'}
</button> </button>
) : ( ) : (
<div className='ShareButton-url'> <div className='ShareButton-url'>

View File

@@ -7,7 +7,7 @@ export const SERVER_URL = 'https://b00st.io/'
export const request = superagentPromise(superagent, Promise) export const request = superagentPromise(superagent, Promise)
export function shareWithPublicURL (input) { export function shareViaPublicURL (input) {
return request return request
.post(SERVER_URL + 'apis/share') .post(SERVER_URL + 'apis/share')
// .set({ // .set({
@@ -18,5 +18,5 @@ export function shareWithPublicURL (input) {
export default { export default {
SERVER_URL, SERVER_URL,
shareWithPublicURL shareViaPublicURL
} }