Merge branch 'remove-react-redux-loading-bar' into 'develop'
Rip out react-redux-loading-bar See merge request soapbox-pub/soapbox-fe!771
This commit is contained in:
commit
1c8ccb5a4a
|
@ -1,7 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { LoadingBar } from 'react-redux-loading-bar';
|
|
||||||
import ZoomableImage from './zoomable_image';
|
import ZoomableImage from './zoomable_image';
|
||||||
|
|
||||||
export default class ImageLoader extends React.PureComponent {
|
export default class ImageLoader extends React.PureComponent {
|
||||||
|
@ -138,7 +137,6 @@ export default class ImageLoader extends React.PureComponent {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
<LoadingBar loading={loading ? 1 : 0} className='loading-bar' style={{ width: this.state.width || width }} />
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<canvas
|
<canvas
|
||||||
className='image-loader__preview-canvas'
|
className='image-loader__preview-canvas'
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
import { connect } from 'react-redux';
|
|
||||||
import LoadingBar from 'react-redux-loading-bar';
|
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => ({
|
|
||||||
loading: state.get('loadingBar')[ownProps.scope || 'default'],
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps)(LoadingBar.WrappedComponent);
|
|
|
@ -10,7 +10,6 @@ import PropTypes from 'prop-types';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types';
|
import SoapboxPropTypes from 'soapbox/utils/soapbox_prop_types';
|
||||||
import NotificationsContainer from './containers/notifications_container';
|
import NotificationsContainer from './containers/notifications_container';
|
||||||
import LoadingBarContainer from './containers/loading_bar_container';
|
|
||||||
import ModalContainer from './containers/modal_container';
|
import ModalContainer from './containers/modal_container';
|
||||||
import { debounce } from 'lodash';
|
import { debounce } from 'lodash';
|
||||||
import { uploadCompose, resetCompose } from '../../actions/compose';
|
import { uploadCompose, resetCompose } from '../../actions/compose';
|
||||||
|
@ -660,7 +659,6 @@ class UI extends React.PureComponent {
|
||||||
{me && floatingActionButton}
|
{me && floatingActionButton}
|
||||||
|
|
||||||
<NotificationsContainer />
|
<NotificationsContainer />
|
||||||
<LoadingBarContainer className='loading-bar' />
|
|
||||||
<ModalContainer />
|
<ModalContainer />
|
||||||
<UploadArea active={draggingOver} onClose={this.closeUploadModal} />
|
<UploadArea active={draggingOver} onClose={this.closeUploadModal} />
|
||||||
{me && <SidebarMenu />}
|
{me && <SidebarMenu />}
|
||||||
|
|
|
@ -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);
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -5,7 +5,6 @@ import dropdown_menu from './dropdown_menu';
|
||||||
import timelines from './timelines';
|
import timelines from './timelines';
|
||||||
import meta from './meta';
|
import meta from './meta';
|
||||||
import alerts from './alerts';
|
import alerts from './alerts';
|
||||||
import { loadingBarReducer } from 'react-redux-loading-bar';
|
|
||||||
import modal from './modal';
|
import modal from './modal';
|
||||||
import user_lists from './user_lists';
|
import user_lists from './user_lists';
|
||||||
import domain_lists from './domain_lists';
|
import domain_lists from './domain_lists';
|
||||||
|
@ -61,7 +60,6 @@ const appReducer = combineReducers({
|
||||||
timelines,
|
timelines,
|
||||||
meta,
|
meta,
|
||||||
alerts,
|
alerts,
|
||||||
loadingBar: loadingBarReducer,
|
|
||||||
modal,
|
modal,
|
||||||
user_lists,
|
user_lists,
|
||||||
domain_lists,
|
domain_lists,
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
import { createStore, applyMiddleware, compose } from 'redux';
|
import { createStore, applyMiddleware, compose } from 'redux';
|
||||||
import thunk from 'redux-thunk';
|
import thunk from 'redux-thunk';
|
||||||
import appReducer from '../reducers';
|
import appReducer from '../reducers';
|
||||||
import loadingBarMiddleware from '../middleware/loading_bar';
|
|
||||||
import errorsMiddleware from '../middleware/errors';
|
import errorsMiddleware from '../middleware/errors';
|
||||||
import soundsMiddleware from '../middleware/sounds';
|
import soundsMiddleware from '../middleware/sounds';
|
||||||
|
|
||||||
export default function configureStore() {
|
export default function configureStore() {
|
||||||
return createStore(appReducer, compose(applyMiddleware(
|
return createStore(appReducer, compose(applyMiddleware(
|
||||||
thunk,
|
thunk,
|
||||||
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
|
||||||
errorsMiddleware(),
|
errorsMiddleware(),
|
||||||
soundsMiddleware(),
|
soundsMiddleware(),
|
||||||
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
||||||
|
|
|
@ -148,14 +148,6 @@
|
||||||
animation: shake-bottom 0.8s cubic-bezier(0.455, 0.03, 0.515, 0.955) 2s 2 both;
|
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 {
|
.load-more {
|
||||||
display: block;
|
display: block;
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
|
|
|
@ -279,10 +279,6 @@
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-bar {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.image-loader--amorphous .image-loader__preview-canvas {
|
&.image-loader--amorphous .image-loader__preview-canvas {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,15 +104,6 @@ If it's not documented, it's because I inherited it from Mastodon and I don't kn
|
||||||
alerts: []
|
alerts: []
|
||||||
```
|
```
|
||||||
|
|
||||||
- `loadingBar` - Managed by [react-redux-loading-bar](https://github.com/mironov/react-redux-loading-bar)
|
|
||||||
|
|
||||||
Sample:
|
|
||||||
```
|
|
||||||
loadingBar: {
|
|
||||||
'default': 0
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
- `modal`
|
- `modal`
|
||||||
|
|
||||||
Sample:
|
Sample:
|
||||||
|
|
|
@ -125,7 +125,6 @@
|
||||||
"react-overlays": "^0.9.0",
|
"react-overlays": "^0.9.0",
|
||||||
"react-popper": "^2.2.3",
|
"react-popper": "^2.2.3",
|
||||||
"react-redux": "^7.2.5",
|
"react-redux": "^7.2.5",
|
||||||
"react-redux-loading-bar": "^5.0.0",
|
|
||||||
"react-router-dom": "^4.3.1",
|
"react-router-dom": "^4.3.1",
|
||||||
"react-router-scroll-4": "^1.0.0-beta.1",
|
"react-router-scroll-4": "^1.0.0-beta.1",
|
||||||
"react-sparklines": "^1.7.0",
|
"react-sparklines": "^1.7.0",
|
||||||
|
|
|
@ -7879,14 +7879,6 @@ react-popper@^2.2.3, react-popper@^2.2.5:
|
||||||
react-fast-compare "^3.0.1"
|
react-fast-compare "^3.0.1"
|
||||||
warning "^4.0.2"
|
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:
|
react-redux@^7.2.5:
|
||||||
version "7.2.5"
|
version "7.2.5"
|
||||||
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.5.tgz#213c1b05aa1187d9c940ddfc0b29450957f6a3b8"
|
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.5.tgz#213c1b05aa1187d9c940ddfc0b29450957f6a3b8"
|
||||||
|
|
Loading…
Reference in New Issue