);
}
+
}
export default injectIntl(connect(null, mapDispatchToProps)(ActionBar));
diff --git a/app/gabsocial/features/compose/components/compose_form.js b/app/gabsocial/features/compose/components/compose_form.js
index d96f5e3f1..9be69ceb3 100644
--- a/app/gabsocial/features/compose/components/compose_form.js
+++ b/app/gabsocial/features/compose/components/compose_form.js
@@ -26,7 +26,7 @@ import Icon from 'gabsocial/components/icon';
const allowedAroundShortCode = '><\u0085\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\u0009\u000a\u000b\u000c\u000d';
const messages = defineMessages({
- placeholder: { id: 'compose_form.placeholder', defaultMessage: "What's on your mind?" },
+ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What\'s on your mind?' },
spoiler_placeholder: { id: 'compose_form.spoiler_placeholder', defaultMessage: 'Write your warning here' },
publish: { id: 'compose_form.publish', defaultMessage: 'Publish' },
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
@@ -151,11 +151,11 @@ class ComposeForm extends ImmutablePureComponent {
}
componentDidMount() {
- document.addEventListener("click", this.handleClick, false);
+ document.addEventListener('click', this.handleClick, false);
}
componentWillUnmount() {
- document.removeEventListener("click", this.handleClick, false);
+ document.removeEventListener('click', this.handleClick, false);
}
componentDidUpdate (prevProps) {
@@ -211,7 +211,7 @@ class ComposeForm extends ImmutablePureComponent {
const disabled = this.props.isSubmitting;
const text = [this.props.spoilerText, countableText(this.props.text)].join('');
const disabledButton = disabled || this.props.isUploading || this.props.isChangingUpload || length(text) > maxTootChars || (text.length !== 0 && text.trim().length === 0 && !anyMedia);
- const shouldAutoFocus = autoFocus && !showSearch && !isMobile(window.innerWidth)
+ const shouldAutoFocus = autoFocus && !showSearch && !isMobile(window.innerWidth);
let publishText = '';
@@ -224,7 +224,7 @@ class ComposeForm extends ImmutablePureComponent {
const composeClassNames = classNames({
'compose-form': true,
'condensed': condensed,
- })
+ });
return (
diff --git a/app/gabsocial/features/compose/containers/compose_form_container.js b/app/gabsocial/features/compose/containers/compose_form_container.js
index c7c5618db..cc0beba81 100644
--- a/app/gabsocial/features/compose/containers/compose_form_container.js
+++ b/app/gabsocial/features/compose/containers/compose_form_container.js
@@ -67,8 +67,8 @@ const mapDispatchToProps = (dispatch) => ({
function mergeProps(stateProps, dispatchProps, ownProps) {
return Object.assign({}, ownProps, {
...stateProps,
- ...dispatchProps
- })
+ ...dispatchProps,
+ });
}
export default connect(mapStateToProps, mapDispatchToProps, mergeProps)(ComposeForm);
diff --git a/app/gabsocial/features/compose/containers/warning_container.js b/app/gabsocial/features/compose/containers/warning_container.js
index ae0e3ef30..1fee601ef 100644
--- a/app/gabsocial/features/compose/containers/warning_container.js
+++ b/app/gabsocial/features/compose/containers/warning_container.js
@@ -12,7 +12,7 @@ const mapStateToProps = state => {
needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']),
hashtagWarning: state.getIn(['compose', 'privacy']) !== 'public' && APPROX_HASHTAG_RE.test(state.getIn(['compose', 'text'])),
directMessageWarning: state.getIn(['compose', 'privacy']) === 'direct',
- }
+ };
};
const WarningWrapper = ({ needsLockWarning, hashtagWarning, directMessageWarning }) => {
diff --git a/app/gabsocial/features/followers/index.js b/app/gabsocial/features/followers/index.js
index 9b04cf001..d0d018dcf 100644
--- a/app/gabsocial/features/followers/index.js
+++ b/app/gabsocial/features/followers/index.js
@@ -26,8 +26,7 @@ const mapStateToProps = (state, { params: { username }, withReplies = false }) =
let accountUsername = username;
if (accountFetchError) {
accountId = null;
- }
- else {
+ } else {
let account = accounts.find(acct => username.toLowerCase() == acct.getIn(['acct'], '').toLowerCase());
accountId = account ? account.getIn(['id'], null) : -1;
}
@@ -64,8 +63,7 @@ class Followers extends ImmutablePureComponent {
if (accountId && accountId !== -1) {
this.props.dispatch(fetchAccount(accountId));
this.props.dispatch(fetchFollowers(accountId));
- }
- else {
+ } else {
this.props.dispatch(fetchAccountByUsername(username));
}
}
diff --git a/app/gabsocial/features/following/index.js b/app/gabsocial/features/following/index.js
index cf8aa4c3d..af15b03f6 100644
--- a/app/gabsocial/features/following/index.js
+++ b/app/gabsocial/features/following/index.js
@@ -26,8 +26,7 @@ const mapStateToProps = (state, { params: { username }, withReplies = false }) =
let accountId = -1;
if (accountFetchError) {
accountId = null;
- }
- else {
+ } else {
let account = accounts.find(acct => username.toLowerCase() == acct.getIn(['acct'], '').toLowerCase());
accountId = account ? account.getIn(['id'], null) : -1;
}
@@ -64,8 +63,7 @@ class Following extends ImmutablePureComponent {
if (accountId && accountId !== -1) {
this.props.dispatch(fetchAccount(accountId));
this.props.dispatch(fetchFollowing(accountId));
- }
- else {
+ } else {
this.props.dispatch(fetchAccountByUsername(username));
}
}
diff --git a/app/gabsocial/features/getting_started/index.js b/app/gabsocial/features/getting_started/index.js
index 36a7fe196..034154b5b 100644
--- a/app/gabsocial/features/getting_started/index.js
+++ b/app/gabsocial/features/getting_started/index.js
@@ -39,7 +39,7 @@ const mapStateToProps = state => {
return {
myAccount: state.getIn(['accounts', me]),
unreadFollowRequests: state.getIn(['user_lists', 'follow_requests', 'items'], ImmutableList()).size,
- }
+ };
};
const mapDispatchToProps = dispatch => ({
diff --git a/app/gabsocial/features/groups/create/index.js b/app/gabsocial/features/groups/create/index.js
index eb8606a75..3353d43e5 100644
--- a/app/gabsocial/features/groups/create/index.js
+++ b/app/gabsocial/features/groups/create/index.js
@@ -7,26 +7,26 @@ import { defineMessages, injectIntl } from 'react-intl';
import classNames from 'classnames';
const messages = defineMessages({
- title: { id: 'groups.form.title', defaultMessage: 'Enter a new group title' },
- description: { id: 'groups.form.description', defaultMessage: 'Enter the group description' },
- coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload a banner image' },
- coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' },
- create: { id: 'groups.form.create', defaultMessage: 'Create group' },
+ title: { id: 'groups.form.title', defaultMessage: 'Enter a new group title' },
+ description: { id: 'groups.form.description', defaultMessage: 'Enter the group description' },
+ coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload a banner image' },
+ coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' },
+ create: { id: 'groups.form.create', defaultMessage: 'Create group' },
});
const mapStateToProps = state => ({
- title: state.getIn(['group_editor', 'title']),
- description: state.getIn(['group_editor', 'description']),
- coverImage: state.getIn(['group_editor', 'coverImage']),
- disabled: state.getIn(['group_editor', 'isSubmitting']),
+ title: state.getIn(['group_editor', 'title']),
+ description: state.getIn(['group_editor', 'description']),
+ coverImage: state.getIn(['group_editor', 'coverImage']),
+ disabled: state.getIn(['group_editor', 'isSubmitting']),
});
const mapDispatchToProps = dispatch => ({
- onTitleChange: value => dispatch(changeValue('title', value)),
- onDescriptionChange: value => dispatch(changeValue('description', value)),
- onCoverImageChange: value => dispatch(changeValue('coverImage', value)),
- onSubmit: routerHistory => dispatch(submit(routerHistory)),
- reset: () => dispatch(reset()),
+ onTitleChange: value => dispatch(changeValue('title', value)),
+ onDescriptionChange: value => dispatch(changeValue('description', value)),
+ onCoverImageChange: value => dispatch(changeValue('coverImage', value)),
+ onSubmit: routerHistory => dispatch(submit(routerHistory)),
+ reset: () => dispatch(reset()),
});
export default @connect(mapStateToProps, mapDispatchToProps)
@@ -34,80 +34,80 @@ export default @connect(mapStateToProps, mapDispatchToProps)
class Create extends React.PureComponent {
static contextTypes = {
- router: PropTypes.object
+ router: PropTypes.object,
}
static propTypes = {
- title: PropTypes.string.isRequired,
- description: PropTypes.string.isRequired,
- coverImage: PropTypes.object,
- disabled: PropTypes.bool,
- intl: PropTypes.object.isRequired,
- onTitleChange: PropTypes.func.isRequired,
- onSubmit: PropTypes.func.isRequired,
+ title: PropTypes.string.isRequired,
+ description: PropTypes.string.isRequired,
+ coverImage: PropTypes.object,
+ disabled: PropTypes.bool,
+ intl: PropTypes.object.isRequired,
+ onTitleChange: PropTypes.func.isRequired,
+ onSubmit: PropTypes.func.isRequired,
};
componentWillMount() {
- this.props.reset();
+ this.props.reset();
}
handleTitleChange = e => {
- this.props.onTitleChange(e.target.value);
+ this.props.onTitleChange(e.target.value);
}
handleDescriptionChange = e => {
- this.props.onDescriptionChange(e.target.value);
+ this.props.onDescriptionChange(e.target.value);
}
handleCoverImageChange = e => {
- this.props.onCoverImageChange(e.target.files[0]);
+ this.props.onCoverImageChange(e.target.files[0]);
}
handleSubmit = e => {
- e.preventDefault();
- this.props.onSubmit(this.context.router.history);
+ e.preventDefault();
+ this.props.onSubmit(this.context.router.history);
}
render () {
- const { title, description, coverImage, disabled, intl } = this.props;
+ const { title, description, coverImage, disabled, intl } = this.props;
- return (
-
- );
+ return (
+
+ );
}
}
diff --git a/app/gabsocial/features/groups/edit/index.js b/app/gabsocial/features/groups/edit/index.js
index 3334f52df..0c93bee75 100644
--- a/app/gabsocial/features/groups/edit/index.js
+++ b/app/gabsocial/features/groups/edit/index.js
@@ -10,27 +10,27 @@ import Column from '../../../components/column';
import classNames from 'classnames';
const messages = defineMessages({
- title: { id: 'groups.form.title', defaultMessage: 'Title' },
- description: { id: 'groups.form.description', defaultMessage: 'Description' },
- coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload new banner image (optional)' },
- coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' },
- update: { id: 'groups.form.update', defaultMessage: 'Update group' },
+ title: { id: 'groups.form.title', defaultMessage: 'Title' },
+ description: { id: 'groups.form.description', defaultMessage: 'Description' },
+ coverImage: { id: 'groups.form.coverImage', defaultMessage: 'Upload new banner image (optional)' },
+ coverImageChange: { id: 'groups.form.coverImageChange', defaultMessage: 'Banner image selected' },
+ update: { id: 'groups.form.update', defaultMessage: 'Update group' },
});
const mapStateToProps = (state, props) => ({
- group: state.getIn(['groups', props.params.id]),
- title: state.getIn(['group_editor', 'title']),
- description: state.getIn(['group_editor', 'description']),
- coverImage: state.getIn(['group_editor', 'coverImage']),
- disabled: state.getIn(['group_editor', 'isSubmitting']),
+ group: state.getIn(['groups', props.params.id]),
+ title: state.getIn(['group_editor', 'title']),
+ description: state.getIn(['group_editor', 'description']),
+ coverImage: state.getIn(['group_editor', 'coverImage']),
+ disabled: state.getIn(['group_editor', 'isSubmitting']),
});
const mapDispatchToProps = dispatch => ({
- onTitleChange: value => dispatch(changeValue('title', value)),
- onDescriptionChange: value => dispatch(changeValue('description', value)),
- onCoverImageChange: value => dispatch(changeValue('coverImage', value)),
- onSubmit: routerHistory => dispatch(submit(routerHistory)),
- setUp: group => dispatch(setUp(group)),
+ onTitleChange: value => dispatch(changeValue('title', value)),
+ onDescriptionChange: value => dispatch(changeValue('description', value)),
+ onCoverImageChange: value => dispatch(changeValue('coverImage', value)),
+ onSubmit: routerHistory => dispatch(submit(routerHistory)),
+ setUp: group => dispatch(setUp(group)),
});
export default @connect(mapStateToProps, mapDispatchToProps)
@@ -38,111 +38,111 @@ export default @connect(mapStateToProps, mapDispatchToProps)
class Edit extends React.PureComponent {
static contextTypes = {
- router: PropTypes.object
+ router: PropTypes.object,
}
static propTypes = {
- group: ImmutablePropTypes.map,
- title: PropTypes.string.isRequired,
- description: PropTypes.string.isRequired,
- coverImage: PropTypes.object,
- disabled: PropTypes.bool,
- intl: PropTypes.object.isRequired,
- onTitleChange: PropTypes.func.isRequired,
- onSubmit: PropTypes.func.isRequired,
+ group: ImmutablePropTypes.map,
+ title: PropTypes.string.isRequired,
+ description: PropTypes.string.isRequired,
+ coverImage: PropTypes.object,
+ disabled: PropTypes.bool,
+ intl: PropTypes.object.isRequired,
+ onTitleChange: PropTypes.func.isRequired,
+ onSubmit: PropTypes.func.isRequired,
};
- componentWillMount(nextProps) {
- if (this.props.group) {
- this.props.setUp(this.props.group);
- }
+ componentWillMount(nextProps) {
+ if (this.props.group) {
+ this.props.setUp(this.props.group);
+ }
}
-
+
componentWillReceiveProps(nextProps) {
- if (!this.props.group && nextProps.group) {
- this.props.setUp(nextProps.group);
- }
+ if (!this.props.group && nextProps.group) {
+ this.props.setUp(nextProps.group);
+ }
}
handleTitleChange = e => {
- this.props.onTitleChange(e.target.value);
+ this.props.onTitleChange(e.target.value);
}
handleDescriptionChange = e => {
- this.props.onDescriptionChange(e.target.value);
+ this.props.onDescriptionChange(e.target.value);
}
handleCoverImageChange = e => {
- this.props.onCoverImageChange(e.target.files[0]);
+ this.props.onCoverImageChange(e.target.files[0]);
}
handleSubmit = e => {
- e.preventDefault();
- this.props.onSubmit(this.context.router.history);
+ e.preventDefault();
+ this.props.onSubmit(this.context.router.history);
}
handleClick = () => {
- this.props.onSubmit(this.context.router.history);
+ this.props.onSubmit(this.context.router.history);
}
render () {
- const { group, title, description, coverImage, disabled, intl } = this.props;
-
- if (typeof group === 'undefined') {
- return (
-
-
-
- );
- } else if (group === false) {
- return (
-
-
-
- );
- }
+ const { group, title, description, coverImage, disabled, intl } = this.props;
- return (
-
- );
+
+
+
+
+
+
+
+
+
+
+
+
+ );
}
}
diff --git a/app/gabsocial/features/groups/index/card.js b/app/gabsocial/features/groups/index/card.js
index 82a52a166..3c6a81aa5 100644
--- a/app/gabsocial/features/groups/index/card.js
+++ b/app/gabsocial/features/groups/index/card.js
@@ -7,48 +7,50 @@ import { shortNumberFormat } from '../../../utils/numbers';
import { connect } from 'react-redux';
const messages = defineMessages({
- members: { id: 'groups.card.members', defaultMessage: 'Members' },
- view: { id: 'groups.card.view', defaultMessage: 'View' },
- join: { id: 'groups.card.join', defaultMessage: 'Join' },
- role_member: { id: 'groups.card.roles.member', defaultMessage: 'You\'re a member' },
- role_admin: { id: 'groups.card.roles.admin', defaultMessage: 'You\'re an admin' },
+ members: { id: 'groups.card.members', defaultMessage: 'Members' },
+ view: { id: 'groups.card.view', defaultMessage: 'View' },
+ join: { id: 'groups.card.join', defaultMessage: 'Join' },
+ role_member: { id: 'groups.card.roles.member', defaultMessage: 'You\'re a member' },
+ role_admin: { id: 'groups.card.roles.admin', defaultMessage: 'You\'re an admin' },
});
const mapStateToProps = (state, { id }) => ({
- group: state.getIn(['groups', id]),
- relationships: state.getIn(['group_relationships', id]),
+ group: state.getIn(['groups', id]),
+ relationships: state.getIn(['group_relationships', id]),
});
export default @connect(mapStateToProps)
@injectIntl
class GroupCard extends ImmutablePureComponent {
+
static propTypes = {
- group: ImmutablePropTypes.map,
- relationships: ImmutablePropTypes.map,
+ group: ImmutablePropTypes.map,
+ relationships: ImmutablePropTypes.map,
}
getRole() {
- const { intl, relationships } = this.props;
+ const { intl, relationships } = this.props;
- if (!relationships) return null;
- if (relationships.get('admin')) return intl.formatMessage(messages.role_admin);
- if (relationships.get('member')) return intl.formatMessage(messages.role_member);
+ if (!relationships) return null;
+ if (relationships.get('admin')) return intl.formatMessage(messages.role_admin);
+ if (relationships.get('member')) return intl.formatMessage(messages.role_member);
}
render() {
- const { intl, group } = this.props;
- const coverImageUrl = group.get('cover_image_url');
- const role = this.getRole();
+ const { intl, group } = this.props;
+ const coverImageUrl = group.get('cover_image_url');
+ const role = this.getRole();
- return (
-
-
{coverImageUrl &&

}
-
-
{group.get('title')}
-
{shortNumberFormat(group.get('member_count'))} {intl.formatMessage(messages.members)}{role && · {role}}
-
{group.get('description')}
-
-
- );
+ return (
+
+
{coverImageUrl &&

}
+
+
{group.get('title')}
+
{shortNumberFormat(group.get('member_count'))} {intl.formatMessage(messages.members)}{role && · {role}}
+
{group.get('description')}
+
+
+ );
}
+
}
\ No newline at end of file
diff --git a/app/gabsocial/features/groups/index/index.js b/app/gabsocial/features/groups/index/index.js
index 4b4881416..a1c6bd877 100644
--- a/app/gabsocial/features/groups/index/index.js
+++ b/app/gabsocial/features/groups/index/index.js
@@ -11,79 +11,81 @@ import GroupCard from './card';
import GroupCreate from '../create';
const messages = defineMessages({
- heading: { id: 'column.groups', defaultMessage: 'Groups' },
- create: { id: 'groups.create', defaultMessage: 'Create group' },
- tab_featured: { id: 'groups.tab_featured', defaultMessage: 'Featured' },
- tab_member: { id: 'groups.tab_member', defaultMessage: 'Member' },
- tab_admin: { id: 'groups.tab_admin', defaultMessage: 'Manage' },
+ heading: { id: 'column.groups', defaultMessage: 'Groups' },
+ create: { id: 'groups.create', defaultMessage: 'Create group' },
+ tab_featured: { id: 'groups.tab_featured', defaultMessage: 'Featured' },
+ tab_member: { id: 'groups.tab_member', defaultMessage: 'Member' },
+ tab_admin: { id: 'groups.tab_admin', defaultMessage: 'Manage' },
});
const mapStateToProps = (state, { activeTab }) => ({
- groupIds: state.getIn(['group_lists', activeTab]),
+ groupIds: state.getIn(['group_lists', activeTab]),
});
export default @connect(mapStateToProps)
@injectIntl
class Groups extends ImmutablePureComponent {
+
static propTypes = {
- params: PropTypes.object.isRequired,
- activeTab: PropTypes.string.isRequired,
- showCreateForm: PropTypes.bool,
- dispatch: PropTypes.func.isRequired,
- groups: ImmutablePropTypes.map,
- groupIds: ImmutablePropTypes.list,
- intl: PropTypes.object.isRequired,
+ params: PropTypes.object.isRequired,
+ activeTab: PropTypes.string.isRequired,
+ showCreateForm: PropTypes.bool,
+ dispatch: PropTypes.func.isRequired,
+ groups: ImmutablePropTypes.map,
+ groupIds: ImmutablePropTypes.list,
+ intl: PropTypes.object.isRequired,
};
componentWillMount () {
- this.props.dispatch(fetchGroups(this.props.activeTab));
+ this.props.dispatch(fetchGroups(this.props.activeTab));
}
componentDidUpdate(oldProps) {
- if (this.props.activeTab && this.props.activeTab !== oldProps.activeTab) {
- this.props.dispatch(fetchGroups(this.props.activeTab));
- }
+ if (this.props.activeTab && this.props.activeTab !== oldProps.activeTab) {
+ this.props.dispatch(fetchGroups(this.props.activeTab));
+ }
}
renderHeader() {
- const { intl, activeTab } = this.props;
+ const { intl, activeTab } = this.props;
- return (
-
-
{intl.formatMessage(messages.create)}
-
{intl.formatMessage(messages.heading)}
+ return (
+
+
{intl.formatMessage(messages.create)}
+
{intl.formatMessage(messages.heading)}
-
-
-
- {intl.formatMessage(messages.tab_featured)}
-
+
+
+
+ {intl.formatMessage(messages.tab_featured)}
+
-
- {intl.formatMessage(messages.tab_member)}
-
+
+ {intl.formatMessage(messages.tab_member)}
+
-
- {intl.formatMessage(messages.tab_admin)}
-
-
-
-
- );
+
+ {intl.formatMessage(messages.tab_admin)}
+
+
+
+
+ );
}
render () {
- const { groupIds, showCreateForm } = this.props;
+ const { groupIds, showCreateForm } = this.props;
- return (
-
- {!showCreateForm && this.renderHeader()}
- {showCreateForm &&
}
+ return (
+
+ {!showCreateForm && this.renderHeader()}
+ {showCreateForm &&
}
-
- {groupIds.map(id => )}
-
-
- );
+
+ {groupIds.map(id => )}
+
+
+ );
}
+
}
\ No newline at end of file
diff --git a/app/gabsocial/features/groups/members/index.js b/app/gabsocial/features/groups/members/index.js
index ed396d4f7..311495328 100644
--- a/app/gabsocial/features/groups/members/index.js
+++ b/app/gabsocial/features/groups/members/index.js
@@ -6,8 +6,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { debounce } from 'lodash';
import LoadingIndicator from '../../../components/loading_indicator';
import {
- fetchMembers,
- expandMembers,
+ fetchMembers,
+ expandMembers,
} from '../../../actions/groups';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../../containers/account_container';
@@ -15,59 +15,60 @@ import Column from '../../ui/components/column';
import ScrollableList from '../../../components/scrollable_list';
const mapStateToProps = (state, { params: { id } }) => ({
- group: state.getIn(['groups', id]),
- accountIds: state.getIn(['user_lists', 'groups', id, 'items']),
- hasMore: !!state.getIn(['user_lists', 'groups', id, 'next']),
+ group: state.getIn(['groups', id]),
+ accountIds: state.getIn(['user_lists', 'groups', id, 'items']),
+ hasMore: !!state.getIn(['user_lists', 'groups', id, 'next']),
});
export default @connect(mapStateToProps)
class GroupMembers extends ImmutablePureComponent {
static propTypes = {
- params: PropTypes.object.isRequired,
- dispatch: PropTypes.func.isRequired,
- accountIds: ImmutablePropTypes.list,
- hasMore: PropTypes.bool,
+ params: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ accountIds: ImmutablePropTypes.list,
+ hasMore: PropTypes.bool,
};
componentWillMount () {
- const { params: { id } } = this.props;
+ const { params: { id } } = this.props;
- this.props.dispatch(fetchMembers(id));
+ this.props.dispatch(fetchMembers(id));
}
componentWillReceiveProps (nextProps) {
- if (nextProps.params.id !== this.props.params.id) {
- this.props.dispatch(fetchMembers(nextProps.params.id));
- }
+ if (nextProps.params.id !== this.props.params.id) {
+ this.props.dispatch(fetchMembers(nextProps.params.id));
+ }
}
handleLoadMore = debounce(() => {
- this.props.dispatch(expandMembers(this.props.params.id));
+ this.props.dispatch(expandMembers(this.props.params.id));
}, 300, { leading: true });
render () {
- const { accountIds, hasMore, group } = this.props;
+ const { accountIds, hasMore, group } = this.props;
- if (!group || !accountIds) {
- return (
-
-
-
- );
- }
+ if (!group || !accountIds) {
+ return (
+
+
+
+ );
+ }
- return (
-
- }
- >
- {accountIds.map(id => )}
-
-
- );
+ return (
+
+ }
+ >
+ {accountIds.map(id => )}
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/removed_accounts/index.js b/app/gabsocial/features/groups/removed_accounts/index.js
index c8ad0e080..43a54d6ae 100644
--- a/app/gabsocial/features/groups/removed_accounts/index.js
+++ b/app/gabsocial/features/groups/removed_accounts/index.js
@@ -6,9 +6,9 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { debounce } from 'lodash';
import LoadingIndicator from '../../../components/loading_indicator';
import {
- fetchRemovedAccounts,
- expandRemovedAccounts,
- removeRemovedAccount,
+ fetchRemovedAccounts,
+ expandRemovedAccounts,
+ removeRemovedAccount,
} from '../../../actions/groups';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../../containers/account_container';
@@ -17,13 +17,13 @@ import ScrollableList from '../../../components/scrollable_list';
import { defineMessages, injectIntl } from 'react-intl';
const messages = defineMessages({
- remove: { id: 'groups.removed_accounts', defaultMessage: 'Allow joining' },
+ remove: { id: 'groups.removed_accounts', defaultMessage: 'Allow joining' },
});
const mapStateToProps = (state, { params: { id } }) => ({
- group: state.getIn(['groups', id]),
- accountIds: state.getIn(['user_lists', 'groups_removed_accounts', id, 'items']),
- hasMore: !!state.getIn(['user_lists', 'groups_removed_accounts', id, 'next']),
+ group: state.getIn(['groups', id]),
+ accountIds: state.getIn(['user_lists', 'groups_removed_accounts', id, 'items']),
+ hasMore: !!state.getIn(['user_lists', 'groups_removed_accounts', id, 'next']),
});
export default @connect(mapStateToProps)
@@ -31,56 +31,57 @@ export default @connect(mapStateToProps)
class GroupRemovedAccounts extends ImmutablePureComponent {
static propTypes = {
- params: PropTypes.object.isRequired,
- dispatch: PropTypes.func.isRequired,
- accountIds: ImmutablePropTypes.list,
- hasMore: PropTypes.bool,
+ params: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ accountIds: ImmutablePropTypes.list,
+ hasMore: PropTypes.bool,
};
componentWillMount () {
- const { params: { id } } = this.props;
+ const { params: { id } } = this.props;
- this.props.dispatch(fetchRemovedAccounts(id));
+ this.props.dispatch(fetchRemovedAccounts(id));
}
componentWillReceiveProps (nextProps) {
- if (nextProps.params.id !== this.props.params.id) {
- this.props.dispatch(fetchRemovedAccounts(nextProps.params.id));
- }
+ if (nextProps.params.id !== this.props.params.id) {
+ this.props.dispatch(fetchRemovedAccounts(nextProps.params.id));
+ }
}
handleLoadMore = debounce(() => {
- this.props.dispatch(expandRemovedAccounts(this.props.params.id));
+ this.props.dispatch(expandRemovedAccounts(this.props.params.id));
}, 300, { leading: true });
render () {
- const { accountIds, hasMore, group, intl } = this.props;
+ const { accountIds, hasMore, group, intl } = this.props;
- if (!group || !accountIds) {
- return (
-
-
-
- );
- }
+ if (!group || !accountIds) {
+ return (
+
+
+
+ );
+ }
- return (
-
- }
- >
- {accountIds.map(id => this.props.dispatch(removeRemovedAccount(group.get('id'), id))}
- actionTitle={intl.formatMessage(messages.remove)}
- />)}
-
-
- );
+ return (
+
+ }
+ >
+ {accountIds.map(id => ( this.props.dispatch(removeRemovedAccount(group.get('id'), id))}
+ actionTitle={intl.formatMessage(messages.remove)}
+ />))}
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/sidebar_panel/index.js b/app/gabsocial/features/groups/sidebar_panel/index.js
index 0e351685e..d8160d191 100644
--- a/app/gabsocial/features/groups/sidebar_panel/index.js
+++ b/app/gabsocial/features/groups/sidebar_panel/index.js
@@ -8,42 +8,44 @@ import Icon from 'gabsocial/components/icon';
import { Link } from 'react-router-dom';
const messages = defineMessages({
- title: { id: 'groups.sidebar-panel.title', defaultMessage: 'Groups You\'re In' },
- show_all: { id: 'groups.sidebar-panel.show_all', defaultMessage: 'Show all' },
+ title: { id: 'groups.sidebar-panel.title', defaultMessage: 'Groups You\'re In' },
+ show_all: { id: 'groups.sidebar-panel.show_all', defaultMessage: 'Show all' },
});
const mapStateToProps = (state, { id }) => ({
- groupIds: state.getIn(['group_lists', 'member']),
+ groupIds: state.getIn(['group_lists', 'member']),
});
export default @connect(mapStateToProps)
@injectIntl
class GroupSidebarPanel extends ImmutablePureComponent {
+
static propTypes = {
- groupIds: ImmutablePropTypes.list,
+ groupIds: ImmutablePropTypes.list,
}
render() {
- const { intl, groupIds } = this.props;
- const count = groupIds.count();
+ const { intl, groupIds } = this.props;
+ const count = groupIds.count();
- // Only when there are groups to show
- if (count === 0) return null;
+ // Only when there are groups to show
+ if (count === 0) return null;
- return (
-
-
-
- {intl.formatMessage(messages.title)}
-
+ return (
+
+
+
+ {intl.formatMessage(messages.title)}
+
-
-
- {groupIds.slice(0, 10).map(groupId => )}
- {count > 10 && {intl.formatMessage(messages.show_all)}}
-
-
+
+
+ {groupIds.slice(0, 10).map(groupId => )}
+ {count > 10 && {intl.formatMessage(messages.show_all)}}
- );
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/sidebar_panel/item.js b/app/gabsocial/features/groups/sidebar_panel/item.js
index 6ec6161c1..98b3fc92c 100644
--- a/app/gabsocial/features/groups/sidebar_panel/item.js
+++ b/app/gabsocial/features/groups/sidebar_panel/item.js
@@ -7,39 +7,41 @@ import { shortNumberFormat } from '../../../utils/numbers';
import { connect } from 'react-redux';
const messages = defineMessages({
- new_statuses: { id: 'groups.sidebar-panel.item.view', defaultMessage: 'new posts' },
- no_recent_activity: { id: 'groups.sidebar-panel.item.no_recent_activity', defaultMessage: 'No recent activity' },
+ new_statuses: { id: 'groups.sidebar-panel.item.view', defaultMessage: 'new posts' },
+ no_recent_activity: { id: 'groups.sidebar-panel.item.no_recent_activity', defaultMessage: 'No recent activity' },
});
const mapStateToProps = (state, { id }) => ({
- group: state.getIn(['groups', id]),
- relationships: state.getIn(['group_relationships', id]),
+ group: state.getIn(['groups', id]),
+ relationships: state.getIn(['group_relationships', id]),
});
export default @connect(mapStateToProps)
@injectIntl
class Item extends ImmutablePureComponent {
+
static propTypes = {
- group: ImmutablePropTypes.map,
- relationships: ImmutablePropTypes.map,
+ group: ImmutablePropTypes.map,
+ relationships: ImmutablePropTypes.map,
}
render() {
- const { intl, group, relationships } = this.props;
+ const { intl, group, relationships } = this.props;
- // Wait for relationships
- if (!relationships) return null;
+ // Wait for relationships
+ if (!relationships) return null;
- const unreadCount = relationships.get('unread_count');
+ const unreadCount = relationships.get('unread_count');
- return (
-
-
{group.get('title')}
-
- {unreadCount > 0 && {shortNumberFormat(unreadCount)} {intl.formatMessage(messages.new_statuses)}}
- {unreadCount === 0 && {intl.formatMessage(messages.no_recent_activity)}}
-
-
- );
+ return (
+
+
{group.get('title')}
+
+ {unreadCount > 0 && {shortNumberFormat(unreadCount)} {intl.formatMessage(messages.new_statuses)}}
+ {unreadCount === 0 && {intl.formatMessage(messages.no_recent_activity)}}
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/timeline/components/header.js b/app/gabsocial/features/groups/timeline/components/header.js
index 9691fca30..1d9774fbf 100644
--- a/app/gabsocial/features/groups/timeline/components/header.js
+++ b/app/gabsocial/features/groups/timeline/components/header.js
@@ -8,70 +8,72 @@ import { NavLink } from 'react-router-dom';
import DropdownMenuContainer from '../../../../containers/dropdown_menu_container';
const messages = defineMessages({
- join: { id: 'groups.join', defaultMessage: 'Join group' },
- leave: { id: 'groups.leave', defaultMessage: 'Leave group' },
- removed_accounts: { id: 'groups.removed_accounts', defaultMessage: 'Removed Accounts' },
- edit: { id: 'groups.edit', defaultMessage: 'Edit' }
+ join: { id: 'groups.join', defaultMessage: 'Join group' },
+ leave: { id: 'groups.leave', defaultMessage: 'Leave group' },
+ removed_accounts: { id: 'groups.removed_accounts', defaultMessage: 'Removed Accounts' },
+ edit: { id: 'groups.edit', defaultMessage: 'Edit' },
});
export default @injectIntl
class Header extends ImmutablePureComponent {
+
static propTypes = {
- group: ImmutablePropTypes.map,
- relationships: ImmutablePropTypes.map,
- toggleMembership: PropTypes.func.isRequired,
+ group: ImmutablePropTypes.map,
+ relationships: ImmutablePropTypes.map,
+ toggleMembership: PropTypes.func.isRequired,
};
static contextTypes = {
- router: PropTypes.object,
+ router: PropTypes.object,
};
getActionButton() {
- const { group, relationships, toggleMembership, intl } = this.props;
- const toggle = () => toggleMembership(group, relationships);
+ const { group, relationships, toggleMembership, intl } = this.props;
+ const toggle = () => toggleMembership(group, relationships);
- if (!relationships) {
- return '';
- } else if (!relationships.get('member')) {
- return
;
- } else if (relationships.get('member')) {
- return
;
- }
+ if (!relationships) {
+ return '';
+ } else if (!relationships.get('member')) {
+ return
;
+ } else if (relationships.get('member')) {
+ return
;
+ }
}
getAdminMenu() {
- const { group, intl } = this.props;
+ const { group, intl } = this.props;
- const menu = [
- { text: intl.formatMessage(messages.edit), to: `/groups/${group.get('id')}/edit` },
- { text: intl.formatMessage(messages.removed_accounts), to: `/groups/${group.get('id')}/removed_accounts` },
- ];
+ const menu = [
+ { text: intl.formatMessage(messages.edit), to: `/groups/${group.get('id')}/edit` },
+ { text: intl.formatMessage(messages.removed_accounts), to: `/groups/${group.get('id')}/removed_accounts` },
+ ];
- return
;
+ return
;
}
render () {
- const { group, relationships } = this.props;
+ const { group, relationships } = this.props;
- if (!group || !relationships) {
- return null;
- }
+ if (!group || !relationships) {
+ return null;
+ }
- return (
-
-
-
-
})
-
-
-
- Posts
- Members
- {this.getActionButton()}
- {relationships.get('admin') && this.getAdminMenu()}
-
-
-
- );
+ return (
+
+
+
+
})
+
+
+
+ Posts
+ Members
+ {this.getActionButton()}
+ {relationships.get('admin') && this.getAdminMenu()}
+
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/timeline/components/panel.js b/app/gabsocial/features/groups/timeline/components/panel.js
index 9fe1c81e4..6601404ca 100644
--- a/app/gabsocial/features/groups/timeline/components/panel.js
+++ b/app/gabsocial/features/groups/timeline/components/panel.js
@@ -4,31 +4,33 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, defineMessages } from 'react-intl';
const messages = defineMessages({
- group_archived: { id: 'group.detail.archived_group', defaultMessage: 'Archived group' },
- group_admin: { id: 'groups.detail.role_admin', defaultMessage: 'You\'re an admin' }
+ group_archived: { id: 'group.detail.archived_group', defaultMessage: 'Archived group' },
+ group_admin: { id: 'groups.detail.role_admin', defaultMessage: 'You\'re an admin' },
});
export default @injectIntl
class GroupPanel extends ImmutablePureComponent {
+
static propTypes = {
- group: ImmutablePropTypes.map,
- relationships: ImmutablePropTypes.map,
+ group: ImmutablePropTypes.map,
+ relationships: ImmutablePropTypes.map,
}
render() {
- const { group, relationships, intl } = this.props;
+ const { group, relationships, intl } = this.props;
- return (
-
-
- {group.get('title')}
- {group.get('archived') && }
-
+ return (
+
+
+ {group.get('title')}
+ {group.get('archived') && }
+
- {relationships.get('admin') &&
{intl.formatMessage(messages.group_admin)}}
+ {relationships.get('admin') &&
{intl.formatMessage(messages.group_admin)}}
-
{group.get('description')}
-
- );
+
{group.get('description')}
+
+ );
}
+
}
diff --git a/app/gabsocial/features/groups/timeline/containers/header_container.js b/app/gabsocial/features/groups/timeline/containers/header_container.js
index a2c5cf116..1144dc0b2 100644
--- a/app/gabsocial/features/groups/timeline/containers/header_container.js
+++ b/app/gabsocial/features/groups/timeline/containers/header_container.js
@@ -3,18 +3,18 @@ import Header from '../components/header';
import { joinGroup, leaveGroup } from '../../../../actions/groups';
const mapStateToProps = (state, { groupId }) => ({
- group: state.getIn(['groups', groupId]),
- relationships: state.getIn(['group_relationships', groupId]),
+ group: state.getIn(['groups', groupId]),
+ relationships: state.getIn(['group_relationships', groupId]),
});
const mapDispatchToProps = (dispatch, { intl }) => ({
- toggleMembership (group, relationships) {
- if (relationships.get('member')) {
- dispatch(leaveGroup(group.get('id')));
- } else {
- dispatch(joinGroup(group.get('id')));
- }
- },
+ toggleMembership (group, relationships) {
+ if (relationships.get('member')) {
+ dispatch(leaveGroup(group.get('id')));
+ } else {
+ dispatch(joinGroup(group.get('id')));
+ }
+ },
});
export default connect(mapStateToProps, mapDispatchToProps)(Header);
diff --git a/app/gabsocial/features/groups/timeline/index.js b/app/gabsocial/features/groups/timeline/index.js
index 8aed8bb2f..ec7d832e2 100644
--- a/app/gabsocial/features/groups/timeline/index.js
+++ b/app/gabsocial/features/groups/timeline/index.js
@@ -13,95 +13,97 @@ import ComposeFormContainer from '../../../../gabsocial/features/compose/contain
import Avatar from '../../../components/avatar';
const mapStateToProps = (state, props) => {
- const me = state.get('me');
- return {
- account: state.getIn(['accounts', me]),
- group: state.getIn(['groups', props.params.id]),
- relationships: state.getIn(['group_relationships', props.params.id]),
- hasUnread: state.getIn(['timelines', `group:${props.params.id}`, 'unread']) > 0,
- }
+ const me = state.get('me');
+ return {
+ account: state.getIn(['accounts', me]),
+ group: state.getIn(['groups', props.params.id]),
+ relationships: state.getIn(['group_relationships', props.params.id]),
+ hasUnread: state.getIn(['timelines', `group:${props.params.id}`, 'unread']) > 0,
+ };
};
export default @connect(mapStateToProps)
@injectIntl
class GroupTimeline extends React.PureComponent {
+
static contextTypes = {
- router: PropTypes.object,
+ router: PropTypes.object,
};
static propTypes = {
- params: PropTypes.object.isRequired,
- dispatch: PropTypes.func.isRequired,
- columnId: PropTypes.string,
- hasUnread: PropTypes.bool,
- group: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]),
- relationships: ImmutablePropTypes.map,
- account: ImmutablePropTypes.map,
- intl: PropTypes.object.isRequired,
+ params: PropTypes.object.isRequired,
+ dispatch: PropTypes.func.isRequired,
+ columnId: PropTypes.string,
+ hasUnread: PropTypes.bool,
+ group: PropTypes.oneOfType([ImmutablePropTypes.map, PropTypes.bool]),
+ relationships: ImmutablePropTypes.map,
+ account: ImmutablePropTypes.map,
+ intl: PropTypes.object.isRequired,
};
componentDidMount () {
- const { dispatch } = this.props;
- const { id } = this.props.params;
+ const { dispatch } = this.props;
+ const { id } = this.props.params;
- dispatch(expandGroupTimeline(id));
+ dispatch(expandGroupTimeline(id));
- this.disconnect = dispatch(connectGroupStream(id));
+ this.disconnect = dispatch(connectGroupStream(id));
}
componentWillUnmount () {
- if (this.disconnect) {
- this.disconnect();
- this.disconnect = null;
- }
+ if (this.disconnect) {
+ this.disconnect();
+ this.disconnect = null;
+ }
}
handleLoadMore = maxId => {
- const { id } = this.props.params;
- this.props.dispatch(expandGroupTimeline(id, { maxId }));
+ const { id } = this.props.params;
+ this.props.dispatch(expandGroupTimeline(id, { maxId }));
}
render () {
- const { columnId, group, relationships, account } = this.props;
- const { id } = this.props.params;
+ const { columnId, group, relationships, account } = this.props;
+ const { id } = this.props.params;
- if (typeof group === 'undefined' || !relationships) {
- return (
-
-
-
- );
- } else if (group === false) {
- return (
-
-
-
- );
- }
+ if (typeof group === 'undefined' || !relationships) {
+ return (
+
+
+
+ );
+ } else if (group === false) {
+ return (
+
+
+
+ );
+ }
- return (
-
- {relationships.get('member') && (
-
- )}
+ return (
+
+ {relationships.get('member') && (
+
+ )}
-
- }
- />
-
-
- );
+
+ }
+ />
+
+
+ );
}
+
}
diff --git a/app/gabsocial/features/home_timeline/index.js b/app/gabsocial/features/home_timeline/index.js
index e91d7240f..8ed0e9c7a 100644
--- a/app/gabsocial/features/home_timeline/index.js
+++ b/app/gabsocial/features/home_timeline/index.js
@@ -68,7 +68,7 @@ class HomeTimeline extends React.PureComponent {
}
render () {
- const { intl, hasUnread, siteTitle} = this.props;
+ const { intl, hasUnread, siteTitle } = this.props;
return (
@@ -79,7 +79,7 @@ class HomeTimeline extends React.PureComponent {
scrollKey='home_timeline'
onLoadMore={this.handleLoadMore}
timelineId='home'
- emptyMessage={ }} />}
+ emptyMessage={ }} />}
/>
);
diff --git a/app/gabsocial/features/landing_page/index.js b/app/gabsocial/features/landing_page/index.js
index 00d39d54c..7ce3531a0 100644
--- a/app/gabsocial/features/landing_page/index.js
+++ b/app/gabsocial/features/landing_page/index.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { connect } from 'react-redux'
+import { connect } from 'react-redux';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { Link } from 'react-router-dom';
import LoginForm from 'gabsocial/features/auth_login/components/login_form';
@@ -11,13 +11,14 @@ const mapStateToProps = (state, props) => ({
});
class LandingPage extends ImmutablePureComponent {
+
getSiteLogo = () => {
const { instance, soapbox } = this.props;
const logos = {
imgLogo: (
})
),
textLogo: (
{instance.get('title')}
),
- }
- return soapbox.get('logo') ? logos['imgLogo'] : logos['textLogo'];
+ };
+ return soapbox.get('logo') ? logos.imgLogo : logos.textLogo;
}
render() {
@@ -36,7 +37,7 @@ class LandingPage extends ImmutablePureComponent {
Home
About
-
+
@@ -121,8 +122,9 @@ class LandingPage extends ImmutablePureComponent {
- )
+ );
}
+
}
export default connect(mapStateToProps)(LandingPage);
diff --git a/app/gabsocial/features/list_adder/index.js b/app/gabsocial/features/list_adder/index.js
index 146a5e2be..1368476cc 100644
--- a/app/gabsocial/features/list_adder/index.js
+++ b/app/gabsocial/features/list_adder/index.js
@@ -21,7 +21,7 @@ const getOrderedLists = createSelector([state => state.get('lists')], lists => {
return lists.toList().filter(item => !!item).sort((a, b) => a.get('title').localeCompare(b.get('title')));
});
-const mapStateToProps = (state, {accountId}) => ({
+const mapStateToProps = (state, { accountId }) => ({
listIds: getOrderedLists(state).map(list=>list.get('id')),
account: state.getIn(['accounts', accountId]),
});
@@ -84,12 +84,12 @@ class ListAdder extends ImmutablePureComponent {
);
}
+
}
export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ActionBar));
diff --git a/app/gabsocial/features/status/index.js b/app/gabsocial/features/status/index.js
index 471c5e869..1f3d1ad86 100644
--- a/app/gabsocial/features/status/index.js
+++ b/app/gabsocial/features/status/index.js
@@ -64,7 +64,7 @@ const makeMapStateToProps = () => {
const mapStateToProps = (state, props) => {
const status = getStatus(state, {
id: props.params.statusId,
- username: props.params.username
+ username: props.params.username,
});
let ancestorsIds = Immutable.List();
@@ -462,10 +462,11 @@ class Status extends ImmutablePureComponent {
aria-label={intl.formatMessage(status.get('hidden') ? messages.revealAll : messages.hideAll)}
onClick={this.handleToggleAll}
aria-pressed={
- status.get('hidden') ? 'false' : 'true'}>
-