remove SubscribeButton and 3rd party deps

This commit is contained in:
schabluk 2016-08-01 19:57:40 +02:00
parent 3c640c9f82
commit 0aa7bc4b11
3 changed files with 2 additions and 47 deletions

View file

@ -1,40 +0,0 @@
import React, { PropTypes, Component } from 'react';
import { intlShape } from 'react-intl';
import Subscribe from './Subscribe.jsx';
class SubscribeButton extends Subscribe {
render() {
const post = this.props.post;
const user = this.context.currentUser;
// can't subscribe to own post (also validated on server side)
if(user && post.author === user.username) {
return null;
}
let btnStyle = "default";
let btnTitle = "posts.subscribe";
let btnIcon = "eye";
let isSubscribed = this.isSubscribed(post, user);
if( isSubscribed ) {
btnStyle = "info";
btnTitle = "posts.unsubscribe";
btnIcon = "eye-slash";
}
return (
<button type="button" title={this.context.intl.formatMessage({id: btnTitle})}
className={`btn btn-${btnStyle} btn-sm`}
style={{padding: '.5rem', lineHeight: 1, borderRadius: '50%', marginLeft: '.5rem'}}
onClick={this.onSubscribe} >
<i className={`fa fa-${btnIcon}`}></i>
</button>
)
}
}
module.exports = SubscribeButton;
export default SubscribeButton;

View file

@ -1,10 +1,8 @@
import {subscribeItem, unsubscribeItem} from './methods.js';
import Subscribe from './components/Subscribe.jsx';
import SubscribeButton from './components/SubscribeButton.jsx';
export {
subscribeItem,
unsubscribeItem,
Subscribe,
SubscribeButton
Subscribe
}

View file

@ -17,10 +17,7 @@ Package.onUse(function (api) {
api.use([
'nova:core@0.26.5-nova',
'nova:posts@0.26.5-nova',
'nova:users@0.26.5-nova',
// 3rd party
'fortawesome:fontawesome@4.5.0'
'nova:users@0.26.5-nova'
]);
// api.use([