Skip to content

Commit ceab8ea

Browse files
Merge pull request #3930 from OneCommunityGlobal/peterson-implement-404-page-improvements
Peterson implemented two improvements on the 404 page.
2 parents 8d943f5 + 0b019ae commit ceab8ea

3 files changed

Lines changed: 54 additions & 27 deletions

File tree

src/components/Logout/Logout.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Redirect } from 'react-router-dom';
1+
import { Redirect, useHistory } from 'react-router-dom';
22
import { useDispatch, useSelector } from 'react-redux';
33
import { Button, Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
44
import { boxStyle, boxStyleDark } from '~/styles';
@@ -8,6 +8,7 @@ import { logoutUser } from '../../actions/authActions';
88
function Logout({ setLogoutPopup, open }) {
99
const darkMode = useSelector(state => state.theme.darkMode);
1010
const dispatch = useDispatch();
11+
const redirect = useHistory();
1112

1213
const closePopup = () => {
1314
setLogoutPopup(false);
@@ -22,7 +23,8 @@ function Logout({ setLogoutPopup, open }) {
2223

2324
closePopup();
2425
dispatch(logoutUser());
25-
return <Redirect to="/login" auth={false} />;
26+
<Redirect to="/login" auth={false} />;
27+
return redirect.push('/login');
2628
};
2729

2830
return (

src/components/NotFound/NotFoundPage.jsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,29 @@ function NotFoundPage() {
1212
const darkMode = useSelector(state => state.theme.darkMode);
1313

1414
return (
15-
<div
16-
className={cn(styles.notFoundContainer, darkMode ? cn(styles.darkMode, styles.bgBlack) : '')}
17-
>
18-
<img
19-
className={styles.notFoundImage}
20-
src={darkMode ? NotFoundDarkImage : NotFoundImage}
21-
alt="Page Not Found"
22-
/>
23-
<div className={styles.notFoundText}>
24-
<h1>PAGE NOT FOUND</h1>
25-
<p>The rabbits have been nibbling the cables again...</p>
26-
<p>
27-
Maybe this will help{' '}
28-
<Link to="/" className={styles.backHomeLink}>
29-
Home
30-
</Link>
31-
</p>
15+
<div className={cn(styles.notFoundContainer, darkMode ? cn(styles.darkMode) : '')}>
16+
<div
17+
className={styles.notFoundContent}
18+
//prettier-ignore
19+
style={{border: `2px solid ${darkMode ? `#f1f1f1` : `#333`}`}}
20+
>
21+
<img
22+
className={styles.notFoundImage}
23+
src={darkMode ? NotFoundDarkImage : NotFoundImage}
24+
alt="Page Not Found"
25+
/>
26+
<div className={styles.notFoundText}>
27+
<h1 className={darkMode ? `text-light` : `text-dark`}>PAGE NOT FOUND</h1>
28+
<p className={darkMode ? `text-light` : `text-dark`}>
29+
The rabbits have been nibbling the cables again...
30+
</p>
31+
<p className={darkMode ? `text-light` : `text-dark`}>
32+
Maybe this will help{' '}
33+
<Link to="/" className={styles.backHomeLink}>
34+
Home
35+
</Link>
36+
</p>
37+
</div>
3238
</div>
3339
</div>
3440
);

src/components/NotFound/NotFoundPage.module.css

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,21 @@
33
flex-direction: column;
44
justify-content: center;
55
align-items: center;
6-
height: 100vh;
6+
height: 100%;
77
text-align: center;
8-
color: #333;
9-
background-color: #fff;
8+
width: 100%;
9+
position: absolute;
10+
top: 0;
11+
}
12+
13+
body,
14+
html {
15+
overflow: hidden;
16+
}
17+
.notFoundContent {
18+
padding: 5px;
19+
border-radius: 20px;
20+
width: 60%;
1021
}
1122

1223
.notFoundImage {
@@ -42,18 +53,26 @@
4253

4354
.darkMode {
4455
color: #f1f1f1;
56+
background-color: #121212;
57+
}
4558

46-
.notFoundImage {
47-
height: 38%;
48-
width: auto;
59+
@media (max-width: 1039px) {
60+
.notFoundContent {
61+
margin-top: 20rem;
4962
}
5063
}
5164

52-
.bgBlack {
53-
background-color: #121212;
65+
@media (max-width: 1200px) {
66+
.notFoundContent {
67+
width: 92%;
68+
}
5469
}
5570

5671
@media (max-width: 768px) {
72+
.notFoundContent {
73+
margin-top: 0rem;
74+
}
75+
5776
.notFoundText h1 {
5877
font-size: 1.5em;
5978
}

0 commit comments

Comments
 (0)