Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
fix: 404 flash before redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-chase committed Aug 15, 2019
1 parent 34c02e4 commit 9215f87
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions packages/addons-website/src/components/404/404.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
import React from 'react';
import { settings } from 'carbon-components';
const { prefix } = settings;
const browser = typeof window !== 'undefined' && window;

class FourOhFour extends React.Component {
render() {
if (typeof document !== 'undefined') {
document.body.style.background = '#282828';
}
return (
<div className="page-content fourohfour">
<div className={`${prefix}--grid`}>
<div className={`${prefix}--row`}>
<div
className={`${prefix}--col-lg-12 ${prefix}--offset-lg-4 fourohfour-body`}>
<div className="fourohfour-body">
<h2 className="fourohfour-body__heading">
Something's wrong...
</h2>
<p className="fourohfour-body__text">
Sorry, we cannot find the page you are looking for.
</p>
<p className="fourohfour-body__text">
Maybe some of these most visited links will help you?
</p>
{this.props.children}
<h5 className="fourohfour-body__404">404</h5>
browser && (
<div className="page-content fourohfour">
<div className={`${prefix}--grid`}>
<div className={`${prefix}--row`}>
<div
className={`${prefix}--col-lg-12 ${prefix}--offset-lg-4 fourohfour-body`}>
<div className="fourohfour-body">
<h2 className="fourohfour-body__heading">
Something's wrong...
</h2>
<p className="fourohfour-body__text">
Sorry, we cannot find the page you are looking for.
</p>
<p className="fourohfour-body__text">
Maybe some of these most visited links will help you?
</p>
{this.props.children}
<h5 className="fourohfour-body__404">404</h5>
</div>
</div>
</div>
</div>
</div>
</div>
)
);
}
}
Expand Down

0 comments on commit 9215f87

Please sign in to comment.