This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/frontend/scenes/Collection/Collection.js
Tom Moor 1bef5ddccb Dashboard loading (#142)
* Fixed: Loading indicator never appears
Added: Loading indicator to dashboard when loading first results

* Less assumptions

* Fixes: Image uploads not working

* Fixes #136 - Keyboard shortcuts should work when editor is not focused

* Allow images to be dragged anywhere on document editor

* Fixes #137 - vertical alignment

* Restore shortcuts with editor focus

* Restore 'e' to edit current document
Fixed up ? to open keyboard shortcuts

* wip

* LoadinglistPlaceholder

* WIP

* Refactor

* DRY logic
2017-07-17 21:46:32 -07:00

41 lines
996 B
JavaScript

// @flow
import React from 'react';
import { observer, inject } from 'mobx-react';
import { Redirect } from 'react-router';
import _ from 'lodash';
import CollectionsStore from 'stores/CollectionsStore';
import CollectionStore from './CollectionStore';
import CenteredContent from 'components/CenteredContent';
import LoadingListPlaceholder from 'components/LoadingListPlaceholder';
type Props = {
collections: CollectionsStore,
match: Object,
};
@observer class Collection extends React.Component {
props: Props;
store: CollectionStore;
constructor(props) {
super(props);
this.store = new CollectionStore();
}
componentDidMount = () => {
const { id } = this.props.match.params;
this.store.fetchCollection(id);
};
render() {
return this.store.redirectUrl
? <Redirect to={this.store.redirectUrl} />
: <CenteredContent>
<LoadingListPlaceholder />
</CenteredContent>;
}
}
export default inject('collections')(Collection);