From 38dd85daab8e8342ec608d24cf81254c0dfde95c Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 20 Nov 2016 19:39:18 +0100 Subject: Adding notifications column --- .../features/followers/components/account.jsx | 99 ---------------------- .../followers/containers/account_container.jsx | 30 ------- .../components/features/followers/index.jsx | 2 +- 3 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 app/assets/javascripts/components/features/followers/components/account.jsx delete mode 100644 app/assets/javascripts/components/features/followers/containers/account_container.jsx (limited to 'app/assets/javascripts/components/features/followers') diff --git a/app/assets/javascripts/components/features/followers/components/account.jsx b/app/assets/javascripts/components/features/followers/components/account.jsx deleted file mode 100644 index 4a1fca6da..000000000 --- a/app/assets/javascripts/components/features/followers/components/account.jsx +++ /dev/null @@ -1,99 +0,0 @@ -import PureRenderMixin from 'react-addons-pure-render-mixin'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import Avatar from '../../../components/avatar'; -import DisplayName from '../../../components/display_name'; -import { Link } from 'react-router'; -import IconButton from '../../../components/icon_button'; -import { defineMessages, injectIntl } from 'react-intl'; - -const messages = defineMessages({ - follow: { id: 'account.follow', defaultMessage: 'Follow' } -}); - -const outerStyle = { - padding: '10px', - borderBottom: '1px solid #363c4b' -}; - -const itemStyle = { - flex: '1 1 auto', - display: 'block', - color: '#9baec8', - overflow: 'hidden', - textDecoration: 'none', - fontSize: '14px' -}; - -const noteStyle = { - paddingTop: '5px', - fontSize: '12px', - color: '#616b86' -}; - -const buttonsStyle = { - padding: '10px' -}; - -const Account = React.createClass({ - - propTypes: { - account: ImmutablePropTypes.map.isRequired, - me: React.PropTypes.number.isRequired, - onFollow: React.PropTypes.func.isRequired, - withNote: React.PropTypes.bool - }, - - getDefaultProps () { - return { - withNote: true - }; - }, - - mixins: [PureRenderMixin], - - handleFollow () { - this.props.onFollow(this.props.account); - }, - - render () { - const { account, me, withNote, intl } = this.props; - - if (!account) { - return
; - } - - let note, buttons; - - if (account.get('note').length > 0 && withNote) { - note =
{account.get('note')}
; - } - - if (account.get('id') !== me) { - const following = account.getIn(['relationship', 'following']); - - buttons = ( -
- -
- ); - } - - return ( -
-
- -
- - - - {buttons} -
- - {note} -
- ); - } - -}); - -export default injectIntl(Account); diff --git a/app/assets/javascripts/components/features/followers/containers/account_container.jsx b/app/assets/javascripts/components/features/followers/containers/account_container.jsx deleted file mode 100644 index c5d5c5881..000000000 --- a/app/assets/javascripts/components/features/followers/containers/account_container.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import { connect } from 'react-redux'; -import { makeGetAccount } from '../../../selectors'; -import Account from '../components/account'; -import { - followAccount, - unfollowAccount -} from '../../../actions/accounts'; - -const makeMapStateToProps = () => { - const getAccount = makeGetAccount(); - - const mapStateToProps = (state, props) => ({ - account: getAccount(state, props.id), - me: state.getIn(['meta', 'me']) - }); - - return mapStateToProps; -}; - -const mapDispatchToProps = (dispatch) => ({ - onFollow (account) { - if (account.getIn(['relationship', 'following'])) { - dispatch(unfollowAccount(account.get('id'))); - } else { - dispatch(followAccount(account.get('id'))); - } - } -}); - -export default connect(makeMapStateToProps, mapDispatchToProps)(Account); diff --git a/app/assets/javascripts/components/features/followers/index.jsx b/app/assets/javascripts/components/features/followers/index.jsx index 13eed69ca..38755d862 100644 --- a/app/assets/javascripts/components/features/followers/index.jsx +++ b/app/assets/javascripts/components/features/followers/index.jsx @@ -7,7 +7,7 @@ import { expandFollowers } from '../../actions/accounts'; import { ScrollContainer } from 'react-router-scroll'; -import AccountContainer from './containers/account_container'; +import AccountContainer from '../../containers/account_container'; const mapStateToProps = (state, props) => ({ accountIds: state.getIn(['user_lists', 'followers', Number(props.params.accountId), 'items']) -- cgit