diff --git a/app/javascript/gabsocial/features/compose/containers/compose_form_container.js b/app/javascript/gabsocial/features/compose/containers/compose_form_container.js
index dab6aa88..0a6a3cb8 100644
--- a/app/javascript/gabsocial/features/compose/containers/compose_form_container.js
+++ b/app/javascript/gabsocial/features/compose/containers/compose_form_container.js
@@ -35,10 +35,11 @@ const mapStateToProps = (state, { replyToId }) => {
isUploading: !isMatch ? false : state.getIn(['compose', 'is_uploading']),
showSearch: !isMatch ? false : state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']),
anyMedia: !isMatch ? false : state.getIn(['compose', 'media_attachments']).size > 0,
- isModalOpen: !isMatch ? false : state.get('modal').modalType === 'COMPOSE',
+ isModalOpen: !isMatch ? false : state.getIn(['modal', 'modalType']) === 'COMPOSE',
quoteOfId: !isMatch ? null : state.getIn(['compose', 'quote_of_id']),
scheduledAt: !isMatch ? null : state.getIn(['compose', 'scheduled_at']),
account: state.getIn(['accounts', me]),
+ hasPoll: !isMatch ? false : state.getIn(['compose', 'poll']),
}
}
@@ -84,7 +85,7 @@ const mapDispatchToProps = (dispatch) => ({
function mergeProps(stateProps, dispatchProps, ownProps) {
return Object.assign({}, ownProps, {
...stateProps,
- ...dispatchProps
+ ...dispatchProps,
})
}
diff --git a/app/javascript/gabsocial/features/compose/containers/quoted_status_preview_container.js b/app/javascript/gabsocial/features/compose/containers/quoted_status_preview_container.js
deleted file mode 100644
index aad11a14..00000000
--- a/app/javascript/gabsocial/features/compose/containers/quoted_status_preview_container.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import QuotedStatusPreview from '../components/quoted_status_preview';
-
-const mapStateToProps = (state, { id }) => ({
- status: state.getIn(['statuses', id]),
- account: state.getIn(['accounts', state.getIn(['statuses', id, 'account'])]),
-});
-
-export default connect(mapStateToProps)(QuotedStatusPreview);
\ No newline at end of file
diff --git a/app/javascript/gabsocial/features/compose/util/counter.js b/app/javascript/gabsocial/features/compose/util/counter.js
index 700ba216..e38a7878 100644
--- a/app/javascript/gabsocial/features/compose/util/counter.js
+++ b/app/javascript/gabsocial/features/compose/util/counter.js
@@ -1,9 +1,9 @@
-import { urlRegex } from './url_regex';
+import { urlRegex } from './url_regex'
-const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx';
+const urlPlaceholder = 'xxxxxxxxxxxxxxxxxxxxxxx'
export function countableText(inputText) {
return inputText
.replace(urlRegex, urlPlaceholder)
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
-};
+}
diff --git a/app/javascript/gabsocial/features/follow_requests/follow_requests.js b/app/javascript/gabsocial/features/follow_requests/follow_requests.js
index e708a54e..e4a3571b 100644
--- a/app/javascript/gabsocial/features/follow_requests/follow_requests.js
+++ b/app/javascript/gabsocial/features/follow_requests/follow_requests.js
@@ -1,7 +1,7 @@
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
-import { debounce } from 'lodash';
+import debounce from 'lodash.debounce'
import { fetchFollowRequests, expandFollowRequests } from '../../actions/accounts';
import ColumnIndicator from '../../components/column_indicator';
import AccountAuthorize from './components/account_authorize';
diff --git a/app/javascript/gabsocial/features/followers.js b/app/javascript/gabsocial/features/followers.js
index c7884608..2051d06a 100644
--- a/app/javascript/gabsocial/features/followers.js
+++ b/app/javascript/gabsocial/features/followers.js
@@ -1,6 +1,6 @@
import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
-import { debounce } from 'lodash'
+import debounce from 'lodash.debounce'
import { defineMessages, injectIntl } from 'react-intl'
import {
fetchFollowers,
diff --git a/app/javascript/gabsocial/features/following.js b/app/javascript/gabsocial/features/following.js
index a2d92a52..e8fbf5a7 100644
--- a/app/javascript/gabsocial/features/following.js
+++ b/app/javascript/gabsocial/features/following.js
@@ -1,6 +1,6 @@
import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
-import { debounce } from 'lodash'
+import debounce from 'lodash.debounce'
import { defineMessages, injectIntl } from 'react-intl'
import {
fetchFollowing,
diff --git a/app/javascript/gabsocial/features/group_members.js b/app/javascript/gabsocial/features/group_members.js
index 861aaad8..19cf1f36 100644
--- a/app/javascript/gabsocial/features/group_members.js
+++ b/app/javascript/gabsocial/features/group_members.js
@@ -1,6 +1,6 @@
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
-import { debounce } from 'lodash';
+import debounce from 'lodash.debounce'
import {
fetchMembers,
expandMembers,
diff --git a/app/javascript/gabsocial/features/group_removed_accounts.js b/app/javascript/gabsocial/features/group_removed_accounts.js
index 98cc0ac5..1b6314ae 100644
--- a/app/javascript/gabsocial/features/group_removed_accounts.js
+++ b/app/javascript/gabsocial/features/group_removed_accounts.js
@@ -1,6 +1,6 @@
import ImmutablePureComponent from 'react-immutable-pure-component';
import ImmutablePropTypes from 'react-immutable-proptypes';
-import { debounce } from 'lodash';
+import debounce from 'lodash.debounce'
import ColumnIndicator from '../components/column_indicator';
import {
fetchRemovedAccounts,
diff --git a/app/javascript/gabsocial/features/groups_collection.js b/app/javascript/gabsocial/features/groups_collection.js
index c3e153af..c2a4e09d 100644
--- a/app/javascript/gabsocial/features/groups_collection.js
+++ b/app/javascript/gabsocial/features/groups_collection.js
@@ -12,6 +12,7 @@ const mapStateToProps = (state, { activeTab }) => ({
export default
@connect(mapStateToProps)
class GroupsCollection extends ImmutablePureComponent {
+
static propTypes = {
activeTab: PropTypes.string.isRequired,
dispatch: PropTypes.func.isRequired,
@@ -35,14 +36,32 @@ class GroupsCollection extends ImmutablePureComponent {
return
}
+ const halfCount = parseInt(groupIds.size / 2)
+
+ console.log("halfCount", halfCount)
+
return (
- {
- groupIds.map((groupId, i) => (
-
- ))
- }
+
+
+ {
+ groupIds.slice(0, halfCount).map((groupId, i) => (
+
+ ))
+ }
+
+
+
+
+ {
+ groupIds.slice(halfCount, groupIds.size).map((groupId, i) => (
+
+ ))
+ }
+
+
)
}
+
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/features/hashtag_timeline.js b/app/javascript/gabsocial/features/hashtag_timeline.js
index 42919b1b..403ec40f 100644
--- a/app/javascript/gabsocial/features/hashtag_timeline.js
+++ b/app/javascript/gabsocial/features/hashtag_timeline.js
@@ -1,5 +1,5 @@
import { FormattedMessage } from 'react-intl'
-import { isEqual } from 'lodash'
+import isEqual from 'lodash.isequal'
import { expandHashtagTimeline, clearTimeline } from '../actions/timelines'
import { connectHashtagStream } from '../actions/streaming'
import StatusListContainer from '../containers/status_list_container'
@@ -21,7 +21,7 @@ class HashtagTimeline extends PureComponent {
}
title = () => {
- let title = [this.props.params.id]
+ const title = [this.props.params.id]
if (this.additionalFor('any')) {
title.push(' ',
@@ -29,7 +29,7 @@ class HashtagTimeline extends PureComponent {
key='any'
id='hashtag.column_header.tag_mode.any'
values={{
- additional: this.additionalFor('any')
+ additional: this.additionalFor('any'),
}}
defaultMessage='or {additional}'
/>
@@ -42,7 +42,7 @@ class HashtagTimeline extends PureComponent {
key='all'
id='hashtag.column_header.tag_mode.all'
values={{
- additional: this.additionalFor('all')
+ additional: this.additionalFor('all'),
}}
defaultMessage='and {additional}'
/>
@@ -55,7 +55,7 @@ class HashtagTimeline extends PureComponent {
key='none'
id='hashtag.column_header.tag_mode.none'
values={{
- additional: this.additionalFor('none')
+ additional: this.additionalFor('none'),
}}
defaultMessage='without {additional}'
/>
@@ -76,13 +76,13 @@ class HashtagTimeline extends PureComponent {
}
_subscribe (dispatch, id, tags = {}) {
- let any = (tags.any || []).map(tag => tag.value)
- let all = (tags.all || []).map(tag => tag.value)
- let none = (tags.none || []).map(tag => tag.value);
+ const any = (tags.any || []).map(tag => tag.value)
+ const all = (tags.all || []).map(tag => tag.value)
+ const none = (tags.none || []).map(tag => tag.value);
[id, ...any].map(tag => {
this.disconnects.push(dispatch(connectHashtagStream(id, tag, status => {
- let tags = status.tags.map(tag => tag.name)
+ const tags = status.tags.map(tag => tag.name)
return all.filter(tag => tags.includes(tag)).length === all.length &&
none.filter(tag => tags.includes(tag)).length === 0
diff --git a/app/javascript/gabsocial/features/introduction.js b/app/javascript/gabsocial/features/introduction.js
index 40475a47..314c3079 100644
--- a/app/javascript/gabsocial/features/introduction.js
+++ b/app/javascript/gabsocial/features/introduction.js
@@ -5,7 +5,7 @@ import { closeOnboarding } from '../actions/onboarding';
// : todo :
-class FrameWelcome extends Component {
+class FrameWelcome extends React.Component {
static propTypes = {
domain: PropTypes.string.isRequired,
onNext: PropTypes.func.isRequired,
@@ -45,7 +45,7 @@ class FrameWelcome extends Component {
}
}
-class FrameFederation extends Component {
+class FrameFederation extends React.Component {
static propTypes = {
onNext: PropTypes.func.isRequired,
}
@@ -81,7 +81,7 @@ class FrameFederation extends Component {
}
};
-class FrameInteractions extends Component {
+class FrameInteractions extends React.Component {
static propTypes = {
onNext: PropTypes.func.isRequired,
};
diff --git a/app/javascript/gabsocial/features/liked_statuses.js b/app/javascript/gabsocial/features/liked_statuses.js
index a98fb5f7..90f22619 100644
--- a/app/javascript/gabsocial/features/liked_statuses.js
+++ b/app/javascript/gabsocial/features/liked_statuses.js
@@ -1,7 +1,7 @@
import ImmutablePropTypes from 'react-immutable-proptypes'
import { FormattedMessage } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
-import { debounce } from 'lodash'
+import debounce from 'lodash.debounce'
import { fetchFavoritedStatuses, expandFavoritedStatuses } from '../actions/favorites'
import { meUsername } from '../initial_state'
import StatusList from '../components/status_list'
diff --git a/app/javascript/gabsocial/features/mutes.js b/app/javascript/gabsocial/features/mutes.js
index 85aeab4d..860107be 100644
--- a/app/javascript/gabsocial/features/mutes.js
+++ b/app/javascript/gabsocial/features/mutes.js
@@ -1,7 +1,7 @@
import { injectIntl, FormattedMessage } from 'react-intl'
import ImmutablePureComponent from 'react-immutable-pure-component'
import ImmutablePropTypes from 'react-immutable-proptypes'
-import { debounce } from 'lodash'
+import debounce from 'lodash.debounce'
import { fetchMutes, expandMutes } from '../actions/mutes'
import AccountContainer from '../containers/account_container'
import ColumnIndicator from '../components/column_indicator'
diff --git a/app/javascript/gabsocial/features/notifications/notifications.js b/app/javascript/gabsocial/features/notifications/notifications.js
index c5b7df26..b8c99ed2 100644
--- a/app/javascript/gabsocial/features/notifications/notifications.js
+++ b/app/javascript/gabsocial/features/notifications/notifications.js
@@ -3,7 +3,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'
import { createSelector } from 'reselect'
import { List as ImmutableList } from 'immutable'
-import { debounce } from 'lodash'
+import debounce from 'lodash.debounce'
import {
expandNotifications,
scrollTopNotifications,
diff --git a/app/javascript/gabsocial/features/status/containers/detailed_status_container.js b/app/javascript/gabsocial/features/status/containers/detailed_status_container.js
index ba75857d..a9f207bc 100644
--- a/app/javascript/gabsocial/features/status/containers/detailed_status_container.js
+++ b/app/javascript/gabsocial/features/status/containers/detailed_status_container.js
@@ -50,7 +50,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
onReply (status, router) {
dispatch((_, getState) => {
- let state = getState();
+ const state = getState();
if (state.getIn(['compose', 'text']).trim().length !== 0) {
dispatch(openModal('CONFIRM', {
message: intl.formatMessage(messages.replyMessage),
diff --git a/app/javascript/gabsocial/features/status/status.js b/app/javascript/gabsocial/features/status/status.js
index 4f78ea5c..b0627f4b 100644
--- a/app/javascript/gabsocial/features/status/status.js
+++ b/app/javascript/gabsocial/features/status/status.js
@@ -33,7 +33,7 @@ import StatusContainer from '../../containers/status_container'
import { textForScreenReader, defaultMediaVisibility } from '../../components/status/status'
import ColumnIndicator from '../../components/column_indicator'
import Block from '../../components/block'
-import Comment from '../../components/comment'
+import CommentList from '../../components/comment_list'
const messages = defineMessages({
deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },
@@ -57,23 +57,52 @@ const makeMapStateToProps = () => {
username: props.params.username,
})
+ // : todo : if is comment (i.e. if any ancestorsIds) use comment not status
+
let ancestorsIds = Immutable.List()
- let descendantsIds = Immutable.List();
+ let descendantsIds = Immutable.List()
if (status) {
- ancestorsIds = ancestorsIds.withMutations(mutable => {
- let id = status.get('in_reply_to_id');
+ // ancestorsIds = ancestorsIds.withMutations(mutable => {
+ // let id = status.get('in_reply_to_id');
- while (id) {
- mutable.unshift(id);
- id = state.getIn(['contexts', 'inReplyTos', id]);
+ // while (id) {
+ // mutable.unshift(id);
+ // id = state.getIn(['contexts', 'inReplyTos', id]);
+ // }
+ // });
+
+ // // ONLY Direct descendants
+ // descendantsIds = state.getIn(['contexts', 'replies', status.get('id')])
+
+ let indent = -1
+ descendantsIds = descendantsIds.withMutations(mutable => {
+ const ids = [status.get('id')]
+
+ while (ids.length > 0) {
+ let id = ids.shift();
+ const replies = state.getIn(['contexts', 'replies', id])
+
+ if (status.get('id') !== id) {
+ mutable.push(Immutable.Map({
+ statusId: id,
+ indent: indent,
+ }))
+ }
+
+ if (replies) {
+ replies.reverse().forEach(reply => {
+ ids.unshift(reply)
+ });
+ indent++
+ indent = Math.min(2, indent)
+ }
}
- });
-
- // ONLY Direct descendants
- descendantsIds = state.getIn(['contexts', 'replies', status.get('id')])
+ })
}
+ console.log("descendantsIds:", descendantsIds)
+
return {
status,
ancestorsIds,
@@ -338,6 +367,7 @@ class Status extends ImmutablePureComponent {
renderChildren(list) {
console.log("list:", list)
+ return null
// : todo : comments
return list.map(id => (
}
- if (ancestorsIds && ancestorsIds.size > 0) {
- ancestors = this.renderChildren(ancestorsIds)
- }
+ // if (ancestorsIds && ancestorsIds.size > 0) {
+ // ancestors = this.renderChildren(ancestorsIds)
+ // }
if (descendantsIds && descendantsIds.size > 0) {
descendants = this.renderChildren(descendantsIds)
@@ -434,7 +464,7 @@ class Status extends ImmutablePureComponent {
}
- {descendants}
+
)
diff --git a/app/javascript/gabsocial/features/ui/util/wrapped_route.js b/app/javascript/gabsocial/features/ui/util/wrapped_route.js
index d2892b31..bdf44ca3 100644
--- a/app/javascript/gabsocial/features/ui/util/wrapped_route.js
+++ b/app/javascript/gabsocial/features/ui/util/wrapped_route.js
@@ -3,7 +3,7 @@ import BundleColumnError from '../../../components/bundle_column_error'
import Bundle from './bundle'
import { me } from '../../../initial_state'
-export default class WrappedRoute extends Component {
+export default class WrappedRoute extends PureComponent {
static propTypes = {
component: PropTypes.func.isRequired,
page: PropTypes.func.isRequired,
diff --git a/app/javascript/gabsocial/main.js b/app/javascript/gabsocial/main.js
index 9de42016..d427cb26 100644
--- a/app/javascript/gabsocial/main.js
+++ b/app/javascript/gabsocial/main.js
@@ -5,11 +5,7 @@ import { default as GabSocial, store } from './containers/gabsocial';
import ReactDOM from 'react-dom';
import ready from './ready';
-const perf = require('./performance');
-
function main() {
- perf.start('main()');
-
// : todo :
// if (window.history && history.replaceState) {
// const { pathname, search, hash } = window.location;
@@ -30,7 +26,6 @@ function main() {
require('offline-plugin/runtime').install();
store.dispatch(registerPushNotifications.register());
}
- perf.stop('main()');
});
}
diff --git a/app/javascript/gabsocial/middleware/sounds.js b/app/javascript/gabsocial/middleware/sounds.js
deleted file mode 100644
index 16752077..00000000
--- a/app/javascript/gabsocial/middleware/sounds.js
+++ /dev/null
@@ -1,58 +0,0 @@
-'use strict';
-
-const createAudio = sources => {
- const audio = new Audio();
- sources.forEach(({ type, src }) => {
- const source = document.createElement('source');
- source.type = type;
- source.src = src;
- audio.appendChild(source);
- });
- return audio;
-};
-
-const play = audio => {
- if (!audio.paused) {
- audio.pause();
- if (typeof audio.fastSeek === 'function') {
- audio.fastSeek(0);
- } else {
- audio.currentTime = 0;
- }
- }
-
- // audio.play();
-};
-
-export default function soundsMiddleware() {
- const soundCache = {
- boop: createAudio([
- {
- src: '/sounds/boop.ogg',
- type: 'audio/ogg',
- },
- {
- src: '/sounds/boop.mp3',
- type: 'audio/mpeg',
- },
- ]),
- ribbit: createAudio([
- {
- src: '/sounds/ribbit.ogg',
- type: 'audio/ogg',
- },
- {
- src: '/sounds/ribbit.mp3',
- type: 'audio/mpeg',
- },
- ]),
- };
-
- return () => next => action => {
- if (action.meta && action.meta.sound && soundCache[action.meta.sound]) {
- play(soundCache[action.meta.sound]);
- }
-
- return next(action);
- };
-};
diff --git a/app/javascript/gabsocial/pages/groups_page.js b/app/javascript/gabsocial/pages/groups_page.js
index e10fda75..53f1ae0a 100644
--- a/app/javascript/gabsocial/pages/groups_page.js
+++ b/app/javascript/gabsocial/pages/groups_page.js
@@ -11,7 +11,7 @@ const mapStateToProps = (state) => {
return {
isPro: account.get('is_pro'),
- }
+ }
}
const mapDispatchToProps = dispatch => ({
@@ -36,31 +36,31 @@ class GroupsPage extends PureComponent {
render() {
const { children, isPro, onOpenGroupCreateModal } = this.props
- let tabs = [
+ const actions = []
+ const tabs = [
{
title: 'Featured',
- to: '/groups'
+ to: '/groups',
},
{
title: 'New',
- to: '/groups/new'
+ to: '/groups/new',
},
{
title: 'My Groups',
- to: '/groups/browse/member'
+ to: '/groups/browse/member',
},
]
- let actions = []
if (isPro) {
- actions = [{
- icon: 'group-add',
+ actions.push({
+ icon: 'add',
onClick: onOpenGroupCreateModal,
- }]
+ })
tabs.push({
title: 'Admin',
- to: '/groups/browse/admin'
+ to: '/groups/browse/admin',
})
}
@@ -82,4 +82,5 @@ class GroupsPage extends PureComponent {
)
}
+
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/pages/lists_page.js b/app/javascript/gabsocial/pages/lists_page.js
index 625d2048..f5618455 100644
--- a/app/javascript/gabsocial/pages/lists_page.js
+++ b/app/javascript/gabsocial/pages/lists_page.js
@@ -31,8 +31,8 @@ class ListsPage extends PureComponent {
title='Lists'
actions={[
{
- icon: 'list-add',
- onClick: onOpenListCreateModal
+ icon: 'add',
+ onClick: onOpenListCreateModal,
},
]}
layout={(
@@ -48,4 +48,5 @@ class ListsPage extends PureComponent {
)
}
+
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/pages/profile_page.js b/app/javascript/gabsocial/pages/profile_page.js
index 34bfb13d..45d30ef5 100644
--- a/app/javascript/gabsocial/pages/profile_page.js
+++ b/app/javascript/gabsocial/pages/profile_page.js
@@ -13,7 +13,7 @@ import ProfileLayout from '../layouts/profile_layout'
const mapStateToProps = (state, { params: { username } }) => {
const accounts = state.getIn(['accounts'])
- const account = accounts.find(acct => username.toLowerCase() == acct.getIn(['acct'], '').toLowerCase())
+ const account = accounts.find(acct => username.toLowerCase() === acct.getIn(['acct'], '').toLowerCase())
const accountId = !!account ? account.get('id') : -1
const isBlocked = state.getIn(['relationships', accountId, 'blocked_by'], false)
@@ -33,6 +33,7 @@ const mapStateToProps = (state, { params: { username } }) => {
export default
@connect(mapStateToProps)
class ProfilePage extends ImmutablePureComponent {
+
static propTypes = {
children: PropTypes.node,
params: PropTypes.object.isRequired,
@@ -59,7 +60,7 @@ class ProfilePage extends ImmutablePureComponent {
const {
account,
children,
- unavailable
+ unavailable,
} = this.props
return (
@@ -86,4 +87,5 @@ class ProfilePage extends ImmutablePureComponent {
)
}
+
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/performance.js b/app/javascript/gabsocial/performance.js
deleted file mode 100644
index 4e379062..00000000
--- a/app/javascript/gabsocial/performance.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-//
-// Tools for performance debugging, only enabled in development mode.
-// Open up Chrome Dev Tools, then Timeline, then User Timing to see output.
-// Also see config/webpack/loaders/mark.js for the webpack loader marks.
-//
-
-let marky;
-
-if (process.env.NODE_ENV === 'development') {
- if (typeof performance !== 'undefined' && performance.setResourceTimingBufferSize) {
- // Increase Firefox's performance entry limit; otherwise it's capped to 150.
- // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1331135
- performance.setResourceTimingBufferSize(Infinity);
- }
- marky = require('marky');
- // allows us to easily do e.g. ReactPerf.printWasted() while debugging
- //window.ReactPerf = require('react-addons-perf');
- //window.ReactPerf.start();
-}
-
-export function start(name) {
- if (process.env.NODE_ENV === 'development') {
- marky.mark(name);
- }
-}
-
-export function stop(name) {
- if (process.env.NODE_ENV === 'development') {
- marky.stop(name);
- }
-}
diff --git a/app/javascript/gabsocial/reducers/compose.js b/app/javascript/gabsocial/reducers/compose.js
index df603e93..73fa7787 100644
--- a/app/javascript/gabsocial/reducers/compose.js
+++ b/app/javascript/gabsocial/reducers/compose.js
@@ -36,7 +36,7 @@ import {
COMPOSE_POLL_OPTION_REMOVE,
COMPOSE_POLL_SETTINGS_CHANGE,
COMPOSE_SCHEDULED_AT_CHANGE,
- COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY
+ COMPOSE_RICH_TEXT_EDITOR_CONTROLS_VISIBILITY,
} from '../actions/compose';
import { TIMELINE_DELETE } from '../actions/timelines';
import { STORE_HYDRATE } from '../actions/store';
diff --git a/app/javascript/gabsocial/reducers/modal.js b/app/javascript/gabsocial/reducers/modal.js
index 599a2443..028b0d83 100644
--- a/app/javascript/gabsocial/reducers/modal.js
+++ b/app/javascript/gabsocial/reducers/modal.js
@@ -1,17 +1,24 @@
-import { MODAL_OPEN, MODAL_CLOSE } from '../actions/modal';
+import Immutable from 'immutable'
+import {
+ MODAL_OPEN,
+ MODAL_CLOSE,
+} from '../actions/modal'
-const initialState = {
+const initialState = Immutable.Map({
modalType: null,
- modalProps: {},
-};
+ modalProps: null,
+})
export default function modal(state = initialState, action) {
switch(action.type) {
case MODAL_OPEN:
- return { modalType: action.modalType, modalProps: action.modalProps };
+ return state.withMutations(map => {
+ map.set('modalType', action.modalType)
+ map.set('modalProps', action.modalProps)
+ })
case MODAL_CLOSE:
- return initialState;
+ return initialState
default:
- return state;
+ return state
}
-};
+}
diff --git a/app/javascript/gabsocial/reducers/popover.js b/app/javascript/gabsocial/reducers/popover.js
index 69d53e14..47140b10 100644
--- a/app/javascript/gabsocial/reducers/popover.js
+++ b/app/javascript/gabsocial/reducers/popover.js
@@ -6,19 +6,19 @@ import {
const initialState = Immutable.Map({
popoverType: null,
- placement: null,
+ popoverProps: null,
})
export default function popoverMenu(state = initialState, action) {
switch (action.type) {
- case POPOVER_OPEN:
- return {
- popoverType: action.popoverType,
- popoverProps: action.popoverProps,
- }
- case POPOVER_CLOSE:
- return initialState
- default:
- return state
+ case POPOVER_OPEN:
+ return state.withMutations(map => {
+ map.set('popoverType', action.popoverType)
+ map.set('popoverProps', action.popoverProps)
+ })
+ case POPOVER_CLOSE:
+ return initialState
+ default:
+ return state
}
}
diff --git a/app/javascript/gabsocial/reducers/tenor.js b/app/javascript/gabsocial/reducers/tenor.js
index 5e9499d2..757261ba 100644
--- a/app/javascript/gabsocial/reducers/tenor.js
+++ b/app/javascript/gabsocial/reducers/tenor.js
@@ -7,7 +7,7 @@ import {
GIF_RESULTS_FETCH_FAIL,
GIF_CATEGORIES_FETCH_REQUEST,
GIF_CATEGORIES_FETCH_SUCCESS,
- GIF_CATEGORIES_FETCH_FAIL
+ GIF_CATEGORIES_FETCH_FAIL,
} from '../actions/tenor'
import { Map as ImmutableMap } from 'immutable'
@@ -22,34 +22,34 @@ const initialState = ImmutableMap({
export default function (state = initialState, action) {
switch (action.type) {
- case GIF_RESULTS_FETCH_REQUEST:
- case GIF_CATEGORIES_FETCH_REQUEST:
- return state.set('loading', true)
- case GIF_RESULTS_FETCH_SUCCESS:
- return state.withMutations(map => {
- map.set('results', action.results);
- map.set('error', false);
- map.set('loading', false);
- });
- case GIF_CATEGORIES_FETCH_SUCCESS:
- return state.withMutations(map => {
- map.set('categories', action.categories);
- map.set('error', false);
- map.set('loading', false);
- });
- case GIF_RESULTS_FETCH_FAIL:
- case GIF_CATEGORIES_FETCH_FAIL:
- return state.withMutations(map => {
- map.set('error', !!action.error);
- map.set('loading', false);
- });
- case GIFS_CLEAR_RESULTS:
- return state.set('results', [])
- case GIF_SET_SELECTED:
- return state.set('chosenUrl', action.url)
- case GIF_CHANGE_SEARCH_TEXT:
- return state.set('searchText', action.text.trim());
- default:
- return state
+ case GIF_RESULTS_FETCH_REQUEST:
+ case GIF_CATEGORIES_FETCH_REQUEST:
+ return state.set('loading', true)
+ case GIF_RESULTS_FETCH_SUCCESS:
+ return state.withMutations(map => {
+ map.set('results', action.results);
+ map.set('error', false);
+ map.set('loading', false);
+ });
+ case GIF_CATEGORIES_FETCH_SUCCESS:
+ return state.withMutations(map => {
+ map.set('categories', action.categories);
+ map.set('error', false);
+ map.set('loading', false);
+ });
+ case GIF_RESULTS_FETCH_FAIL:
+ case GIF_CATEGORIES_FETCH_FAIL:
+ return state.withMutations(map => {
+ map.set('error', !!action.error);
+ map.set('loading', false);
+ });
+ case GIFS_CLEAR_RESULTS:
+ return state.set('results', [])
+ case GIF_SET_SELECTED:
+ return state.set('chosenUrl', action.url)
+ case GIF_CHANGE_SEARCH_TEXT:
+ return state.set('searchText', action.text.trim());
+ default:
+ return state
}
}
\ No newline at end of file
diff --git a/app/javascript/gabsocial/service_worker/web_push_notifications.js b/app/javascript/gabsocial/service_worker/web_push_notifications.js
index a95c61b2..4eabf949 100644
--- a/app/javascript/gabsocial/service_worker/web_push_notifications.js
+++ b/app/javascript/gabsocial/service_worker/web_push_notifications.js
@@ -1,6 +1,6 @@
import IntlMessageFormat from 'intl-messageformat';
import locales from './web_push_locales';
-import { unescape } from 'lodash';
+import unescape from 'lodash.unescape'
const MAX_NOTIFICATIONS = 5;
const GROUP_TAG = 'tag';
diff --git a/app/javascript/gabsocial/store/configureStore.js b/app/javascript/gabsocial/store/configureStore.js
index 7e747284..95de065a 100644
--- a/app/javascript/gabsocial/store/configureStore.js
+++ b/app/javascript/gabsocial/store/configureStore.js
@@ -3,13 +3,11 @@ import thunk from 'redux-thunk';
import appReducer from '../reducers';
import loadingBarMiddleware from '../middleware/loading_bar';
import errorsMiddleware from '../middleware/errors';
-import soundsMiddleware from '../middleware/sounds';
export default function configureStore() {
return createStore(appReducer, compose(applyMiddleware(
thunk,
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
errorsMiddleware(),
- soundsMiddleware()
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
};
diff --git a/app/javascript/gabsocial/utils/is_mobile.js b/app/javascript/gabsocial/utils/is_mobile.js
index 1ad23018..893debd0 100644
--- a/app/javascript/gabsocial/utils/is_mobile.js
+++ b/app/javascript/gabsocial/utils/is_mobile.js
@@ -51,14 +51,14 @@ export function getScreenBreakpoint(width) {
export const getWindowDimension = () => {
const width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
const height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
-
+
return { width, height }
}
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream
let userTouching = false
-let listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false
+const listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false
function touchListener() {
userTouching = true
diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js
index 28327f32..124b52d6 100644
--- a/app/javascript/packs/public.js
+++ b/app/javascript/packs/public.js
@@ -33,7 +33,6 @@ function main ( ) {
//(Rjc) 2019-05-24 defined but never used
// const React = require('react');
const ReactDOM = require('react-dom');
- const Rellax = require('rellax');
const createHistory = require('history').createBrowserHistory;
const scrollToDetailedStatus = () => {
@@ -106,12 +105,6 @@ function main ( ) {
scrollToDetailedStatus();
}
- const parallaxComponents = document.querySelectorAll('.parallax');
-
- if (parallaxComponents.length > 0 ) {
- new Rellax('.parallax', { speed: -1 });
- }
-
if (document.body.classList.contains('with-modals')) {
const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
const scrollbarWidthStyle = document.createElement('style');
diff --git a/app/javascript/styles/global.css b/app/javascript/styles/global.css
index ae11103a..6e99308d 100644
--- a/app/javascript/styles/global.css
+++ b/app/javascript/styles/global.css
@@ -328,6 +328,10 @@ body {
background-color: #36e991;
}
+.backgroundColorBrandLightOpaque_onHover:hover {
+ background-color: rgba(54,233,145, 0.125)
+}
+
.backgroundColorBrand {
background-color: #21cf7a;
}
@@ -392,6 +396,10 @@ body {
fill: #21cf7a;
}
+.fillColorBrand_onHover:hover {
+ fill: #21cf7a;
+}
+
.fillColorSecondary {
fill: #666;
}
@@ -472,8 +480,8 @@ body {
max-height: 80vh;
}
-.heightMax60PX {
- max-height: 60px;
+.heightMax56PX {
+ max-height: 56px;
}
.heightMin50VH {
@@ -512,6 +520,10 @@ body {
height: 1px;
}
+.height40PX {
+ height: 40px;
+}
+
.height50PX {
height: 50px;
}
@@ -858,6 +870,10 @@ body {
margin-bottom: 10px;
}
+.mb5 {
+ margin-bottom: 5px;
+}
+
.mt10 {
margin-top: 10px;
}
diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb
index 114a868e..a875c718 100644
--- a/app/serializers/rest/status_serializer.rb
+++ b/app/serializers/rest/status_serializer.rb
@@ -85,8 +85,6 @@ class REST::StatusSerializer < ActiveModel::Serializer
def favourites_count
if instance_options && instance_options[:unfavourite]
- # Decrement counter
- # https://github.com/tootsuite/mastodon/issues/3166
object.favourites_count - 1
else
object.favourites_count
diff --git a/babel.config.js b/babel.config.js
index 55efafc4..7e07f77f 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -26,7 +26,6 @@ module.exports = (api) => {
case 'production':
envOptions.debug = false;
config.plugins.push(...[
- 'lodash',
[
'transform-react-remove-prop-types',
{
diff --git a/config/webpack/shared.js b/config/webpack/shared.js
index 16ee822b..23a3fa6d 100644
--- a/config/webpack/shared.js
+++ b/config/webpack/shared.js
@@ -14,12 +14,6 @@ const extensionGlob = `**/*{${settings.extensions.join(',')}}*`;
const entryPath = join(settings.source_path, settings.source_entry_path);
const packPaths = sync(join(entryPath, extensionGlob));
-console.log("localePackPaths", localePackPaths);
-console.log("packPaths:", packPaths);
-console.log("env:", env);
-console.log("settings:", settings);
-console.log("output:", output);
-
module.exports = {
entry: Object.assign(
packPaths.reduce((map, entry) => {
@@ -70,11 +64,10 @@ module.exports = {
plugins: [
new webpack.ProvidePlugin({
React: 'react',
- Component: ['react', 'Component'],
PureComponent: ['react', 'PureComponent'],
connect: ['react-redux', 'connect'],
PropTypes: 'prop-types',
- _s: `${resolve(settings.source_path)}/styles/global.css`
+ _s: `${resolve(settings.source_path)}/styles/global.css`,
}),
new webpack.EnvironmentPlugin(JSON.parse(JSON.stringify(env))),
new webpack.NormalModuleReplacementPlugin(
diff --git a/package.json b/package.json
index f7297127..563d962c 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,6 @@
"build:production": "cross-env RAILS_ENV=production NODE_ENV=production ./bin/webpack",
"manage:translations": "node ./config/webpack/translationRunner.js",
"start": "node ./streaming/index.js",
- "storybook": "start-storybook",
"test": "${npm_execpath} run test:lint && ${npm_execpath} run test:jest",
"test:lint": "eslint --ext=js .",
"test:jest": "cross-env NODE_ENV=test jest --coverage",
@@ -20,9 +19,6 @@
"type": "git",
"url": "https://code.gab.com/gab/social/gab-social"
},
- "sideEffects": [
- "*.scss"
- ],
"browserslist": [
"last 2 versions",
"IE >= 11",
@@ -62,6 +58,71 @@
},
"private": true,
"dependencies": {
+ "@clusterws/cws": "^0.14.0",
+ "array-includes": "^3.0.3",
+ "axios": "^0.19.0",
+ "blurhash": "^1.0.0",
+ "classnames": "^2.2.5",
+ "detect-passive-events": "^1.0.2",
+ "dotenv": "^8.0.0",
+ "draft-js": "^0.11.4",
+ "emoji-mart": "Gargron/emoji-mart#build",
+ "es6-symbol": "^3.1.1",
+ "escape-html": "^1.0.3",
+ "exif-js": "^2.3.0",
+ "express": "^4.17.1",
+ "glob": "^7.1.1",
+ "http-link-header": "^1.0.2",
+ "immutable": "^3.8.2",
+ "intersection-observer": "^0.5.1",
+ "intl": "^1.2.5",
+ "intl-messageformat": "^2.2.0",
+ "is-nan": "^1.2.1",
+ "lodash.debounce": "^4.0.8",
+ "lodash.isequal": "^4.5.0",
+ "lodash.isobject": "^3.0.2",
+ "lodash.pick": "^4.4.0",
+ "lodash.sample": "^4.2.1",
+ "lodash.throttle": "^4.1.1",
+ "lodash.unescape": "^4.0.1",
+ "npmlog": "^4.1.2",
+ "object-assign": "^4.1.1",
+ "object-fit-images": "^3.2.3",
+ "object.values": "^1.1.0",
+ "offline-plugin": "^5.0.7",
+ "pg": "^6.4.0",
+ "prop-types": "^15.5.10",
+ "punycode": "^2.1.0",
+ "rails-ujs": "^5.2.3",
+ "react": "^16.13.1",
+ "react-datepicker": "^2.14.1",
+ "react-dom": "^16.7.0",
+ "react-hotkeys": "^1.1.4",
+ "react-immutable-proptypes": "^2.1.0",
+ "react-immutable-pure-component": "^1.1.1",
+ "react-intl": "^2.9.0",
+ "react-motion": "^0.5.2",
+ "react-popper": "^1.3.7",
+ "react-redux": "^6.0.1",
+ "react-redux-loading-bar": "^4.0.8",
+ "react-router-dom": "^4.1.1",
+ "react-router-scroll-4": "^1.0.0-beta.1",
+ "react-stickynode": "^2.1.1",
+ "react-swipeable-views": "^0.13.0",
+ "redis": "^2.7.1",
+ "redux": "^4.0.1",
+ "redux-immutable": "^4.0.0",
+ "redux-thunk": "^2.2.0",
+ "requestidlecallback": "^0.3.0",
+ "reselect": "^4.0.0",
+ "stringz": "^1.0.0",
+ "substring-trie": "^1.0.2",
+ "throng": "^4.0.0",
+ "tiny-queue": "^0.2.1",
+ "uuid": "^3.1.0",
+ "websocket.js": "^0.1.12"
+ },
+ "devDependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-decorators": "^7.3.0",
@@ -74,111 +135,19 @@
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.3.4",
- "@clusterws/cws": "^0.14.0",
- "array-includes": "^3.0.3",
"autoprefixer": "^9.5.1",
- "axios": "^0.19.0",
+ "babel-eslint": "^10.0.1",
+ "babel-jest": "^24.8.0",
"babel-loader": "^8.0.5",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-preval": "^3.0.1",
"babel-plugin-react-intl": "^3.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"babel-runtime": "^6.26.0",
- "blurhash": "^1.0.0",
- "classnames": "^2.2.5",
"compression-webpack-plugin": "^2.0.0",
- "cron": "^1.8.2",
"cross-env": "^5.1.4",
"css-loader": "^2.1.1",
"cssnano": "^4.1.10",
- "detect-passive-events": "^1.0.2",
- "dotenv": "^8.0.0",
- "draft-js": "^0.11.4",
- "emoji-mart": "Gargron/emoji-mart#build",
- "es6-symbol": "^3.1.1",
- "escape-html": "^1.0.3",
- "exif-js": "^2.3.0",
- "express": "^4.17.1",
- "file-loader": "^3.0.1",
- "glob": "^7.1.1",
- "http-link-header": "^1.0.2",
- "immutable": "^3.8.2",
- "imports-loader": "^0.8.0",
- "intersection-observer": "^0.5.1",
- "intl": "^1.2.5",
- "intl-messageformat": "^2.2.0",
- "intl-relativeformat": "^2.2.0",
- "is-nan": "^1.2.1",
- "js-yaml": "^3.13.1",
- "lodash": "^4.7.11",
- "lodash.isobject": "^3.0.2",
- "mark-loader": "^0.1.6",
- "marky": "^1.2.1",
- "mini-css-extract-plugin": "^0.9.0",
- "mkdirp": "^0.5.1",
- "moment": "^2.24.0",
- "npmlog": "^4.1.2",
- "object-assign": "^4.1.1",
- "object-fit-images": "^3.2.3",
- "object.values": "^1.1.0",
- "offline-plugin": "^5.0.7",
- "path-complete-extname": "^1.0.0",
- "pg": "^6.4.0",
- "postcss-loader": "^3.0.0",
- "postcss-object-fit-images": "^1.1.2",
- "prop-types": "^15.5.10",
- "punycode": "^2.1.0",
- "rails-ujs": "^5.2.3",
- "react": "^16.12.0",
- "react-contenteditable": "^3.3.3",
- "react-datepicker": "^2.14.1",
- "react-dom": "^16.7.0",
- "react-hotkeys": "^1.1.4",
- "react-immutable-proptypes": "^2.1.0",
- "react-immutable-pure-component": "^1.1.1",
- "react-intl": "^2.9.0",
- "react-masonry-infinite": "^1.2.2",
- "react-motion": "^0.5.2",
- "react-notification": "^6.8.4",
- "react-overlays": "^0.8.3",
- "react-popper": "^1.3.7",
- "react-redux": "^6.0.1",
- "react-redux-loading-bar": "^4.0.8",
- "react-router-dom": "^4.1.1",
- "react-router-scroll-4": "^1.0.0-beta.1",
- "react-stickynode": "^2.1.1",
- "react-swipeable-views": "^0.13.0",
- "react-textarea-autosize": "^7.1.0",
- "react-toggle": "^4.0.1",
- "redis": "^2.7.1",
- "redux": "^4.0.1",
- "redux-immutable": "^4.0.0",
- "redux-thunk": "^2.2.0",
- "rellax": "^1.7.1",
- "requestidlecallback": "^0.3.0",
- "reselect": "^4.0.0",
- "rimraf": "^2.6.3",
- "sanitize-html": "^1.22.0",
- "sass": "^1.20.3",
- "sass-loader": "^7.0.3",
- "sass-resources-loader": "^2.0.1",
- "stringz": "^1.0.0",
- "style-loader": "^1.1.3",
- "substring-trie": "^1.0.2",
- "throng": "^4.0.0",
- "tiny-queue": "^0.2.1",
- "uglifyjs-webpack-plugin": "^2.1.2",
- "uuid": "^3.1.0",
- "webpack": "^4.41.5",
- "webpack-assets-manifest": "^3.1.1",
- "webpack-bundle-analyzer": "^3.1.0",
- "webpack-cli": "^3.3.2",
- "webpack-merge": "^4.2.1",
- "websocket.js": "^0.1.12"
- },
- "devDependencies": {
- "babel-eslint": "^10.0.1",
- "babel-jest": "^24.8.0",
"enzyme": "^3.8.0",
"enzyme-adapter-react-16": "^1.7.1",
"eslint": "^5.11.1",
@@ -186,12 +155,27 @@
"eslint-plugin-jsx-a11y": "~6.2.1",
"eslint-plugin-promise": "~4.1.1",
"eslint-plugin-react": "~7.12.1",
+ "file-loader": "^3.0.1",
+ "imports-loader": "^0.8.0",
"jest": "^24.8.0",
- "node-sass": "^4.13.1",
+ "js-yaml": "^3.13.1",
+ "mark-loader": "^0.1.6",
+ "mini-css-extract-plugin": "^0.9.0",
+ "mkdirp": "^0.5.1",
+ "path-complete-extname": "^1.0.0",
+ "postcss-loader": "^3.0.0",
+ "postcss-object-fit-images": "^1.1.2",
"raf": "^3.4.1",
"react-intl-translations-manager": "^5.0.3",
"react-test-renderer": "^16.7.0",
+ "rimraf": "^2.6.3",
+ "uglifyjs-webpack-plugin": "^2.1.2",
+ "webpack": "^4.41.5",
+ "webpack-assets-manifest": "^3.1.1",
+ "webpack-bundle-analyzer": "^3.1.0",
+ "webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.1",
+ "webpack-merge": "^4.2.1",
"yargs": "^12.0.5"
}
}
diff --git a/public/sounds/boop.mp3 b/public/sounds/boop.mp3
deleted file mode 100644
index bf9c3c1aaff40dea76ad82e3e853d2d32382bcea..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 12280
zcmeIYWl&u~*DiRlgB+aTP6!a(-QC@TySqCa+?}8a?(S~Eoj?eFu;7{?!OoDWxo_3X
zo$vm?x4x%p)#~ou)!on9dv*7!z2qc0-~ew>^wiYQka{b?yosiwl=7Q`e-lnFRxwpM
z2>^f!|E*^0XliZA;^JieR*q3smO(=yLU}8q$;nEpziFR;g7j}Z^sZ6Jn}W9%QxXFJ
z8k0cJrU-9!3UgU?B>=#W1^@^N2LK-5nnI2M08dr`;KT#~;QtH&;Jf5?sR;rAu#c*W
zno`Gk-3Pgy%jH$oIsO%yUZrWSIZ-yY+C1ToQmH;Nc_Au!q3Sg$o+sr!f4jz>r{`Kq
zW9te+8w(@KGkr@_9E%g}isQ_8dNX#j+ZqeP!#oWAE%-A0