diff --git a/app/gabsocial/actions/auth.js b/app/gabsocial/actions/auth.js index d23a5f27b..3e3745f55 100644 --- a/app/gabsocial/actions/auth.js +++ b/app/gabsocial/actions/auth.js @@ -14,7 +14,7 @@ export function createAuthApp() { // TODO: Add commit hash to client_name client_name: `SoapboxFE_${(new Date()).toISOString()}`, redirect_uris: 'urn:ietf:wg:oauth:2.0:oob', - scopes: 'read write follow push admin' + scopes: 'read write follow push admin', }).then(response => { dispatch(authAppCreated(response.data)); }).then(() => { @@ -23,12 +23,12 @@ export function createAuthApp() { client_id: app.get('client_id'), client_secret: app.get('client_secret'), redirect_uri: 'urn:ietf:wg:oauth:2.0:oob', - grant_type: 'client_credentials' + grant_type: 'client_credentials', }); }).then(response => { dispatch(authAppAuthorized(response.data)); }); - } + }; } export function logIn(username, password) { @@ -40,14 +40,14 @@ export function logIn(username, password) { redirect_uri: 'urn:ietf:wg:oauth:2.0:oob', grant_type: 'password', username: username, - password: password + password: password, }).then(response => { dispatch(authLoggedIn(response.data)); }).catch((error) => { dispatch(showAlert('Login failed.', 'Invalid username or password.')); throw error; }); - } + }; } export function logOut() { @@ -60,20 +60,20 @@ export function logOut() { export function authAppCreated(app) { return { type: AUTH_APP_CREATED, - app + app, }; } export function authAppAuthorized(app) { return { type: AUTH_APP_AUTHORIZED, - app + app, }; } export function authLoggedIn(user) { return { type: AUTH_LOGGED_IN, - user + user, }; } diff --git a/app/gabsocial/actions/group_editor.js b/app/gabsocial/actions/group_editor.js index be4c481ff..4b9245081 100644 --- a/app/gabsocial/actions/group_editor.js +++ b/app/gabsocial/actions/group_editor.js @@ -13,100 +13,100 @@ export const GROUP_EDITOR_RESET = 'GROUP_EDITOR_RESET'; export const GROUP_EDITOR_SETUP = 'GROUP_EDITOR_SETUP'; export const submit = (routerHistory) => (dispatch, getState) => { - const groupId = getState().getIn(['group_editor', 'groupId']); - const title = getState().getIn(['group_editor', 'title']); - const description = getState().getIn(['group_editor', 'description']); - const coverImage = getState().getIn(['group_editor', 'coverImage']); + const groupId = getState().getIn(['group_editor', 'groupId']); + const title = getState().getIn(['group_editor', 'title']); + const description = getState().getIn(['group_editor', 'description']); + const coverImage = getState().getIn(['group_editor', 'coverImage']); - if (groupId === null) { - dispatch(create(title, description, coverImage, routerHistory)); - } else { - dispatch(update(groupId, title, description, coverImage, routerHistory)); - } + if (groupId === null) { + dispatch(create(title, description, coverImage, routerHistory)); + } else { + dispatch(update(groupId, title, description, coverImage, routerHistory)); + } }; export const create = (title, description, coverImage, routerHistory) => (dispatch, getState) => { - if (!getState().get('me')) return; + if (!getState().get('me')) return; - dispatch(createRequest()); + dispatch(createRequest()); - const formData = new FormData(); - formData.append('title', title); - formData.append('description', description); + const formData = new FormData(); + formData.append('title', title); + formData.append('description', description); - if (coverImage !== null) { - formData.append('cover_image', coverImage); - } + if (coverImage !== null) { + formData.append('cover_image', coverImage); + } - api(getState).post('/api/v1/groups', formData, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({ data }) => { - dispatch(createSuccess(data)); - routerHistory.push(`/groups/${data.id}`); - }).catch(err => dispatch(createFail(err))); - }; + api(getState).post('/api/v1/groups', formData, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({ data }) => { + dispatch(createSuccess(data)); + routerHistory.push(`/groups/${data.id}`); + }).catch(err => dispatch(createFail(err))); +}; export const createRequest = id => ({ - type: GROUP_CREATE_REQUEST, - id, + type: GROUP_CREATE_REQUEST, + id, }); export const createSuccess = group => ({ - type: GROUP_CREATE_SUCCESS, - group, + type: GROUP_CREATE_SUCCESS, + group, }); export const createFail = error => ({ - type: GROUP_CREATE_FAIL, - error, + type: GROUP_CREATE_FAIL, + error, }); export const update = (groupId, title, description, coverImage, routerHistory) => (dispatch, getState) => { - if (!getState().get('me')) return; + if (!getState().get('me')) return; - dispatch(updateRequest()); + dispatch(updateRequest()); - const formData = new FormData(); - formData.append('title', title); - formData.append('description', description); + const formData = new FormData(); + formData.append('title', title); + formData.append('description', description); - if (coverImage !== null) { - formData.append('cover_image', coverImage); - } + if (coverImage !== null) { + formData.append('cover_image', coverImage); + } - api(getState).put(`/api/v1/groups/${groupId}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({ data }) => { - dispatch(updateSuccess(data)); - routerHistory.push(`/groups/${data.id}`); - }).catch(err => dispatch(updateFail(err))); - }; + api(getState).put(`/api/v1/groups/${groupId}`, formData, { headers: { 'Content-Type': 'multipart/form-data' } }).then(({ data }) => { + dispatch(updateSuccess(data)); + routerHistory.push(`/groups/${data.id}`); + }).catch(err => dispatch(updateFail(err))); +}; export const updateRequest = id => ({ - type: GROUP_UPDATE_REQUEST, - id, + type: GROUP_UPDATE_REQUEST, + id, }); export const updateSuccess = group => ({ - type: GROUP_UPDATE_SUCCESS, - group, + type: GROUP_UPDATE_SUCCESS, + group, }); export const updateFail = error => ({ - type: GROUP_UPDATE_FAIL, - error, + type: GROUP_UPDATE_FAIL, + error, }); export const changeValue = (field, value) => ({ - type: GROUP_EDITOR_VALUE_CHANGE, - field, - value, + type: GROUP_EDITOR_VALUE_CHANGE, + field, + value, }); export const reset = () => ({ - type: GROUP_EDITOR_RESET + type: GROUP_EDITOR_RESET, }); export const setUp = (group) => ({ - type: GROUP_EDITOR_SETUP, - group, + type: GROUP_EDITOR_SETUP, + group, }); diff --git a/app/gabsocial/actions/groups.js b/app/gabsocial/actions/groups.js index bd35219b0..959b1b0b2 100644 --- a/app/gabsocial/actions/groups.js +++ b/app/gabsocial/actions/groups.js @@ -193,7 +193,7 @@ export function joinGroupRequest(id) { export function joinGroupSuccess(relationship) { return { type: GROUP_JOIN_SUCCESS, - relationship + relationship, }; }; diff --git a/app/gabsocial/actions/instance.js b/app/gabsocial/actions/instance.js index 3a828d64a..2be8418fd 100644 --- a/app/gabsocial/actions/instance.js +++ b/app/gabsocial/actions/instance.js @@ -5,7 +5,7 @@ export const INSTANCE_FAIL = 'INSTANCE_FAIL'; export function fetchInstance() { return (dispatch, getState) => { - api(getState).get(`/api/v1/instance`).then(response => { + api(getState).get('/api/v1/instance').then(response => { dispatch(importInstance(response.data)); }).catch(error => { dispatch(instanceFail(error)); @@ -16,7 +16,7 @@ export function fetchInstance() { export function importInstance(instance) { return { type: INSTANCE_IMPORT, - instance + instance, }; } diff --git a/app/gabsocial/actions/me.js b/app/gabsocial/actions/me.js index 8d9b806b2..d4a4b1cab 100644 --- a/app/gabsocial/actions/me.js +++ b/app/gabsocial/actions/me.js @@ -9,9 +9,9 @@ export const ME_FETCH_SKIP = 'ME_FETCH_SKIP'; export function fetchMe() { return (dispatch, getState) => { const accessToken = getState().getIn(['auth', 'user', 'access_token']); - if (!accessToken) return dispatch({type: ME_FETCH_SKIP}); + if (!accessToken) return dispatch({ type: ME_FETCH_SKIP }); dispatch(fetchMeRequest()); - api(getState).get(`/api/v1/accounts/verify_credentials`).then(response => { + api(getState).get('/api/v1/accounts/verify_credentials').then(response => { dispatch(fetchMeSuccess(response.data)); dispatch(importFetchedAccount(response.data)); }).catch(error => { @@ -29,7 +29,7 @@ export function fetchMeRequest() { export function fetchMeSuccess(me) { return { type: ME_FETCH_SUCCESS, - me + me, }; } diff --git a/app/gabsocial/actions/notifications.js b/app/gabsocial/actions/notifications.js index c16d87226..bc30b7cab 100644 --- a/app/gabsocial/actions/notifications.js +++ b/app/gabsocial/actions/notifications.js @@ -47,7 +47,7 @@ const fetchRelatedRelationships = (dispatch, notifications) => { export function initializeNotifications() { return { - type: NOTIFICATIONS_INITIALIZE + type: NOTIFICATIONS_INITIALIZE, }; } @@ -115,11 +115,10 @@ export function updateNotificationsQueue(notification, intlMessages, intlLocale, intlMessages, intlLocale, }); - } - else { + } else { dispatch(updateNotifications(notification, intlMessages, intlLocale)); } - } + }; }; export function dequeueNotifications() { @@ -129,13 +128,11 @@ export function dequeueNotifications() { if (totalQueuedNotificationsCount == 0) { return; - } - else if (totalQueuedNotificationsCount > 0 && totalQueuedNotificationsCount <= MAX_QUEUED_NOTIFICATIONS) { + } else if (totalQueuedNotificationsCount > 0 && totalQueuedNotificationsCount <= MAX_QUEUED_NOTIFICATIONS) { queuedNotifications.forEach(block => { dispatch(updateNotifications(block.notification, block.intlMessages, block.intlLocale)); }); - } - else { + } else { dispatch(expandNotifications()); } @@ -143,7 +140,7 @@ export function dequeueNotifications() { type: NOTIFICATIONS_DEQUEUE, }); dispatch(markReadNotifications()); - } + }; }; const excludeTypesFromSettings = state => state.getIn(['settings', 'notifications', 'shows']).filter(enabled => !enabled).keySeq().toJS(); @@ -240,7 +237,7 @@ export function scrollTopNotifications(top) { top, }); dispatch(markReadNotifications()); - } + }; } export function setFilter (filterType) { @@ -262,12 +259,12 @@ export function markReadNotifications() { const last_read = getState().getIn(['notifications', 'lastRead']); if (top_notification && top_notification > last_read) { - api(getState).post('/api/v1/notifications/mark_read', {id: top_notification}).then(response => { + api(getState).post('/api/v1/notifications/mark_read', { id: top_notification }).then(response => { dispatch({ type: NOTIFICATIONS_MARK_READ, notification: top_notification, }); }); } - } + }; } diff --git a/app/gabsocial/actions/patron.js b/app/gabsocial/actions/patron.js index 57b6790bf..7e946913b 100644 --- a/app/gabsocial/actions/patron.js +++ b/app/gabsocial/actions/patron.js @@ -5,7 +5,7 @@ export const PATRON_FUNDING_FETCH_FAIL = 'PATRON_FUNDING_FETCH_FAIL'; export function fetchFunding() { return (dispatch, getState) => { - api(getState).get(`/patron/v1/funding`).then(response => { + api(getState).get('/patron/v1/funding').then(response => { dispatch(importFetchedFunding(response.data)); }).then(() => { dispatch(fetchFundingSuccess()); @@ -18,7 +18,7 @@ export function fetchFunding() { export function importFetchedFunding(funding) { return { type: PATRON_FUNDING_IMPORT, - funding + funding, }; } diff --git a/app/gabsocial/actions/soapbox.js b/app/gabsocial/actions/soapbox.js index 711790c5a..72a7d4d06 100644 --- a/app/gabsocial/actions/soapbox.js +++ b/app/gabsocial/actions/soapbox.js @@ -5,7 +5,7 @@ export const SOAPBOX_CONFIG_FAIL = 'SOAPBOX_CONFIG_FAIL'; export function fetchSoapboxConfig() { return (dispatch, getState) => { - api(getState).get(`/soapbox/soapbox.json`).then(response => { + api(getState).get('/soapbox/soapbox.json').then(response => { dispatch(importSoapboxConfig(response.data)); }).catch(error => { dispatch(soapboxConfigFail(error)); @@ -16,7 +16,7 @@ export function fetchSoapboxConfig() { export function importSoapboxConfig(soapboxConfig) { return { type: SOAPBOX_CONFIG_IMPORT, - soapboxConfig + soapboxConfig, }; } diff --git a/app/gabsocial/actions/timelines.js b/app/gabsocial/actions/timelines.js index 78f372b23..c7ce451fc 100644 --- a/app/gabsocial/actions/timelines.js +++ b/app/gabsocial/actions/timelines.js @@ -45,7 +45,7 @@ export function updateTimelineQueue(timeline, status, accept) { timeline, status, }); - } + }; }; export function dequeueTimeline(timeline, expandFunc, optionalExpandArgs) { @@ -57,27 +57,22 @@ export function dequeueTimeline(timeline, expandFunc, optionalExpandArgs) { if (totalQueuedItemsCount == 0) { return; - } - else if (totalQueuedItemsCount > 0 && totalQueuedItemsCount <= MAX_QUEUED_ITEMS) { + } else if (totalQueuedItemsCount > 0 && totalQueuedItemsCount <= MAX_QUEUED_ITEMS) { queuedItems.forEach(status => { dispatch(updateTimeline(timeline, status.toJS(), null)); }); - } - else { + } else { if (typeof expandFunc === 'function') { dispatch(clearTimeline(timeline)); expandFunc(); - } - else { + } else { if (timeline === 'home') { dispatch(clearTimeline(timeline)); dispatch(expandHomeTimeline(optionalExpandArgs)); - } - else if (timeline === 'community') { + } else if (timeline === 'community') { dispatch(clearTimeline(timeline)); dispatch(expandCommunityTimeline(optionalExpandArgs)); - } - else { + } else { shouldDispatchDequeue = false; } } @@ -89,7 +84,7 @@ export function dequeueTimeline(timeline, expandFunc, optionalExpandArgs) { type: TIMELINE_DEQUEUE, timeline, }); - } + }; }; export function deleteFromTimelines(id) { diff --git a/app/gabsocial/components/account.js b/app/gabsocial/components/account.js index 0c686f711..d0c5f0fc6 100644 --- a/app/gabsocial/components/account.js +++ b/app/gabsocial/components/account.js @@ -131,7 +131,7 @@ class Account extends ImmutablePureComponent { - : '' } + : '' }
{buttons} diff --git a/app/gabsocial/components/display_name.js b/app/gabsocial/components/display_name.js index be0614140..62a9e844f 100644 --- a/app/gabsocial/components/display_name.js +++ b/app/gabsocial/components/display_name.js @@ -22,7 +22,7 @@ export default class DisplayName extends React.PureComponent { , - a.get('is_verified') && + a.get('is_verified') && , ]).reduce((prev, cur) => [prev, ', ', cur]); if (others.size - 2 > 0) { diff --git a/app/gabsocial/components/dropdown_menu.js b/app/gabsocial/components/dropdown_menu.js index aa83b37ef..51a89419b 100644 --- a/app/gabsocial/components/dropdown_menu.js +++ b/app/gabsocial/components/dropdown_menu.js @@ -135,7 +135,8 @@ class DropdownMenu extends React.PureComponent { onKeyDown={this.handleItemKeyDown} data-index={i} target={newTab ? '_blank' : null} - data-method={isLogout ? 'delete' : null}> + data-method={isLogout ? 'delete' : null} + > {text} diff --git a/app/gabsocial/components/extended_video_player.js b/app/gabsocial/components/extended_video_player.js index d62951c27..816702538 100644 --- a/app/gabsocial/components/extended_video_player.js +++ b/app/gabsocial/components/extended_video_player.js @@ -41,9 +41,9 @@ export default class ExtendedVideoPlayer extends React.PureComponent { render () { const { src, muted, controls, alt } = this.props; - let conditionalAttributes = {} + let conditionalAttributes = {}; if (isIOS()) { - conditionalAttributes.playsInline = '1' + conditionalAttributes.playsInline = '1'; } return ( diff --git a/app/gabsocial/components/home_column_header.js b/app/gabsocial/components/home_column_header.js index efc26a35e..5927d314e 100644 --- a/app/gabsocial/components/home_column_header.js +++ b/app/gabsocial/components/home_column_header.js @@ -119,34 +119,34 @@ class ColumnHeader extends React.PureComponent { let expandedContent = null; if ((expandedFor === 'lists' || activeItem === 'lists') && lists) { expandedContent = lists.map(list => - {list.get('title')} - - ) + ) + ); } return (

- + {formatMessage(messages.homeTitle)} - + {siteTitle} - + {formatMessage(messages.fediverseTitle)} @@ -171,6 +171,7 @@ class ColumnHeader extends React.PureComponent {

); } + } export default injectIntl(connect(mapStateToProps)(ColumnHeader)); diff --git a/app/gabsocial/components/icon.js b/app/gabsocial/components/icon.js index d62731b3b..08b773be8 100644 --- a/app/gabsocial/components/icon.js +++ b/app/gabsocial/components/icon.js @@ -16,7 +16,7 @@ export default class Icon extends React.PureComponent { // tag. There is a common adblocker rule which hides elements with // alt='retweet' unless the domain is twitter.com. This should // change what screenreaders call it as well. - var alt_id = (id == "retweet") ? "repost" : id; + var alt_id = (id == 'retweet') ? 'repost' : id; return ( ); diff --git a/app/gabsocial/components/icon_with_badge.js b/app/gabsocial/components/icon_with_badge.js index c42b9337e..f9688c22e 100644 --- a/app/gabsocial/components/icon_with_badge.js +++ b/app/gabsocial/components/icon_with_badge.js @@ -4,19 +4,19 @@ import Icon from 'gabsocial/components/icon'; import { shortNumberFormat } from 'gabsocial/utils/numbers'; const IconWithBadge = ({ id, count, className }) => { - if (count < 1) return null; + if (count < 1) return null; - return ( - - {count > 0 && {shortNumberFormat(count)}} - - ) + return ( + + {count > 0 && {shortNumberFormat(count)}} + + ); }; IconWithBadge.propTypes = { - id: PropTypes.string.isRequired, - count: PropTypes.number.isRequired, - className: PropTypes.string, + id: PropTypes.string.isRequired, + count: PropTypes.number.isRequired, + className: PropTypes.string, }; export default IconWithBadge; diff --git a/app/gabsocial/components/media_gallery.js b/app/gabsocial/components/media_gallery.js index 225e10b9f..48a4f0ee8 100644 --- a/app/gabsocial/components/media_gallery.js +++ b/app/gabsocial/components/media_gallery.js @@ -178,12 +178,12 @@ class Item extends React.PureComponent { ); } else if (attachment.get('type') === 'gifv') { - let conditionalAttributes = {} + let conditionalAttributes = {}; if (isIOS()) { - conditionalAttributes.playsInline = '1' + conditionalAttributes.playsInline = '1'; } if (autoPlayGif) { - conditionalAttributes.autoPlay = '1' + conditionalAttributes.autoPlay = '1'; } thumbnail = ( @@ -329,12 +329,12 @@ class MediaGallery extends React.PureComponent { if (isPortrait(ar1) && isPortrait(ar2)) { itemsDimensions = [ { w: 50, h: '100%', r: '2px' }, - { w: 50, h: '100%', l: '2px' } + { w: 50, h: '100%', l: '2px' }, ]; } else if (isPanoramic(ar1) && isPanoramic(ar2)) { itemsDimensions = [ { w: 100, h: panoSize_px, b: '2px' }, - { w: 100, h: panoSize_px, t: '2px' } + { w: 100, h: panoSize_px, t: '2px' }, ]; } else if ( (isPanoramic(ar1) && isPortrait(ar2)) || @@ -355,7 +355,7 @@ class MediaGallery extends React.PureComponent { } else { itemsDimensions = [ { w: 50, h: '100%', r: '2px' }, - { w: 50, h: '100%', l: '2px' } + { w: 50, h: '100%', l: '2px' }, ]; } } else if (size == 3) { @@ -371,19 +371,19 @@ class MediaGallery extends React.PureComponent { if (isPanoramic(ar1) && isNonConformingRatio(ar2) && isNonConformingRatio(ar3)) { itemsDimensions = [ - { w: 100, h: `50%`, b: '2px' }, + { w: 100, h: '50%', b: '2px' }, { w: 50, h: '50%', t: '2px', r: '2px' }, - { w: 50, h: '50%', t: '2px', l: '2px' } + { w: 50, h: '50%', t: '2px', l: '2px' }, ]; } else if (isPanoramic(ar1) && isPanoramic(ar2) && isPanoramic(ar3)) { itemsDimensions = [ { w: 100, h: panoSize_px, b: '4px' }, { w: 100, h: panoSize_px }, - { w: 100, h: panoSize_px, t: '4px' } + { w: 100, h: panoSize_px, t: '4px' }, ]; } else if (isPortrait(ar1) && isNonConformingRatio(ar2) && isNonConformingRatio(ar3)) { itemsDimensions = [ - { w: 50, h: `100%`, r: '2px' }, + { w: 50, h: '100%', r: '2px' }, { w: 50, h: '50%', b: '2px', l: '2px' }, { w: 50, h: '50%', t: '2px', l: '2px' }, ]; @@ -391,7 +391,7 @@ class MediaGallery extends React.PureComponent { itemsDimensions = [ { w: 50, h: '50%', b: '2px', r: '2px' }, { w: 50, h: '50%', l: '-2px', b: '-2px', pos: 'absolute', float: 'none' }, - { w: 50, h: `100%`, r: '-2px', t: '0px', b: '0px', pos: 'absolute', float: 'none' } + { w: 50, h: '100%', r: '-2px', t: '0px', b: '0px', pos: 'absolute', float: 'none' }, ]; } else if ( (isNonConformingRatio(ar1) && isPortrait(ar2) && isNonConformingRatio(ar3)) || @@ -399,8 +399,8 @@ class MediaGallery extends React.PureComponent { ) { itemsDimensions = [ { w: 50, h: '50%', b: '2px', r: '2px' }, - { w: 50, h: `100%`, l: '2px', float: 'right' }, - { w: 50, h: '50%', t: '2px', r: '2px' } + { w: 50, h: '100%', l: '2px', float: 'right' }, + { w: 50, h: '50%', t: '2px', r: '2px' }, ]; } else if ( (isPanoramic(ar1) && isPanoramic(ar2) && isNonConformingRatio(ar3)) || @@ -409,7 +409,7 @@ class MediaGallery extends React.PureComponent { itemsDimensions = [ { w: 50, h: panoSize_px, b: '2px', r: '2px' }, { w: 50, h: panoSize_px, b: '2px', l: '2px' }, - { w: 100, h: `${width - panoSize}px`, t: '2px' } + { w: 100, h: `${width - panoSize}px`, t: '2px' }, ]; } else if ( (isNonConformingRatio(ar1) && isPanoramic(ar2) && isPanoramic(ar3)) || @@ -424,7 +424,7 @@ class MediaGallery extends React.PureComponent { itemsDimensions = [ { w: 50, h: '50%', b: '2px', r: '2px' }, { w: 50, h: '50%', b: '2px', l: '2px' }, - { w: 100, h: `50%`, t: '2px' } + { w: 100, h: '50%', t: '2px' }, ]; } } else if (size == 4) { @@ -471,7 +471,7 @@ class MediaGallery extends React.PureComponent { { w: 67, h: '100%', r: '2px' }, { w: 33, h: '33%', b: '4px', l: '2px' }, { w: 33, h: '33%', l: '2px' }, - { w: 33, h: '33%', t: '4px', l: '2px' } + { w: 33, h: '33%', t: '4px', l: '2px' }, ]; } else { itemsDimensions = [ diff --git a/app/gabsocial/components/modal_root.js b/app/gabsocial/components/modal_root.js index 7964bcf89..59333bc08 100644 --- a/app/gabsocial/components/modal_root.js +++ b/app/gabsocial/components/modal_root.js @@ -19,7 +19,7 @@ const mapDispatchToProps = (dispatch) => ({ }, onCancelReplyCompose() { dispatch(cancelReplyCompose()); - } + }, }); class ModalRoot extends React.PureComponent { @@ -57,8 +57,7 @@ class ModalRoot extends React.PureComponent { onConfirm: () => onCancelReplyCompose(), onCancel: () => onOpenModal('COMPOSE'), }); - } - else { + } else { this.props.onClose(); } }; @@ -124,6 +123,7 @@ class ModalRoot extends React.PureComponent {
); } + } export default injectIntl(connect(mapStateToProps, mapDispatchToProps)(ModalRoot)); diff --git a/app/gabsocial/components/progress_bar.js b/app/gabsocial/components/progress_bar.js index eb10b653b..5ee94c75f 100644 --- a/app/gabsocial/components/progress_bar.js +++ b/app/gabsocial/components/progress_bar.js @@ -3,13 +3,15 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; export default class ProgressBar extends ImmutablePureComponent { + render() { const { progress } = this.props; return (
-
+
- ) + ); } + }; diff --git a/app/gabsocial/components/sidebar_menu.js b/app/gabsocial/components/sidebar_menu.js index 94517cb4a..582cdcb7b 100644 --- a/app/gabsocial/components/sidebar_menu.js +++ b/app/gabsocial/components/sidebar_menu.js @@ -27,11 +27,11 @@ const messages = defineMessages({ mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' }, filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' }, logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, - lists: { id: 'column.lists', defaultMessage: 'Lists', }, + lists: { id: 'column.lists', defaultMessage: 'Lists' }, apps: { id: 'tabs_bar.apps', defaultMessage: 'Apps' }, news: { id: 'tabs_bar.news', defaultMessage: 'News' }, donate: { id: 'donate', defaultMessage: 'Donate' }, -}) +}); const mapStateToProps = state => { const me = state.get('me'); @@ -92,7 +92,7 @@ class SidebarMenu extends ImmutablePureComponent {
- +
@@ -113,7 +113,7 @@ class SidebarMenu extends ImmutablePureComponent { {intl.formatMessage(messages.profile)} - + {intl.formatMessage(messages.messages)} diff --git a/app/gabsocial/components/status.js b/app/gabsocial/components/status.js index 71ab58ae1..dbe8bffcd 100644 --- a/app/gabsocial/components/status.js +++ b/app/gabsocial/components/status.js @@ -303,20 +303,22 @@ class Status extends ImmutablePureComponent { prepend = (
- - - - - - }} /> + + + + + , + }} + />
); rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} reposted' }, { name: status.getIn(['account', 'acct']) }); account = status.get('account'); - reblogContent = status.get('contentHtml') + reblogContent = status.get('contentHtml'); status = status.get('reblog'); } diff --git a/app/gabsocial/components/status_action_bar.js b/app/gabsocial/components/status_action_bar.js index 28e8434d6..e77946b25 100644 --- a/app/gabsocial/components/status_action_bar.js +++ b/app/gabsocial/components/status_action_bar.js @@ -298,6 +298,7 @@ class StatusActionBar extends ImmutablePureComponent {
); } + } const mapStateToProps = state => { @@ -314,4 +315,4 @@ const mapDispatchToProps = (dispatch) => ({ export default injectIntl( connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true } -)(StatusActionBar)) + )(StatusActionBar)); diff --git a/app/gabsocial/components/status_list.js b/app/gabsocial/components/status_list.js index d3b0dffd7..71785c2dc 100644 --- a/app/gabsocial/components/status_list.js +++ b/app/gabsocial/components/status_list.js @@ -141,7 +141,7 @@ export default class StatusList extends ImmutablePureComponent { , {scrollableContent} - + , ]; } diff --git a/app/gabsocial/components/timeline_queue_button_header.js b/app/gabsocial/components/timeline_queue_button_header.js index f50e736f6..8b0f17f5e 100644 --- a/app/gabsocial/components/timeline_queue_button_header.js +++ b/app/gabsocial/components/timeline_queue_button_header.js @@ -5,6 +5,7 @@ import { shortNumberFormat } from '../utils/numbers'; import classNames from 'classnames'; export default class TimelineQueueButtonHeader extends React.PureComponent { + static propTypes = { onClick: PropTypes.func.isRequired, count: PropTypes.number, @@ -20,7 +21,7 @@ export default class TimelineQueueButtonHeader extends React.PureComponent { const { count, itemType, onClick } = this.props; const classes = classNames('timeline-queue-header', { - 'hidden': (count <= 0) + 'hidden': (count <= 0), }); return ( @@ -38,4 +39,5 @@ export default class TimelineQueueButtonHeader extends React.PureComponent { ); } + } diff --git a/app/gabsocial/components/verification_badge.js b/app/gabsocial/components/verification_badge.js index de1e252eb..01a5fda28 100644 --- a/app/gabsocial/components/verification_badge.js +++ b/app/gabsocial/components/verification_badge.js @@ -2,8 +2,8 @@ import React from 'react'; import Icon from './icon'; const VerificationBadge = () => ( - - Verified Account + + Verified Account ); diff --git a/app/gabsocial/containers/gabsocial.js b/app/gabsocial/containers/gabsocial.js index c64767813..98a86ba09 100644 --- a/app/gabsocial/containers/gabsocial.js +++ b/app/gabsocial/containers/gabsocial.js @@ -40,8 +40,8 @@ const mapStateToProps = (state) => { return { showIntroduction, me, - } -} + }; +}; @connect(mapStateToProps) class GabSocialMount extends React.PureComponent { diff --git a/app/gabsocial/containers/status_container.js b/app/gabsocial/containers/status_container.js index cc9e1833d..561eb5e2e 100644 --- a/app/gabsocial/containers/status_container.js +++ b/app/gabsocial/containers/status_container.js @@ -31,7 +31,7 @@ import { boostModal, deleteModal } from '../initial_state'; import { showAlertForError } from '../actions/alerts'; import { createRemovedAccount, - groupRemoveStatus + groupRemoveStatus, } from '../actions/groups'; const messages = defineMessages({ diff --git a/app/gabsocial/features/account/components/header.js b/app/gabsocial/features/account/components/header.js index 295fea5b0..979e651e3 100644 --- a/app/gabsocial/features/account/components/header.js +++ b/app/gabsocial/features/account/components/header.js @@ -230,10 +230,10 @@ class Header extends ImmutablePureComponent { if (!account) { return (
-
+
-
+
{ isSmallScreen && @@ -296,15 +296,15 @@ class Header extends ImmutablePureComponent { { account.get('id') === me &&
- { /* : TODO : shortNumberFormat(account.get('favourite_count')) */ } - { /* : TODO : shortNumberFormat(account.get('pinned_count')) */ } @@ -327,9 +327,11 @@ class Header extends ImmutablePureComponent { {actionBtn} {account.get('id') !== me && } diff --git a/app/gabsocial/features/account_gallery/components/media_item.js b/app/gabsocial/features/account_gallery/components/media_item.js index 16f521d04..5d2625610 100644 --- a/app/gabsocial/features/account_gallery/components/media_item.js +++ b/app/gabsocial/features/account_gallery/components/media_item.js @@ -112,12 +112,12 @@ export default class MediaItem extends ImmutablePureComponent { /> ); } else if (['gifv', 'video'].indexOf(attachment.get('type')) !== -1) { - let conditionalAttributes = {} + let conditionalAttributes = {}; if (isIOS()) { - conditionalAttributes.playsInline = '1' + conditionalAttributes.playsInline = '1'; } if (autoPlayGif) { - conditionalAttributes.autoPlay = '1' + conditionalAttributes.autoPlay = '1'; } thumbnail = (
diff --git a/app/gabsocial/features/account_gallery/index.js b/app/gabsocial/features/account_gallery/index.js index 08993252d..916332692 100644 --- a/app/gabsocial/features/account_gallery/index.js +++ b/app/gabsocial/features/account_gallery/index.js @@ -27,8 +27,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; accountUsername = account ? account.getIn(['acct'], '') : ''; @@ -69,6 +68,7 @@ class LoadMoreMedia extends ImmutablePureComponent { /> ); } + } export default @connect(mapStateToProps) @@ -94,8 +94,7 @@ class AccountGallery extends ImmutablePureComponent { if (accountId && accountId !== -1) { this.props.dispatch(fetchAccount(accountId)); this.props.dispatch(expandAccountMediaTimeline(accountId)); - } - else { + } else { this.props.dispatch(fetchAccountByUsername(username)); } } @@ -190,7 +189,7 @@ class AccountGallery extends ImmutablePureComponent {
-
+
@@ -213,7 +212,7 @@ class AccountGallery extends ImmutablePureComponent { { attachments.size == 0 &&
- +
} diff --git a/app/gabsocial/features/account_timeline/index.js b/app/gabsocial/features/account_timeline/index.js index 56c1f9e90..06a9d9e2d 100644 --- a/app/gabsocial/features/account_timeline/index.js +++ b/app/gabsocial/features/account_timeline/index.js @@ -25,8 +25,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; accountUsername = account ? account.getIn(['acct'], '') : ''; @@ -79,8 +78,7 @@ class AccountTimeline extends ImmutablePureComponent { } this.props.dispatch(expandAccountTimeline(accountId, { withReplies })); - } - else { + } else { this.props.dispatch(fetchAccountByUsername(username)); } } @@ -137,7 +135,7 @@ class AccountTimeline extends ImmutablePureComponent { return (
-
+
diff --git a/app/gabsocial/features/auth_login/components/login_form.js b/app/gabsocial/features/auth_login/components/login_form.js index a8a5900c6..29fb3e567 100644 --- a/app/gabsocial/features/auth_login/components/login_form.js +++ b/app/gabsocial/features/auth_login/components/login_form.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 { createAuthApp, logIn } from 'gabsocial/actions/auth'; import { fetchMe } from 'gabsocial/actions/me'; @@ -7,9 +7,10 @@ import { Link } from 'react-router-dom'; export default @connect() class LoginForm extends ImmutablePureComponent { + constructor(props) { super(props); - this.state = {isLoading: false}; + this.state = { isLoading: false }; } componentWillMount() { @@ -28,9 +29,9 @@ class LoginForm extends ImmutablePureComponent { dispatch(logIn(username, password)).then(() => { return dispatch(fetchMe()); }).catch((error) => { - this.setState({isLoading: false}); + this.setState({ isLoading: false }); }); - this.setState({isLoading: true}); + this.setState({ isLoading: true }); event.preventDefault(); } @@ -52,6 +53,7 @@ class LoginForm extends ImmutablePureComponent {
- ) + ); } + } diff --git a/app/gabsocial/features/auth_login/components/login_page.js b/app/gabsocial/features/auth_login/components/login_page.js index 63724f733..2de7daa8f 100644 --- a/app/gabsocial/features/auth_login/components/login_page.js +++ b/app/gabsocial/features/auth_login/components/login_page.js @@ -1,5 +1,5 @@ import React from 'react'; -import { connect } from 'react-redux' +import { connect } from 'react-redux'; import { Redirect } from 'react-router-dom'; import ImmutablePureComponent from 'react-immutable-pure-component'; import LoginForm from './login_form'; @@ -10,10 +10,12 @@ const mapStateToProps = state => ({ export default @connect(mapStateToProps) class LoginPage extends ImmutablePureComponent { + render() { const { me } = this.props; if (me) return ; - return + return ; } + } diff --git a/app/gabsocial/features/compose/components/action_bar.js b/app/gabsocial/features/compose/components/action_bar.js index 7f106f62a..61c52e362 100644 --- a/app/gabsocial/features/compose/components/action_bar.js +++ b/app/gabsocial/features/compose/components/action_bar.js @@ -49,7 +49,7 @@ class ActionBar extends React.PureComponent { let menu = []; menu.push({ text: intl.formatMessage(messages.profile), to: `/@${meUsername}` }); - menu.push({ text: intl.formatMessage(messages.messages), to: `/messages` }); + menu.push({ text: intl.formatMessage(messages.messages), to: '/messages' }); menu.push(null); menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' }); menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' }); @@ -62,13 +62,14 @@ class ActionBar extends React.PureComponent { menu.push({ text: intl.formatMessage(messages.logout), to: '/auth/sign_out', action: onClickLogOut }); return ( -
+
); } + } 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 ( -
-
- -
-
-