fix(client): 404 page displays incorrectly

This commit is contained in:
Valeriy
2019-05-08 01:26:37 +03:00
committed by mrugesh
parent 087d8ea130
commit dd20e61d00
2 changed files with 11 additions and 7 deletions

View File

@ -13,6 +13,7 @@ import {
} from '../redux'; } from '../redux';
import FourOhFourPage from '../components/FourOhFour'; import FourOhFourPage from '../components/FourOhFour';
import Profile from '../components/profile/Profile'; import Profile from '../components/profile/Profile';
import { isBrowser } from '../../utils/index';
const propTypes = { const propTypes = {
fetchProfileForUser: PropTypes.func.isRequired, fetchProfileForUser: PropTypes.func.isRequired,
@ -45,16 +46,19 @@ const makeMapStateToProps = () => (state, props) => {
const mapDispatchToProps = dispatch => const mapDispatchToProps = dispatch =>
bindActionCreators({ fetchProfileForUser }, dispatch); bindActionCreators({ fetchProfileForUser }, dispatch);
class ShowFourOhFour extends Component { class ShowProfileOrFourOhFour extends Component {
componentDidMount() { componentDidMount() {
const { requestedUser, maybeUser, fetchProfileForUser } = this.props; const { requestedUser, maybeUser, fetchProfileForUser } = this.props;
if (isEmpty(requestedUser)) { if (isEmpty(requestedUser)) {
return fetchProfileForUser(maybeUser); fetchProfileForUser(maybeUser);
} }
return null;
} }
render() { render() {
if (!isBrowser()) {
return null;
}
const { isSessionUser, requestedUser, showLoading } = this.props; const { isSessionUser, requestedUser, showLoading } = this.props;
if (isEmpty(requestedUser)) { if (isEmpty(requestedUser)) {
if (showLoading) { if (showLoading) {
@ -74,10 +78,10 @@ class ShowFourOhFour extends Component {
} }
} }
ShowFourOhFour.displayName = 'ShowFourOhFour'; ShowProfileOrFourOhFour.displayName = 'ShowProfileOrFourOhFour';
ShowFourOhFour.propTypes = propTypes; ShowProfileOrFourOhFour.propTypes = propTypes;
export default connect( export default connect(
makeMapStateToProps, makeMapStateToProps,
mapDispatchToProps mapDispatchToProps
)(ShowFourOhFour); )(ShowProfileOrFourOhFour);

View File

@ -9,7 +9,7 @@
} }
.notfound-page-wrapper img { .notfound-page-wrapper img {
max-width: 380px; width: 380px;
margin-bottom: 1rem; margin-bottom: 1rem;
} }