diff --git a/app/soapbox/features/ui/components/image_loader.js b/app/soapbox/features/ui/components/image_loader.js index 4b699365b..99f7c2981 100644 --- a/app/soapbox/features/ui/components/image_loader.js +++ b/app/soapbox/features/ui/components/image_loader.js @@ -1,7 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { LoadingBar } from 'react-redux-loading-bar'; import ZoomableImage from './zoomable_image'; export default class ImageLoader extends React.PureComponent { @@ -138,7 +137,6 @@ export default class ImageLoader extends React.PureComponent { return (
- {loading ? ( ({ - loading: state.get('loadingBar')[ownProps.scope || 'default'], -}); - -export default connect(mapStateToProps)(LoadingBar.WrappedComponent); diff --git a/app/soapbox/features/ui/index.js b/app/soapbox/features/ui/index.js index 80b3b314d..02d1c0cee 100644 --- a/app/soapbox/features/ui/index.js +++ b/app/soapbox/features/ui/index.js @@ -10,7 +10,6 @@ import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types'; import NotificationsContainer from './containers/notifications_container'; -import LoadingBarContainer from './containers/loading_bar_container'; import ModalContainer from './containers/modal_container'; import { debounce } from 'lodash'; import { uploadCompose, resetCompose } from '../../actions/compose'; @@ -660,7 +659,6 @@ class UI extends React.PureComponent { {me && floatingActionButton} - {me && } diff --git a/app/soapbox/middleware/loading_bar.js b/app/soapbox/middleware/loading_bar.js deleted file mode 100644 index da8cc4c7d..000000000 --- a/app/soapbox/middleware/loading_bar.js +++ /dev/null @@ -1,25 +0,0 @@ -import { showLoading, hideLoading } from 'react-redux-loading-bar'; - -const defaultTypeSuffixes = ['PENDING', 'FULFILLED', 'REJECTED']; - -export default function loadingBarMiddleware(config = {}) { - const promiseTypeSuffixes = config.promiseTypeSuffixes || defaultTypeSuffixes; - - return ({ dispatch }) => next => (action) => { - if (action.type && !action.skipLoading) { - const [PENDING, FULFILLED, REJECTED] = promiseTypeSuffixes; - - const isPending = new RegExp(`${PENDING}$`, 'g'); - const isFulfilled = new RegExp(`${FULFILLED}$`, 'g'); - const isRejected = new RegExp(`${REJECTED}$`, 'g'); - - if (action.type.match(isPending)) { - dispatch(showLoading()); - } else if (action.type.match(isFulfilled) || action.type.match(isRejected)) { - dispatch(hideLoading()); - } - } - - return next(action); - }; -} diff --git a/app/soapbox/reducers/index.js b/app/soapbox/reducers/index.js index 5c050b133..2b7ecd23c 100644 --- a/app/soapbox/reducers/index.js +++ b/app/soapbox/reducers/index.js @@ -5,7 +5,6 @@ import dropdown_menu from './dropdown_menu'; import timelines from './timelines'; import meta from './meta'; import alerts from './alerts'; -import { loadingBarReducer } from 'react-redux-loading-bar'; import modal from './modal'; import user_lists from './user_lists'; import domain_lists from './domain_lists'; @@ -61,7 +60,6 @@ const appReducer = combineReducers({ timelines, meta, alerts, - loadingBar: loadingBarReducer, modal, user_lists, domain_lists, diff --git a/app/soapbox/store/configureStore.js b/app/soapbox/store/configureStore.js index 0e0d45c66..63f92cf53 100644 --- a/app/soapbox/store/configureStore.js +++ b/app/soapbox/store/configureStore.js @@ -1,14 +1,12 @@ import { createStore, applyMiddleware, compose } from 'redux'; 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/styles/loading.scss b/app/styles/loading.scss index 6f5f1736f..45145d1f2 100644 --- a/app/styles/loading.scss +++ b/app/styles/loading.scss @@ -148,14 +148,6 @@ animation: shake-bottom 0.8s cubic-bezier(0.455, 0.03, 0.515, 0.955) 2s 2 both; } -.loading-bar { - background-color: var(--highlight-text-color); - height: 3px; - position: absolute; - top: 0; - left: 0; -} - .load-more { display: block; color: var(--primary-text-color); diff --git a/app/styles/ui.scss b/app/styles/ui.scss index d05a18e4c..a51495ec8 100644 --- a/app/styles/ui.scss +++ b/app/styles/ui.scss @@ -279,10 +279,6 @@ object-fit: contain; } - .loading-bar { - position: relative; - } - &.image-loader--amorphous .image-loader__preview-canvas { display: none; } diff --git a/docs/store.md b/docs/store.md index 69f2ba1e4..34088ab8c 100644 --- a/docs/store.md +++ b/docs/store.md @@ -104,15 +104,6 @@ If it's not documented, it's because I inherited it from Mastodon and I don't kn alerts: [] ``` -- `loadingBar` - Managed by [react-redux-loading-bar](https://github.com/mironov/react-redux-loading-bar) - - Sample: - ``` - loadingBar: { - 'default': 0 - } - ``` - - `modal` Sample: diff --git a/package.json b/package.json index e497e8b2b..f06f4fa27 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,6 @@ "react-overlays": "^0.9.0", "react-popper": "^2.2.3", "react-redux": "^7.2.5", - "react-redux-loading-bar": "^5.0.0", "react-router-dom": "^4.3.1", "react-router-scroll-4": "^1.0.0-beta.1", "react-sparklines": "^1.7.0", diff --git a/yarn.lock b/yarn.lock index 7fb7cb9f5..3bc208261 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7879,14 +7879,6 @@ react-popper@^2.2.3, react-popper@^2.2.5: react-fast-compare "^3.0.1" warning "^4.0.2" -react-redux-loading-bar@^5.0.0: - version "5.0.2" - resolved "https://registry.yarnpkg.com/react-redux-loading-bar/-/react-redux-loading-bar-5.0.2.tgz#e62d527892b0a7682baa2ebbb3fd34c0b807e485" - integrity sha512-M+gK/Q79UG3iVljv6myRJptdQ5sIKdYDigeukwGocvWLCgWFdtpeP8IY8lBIYsqHXtuFBP/gj7E3qvGwCtcpRQ== - dependencies: - prop-types "^15.7.2" - react-lifecycles-compat "^3.0.4" - react-redux@^7.2.5: version "7.2.5" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.5.tgz#213c1b05aa1187d9c940ddfc0b29450957f6a3b8"