mirror of
https://github.com/usatiuk/ustk-todolist.git
synced 2025-10-28 15:47:48 +01:00
22 lines
479 B
JavaScript
22 lines
479 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import TodosContainer from '../containers/TodosContainer';
|
|
|
|
export default class MainView extends React.PureComponent {
|
|
componentDidUpdate() {
|
|
const { user, history } = this.props;
|
|
if (!user.user && !user.dirty) {
|
|
history.replace('/login');
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return <TodosContainer />;
|
|
}
|
|
}
|
|
|
|
MainView.propTypes = {
|
|
user: PropTypes.any.isRequired,
|
|
history: PropTypes.any.isRequired,
|
|
};
|