Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] 404 Page and dynamic titles #14

Merged
merged 3 commits into from
May 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[feat] 404 page
  • Loading branch information
Hamdrive committed May 14, 2022
commit 823c525629a0d30440bb3d92d991d99a38b54de1
1 change: 1 addition & 0 deletions src/assets/ErrorIllustration.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions src/components/errorResult/ErrorResult.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { Typography } from "@mui/material";
import { Box } from "@mui/system";
import React from "react";
import { Link } from "react-router-dom";
import ErrorIllustration from "../../assets/ErrorIllustration.svg";

export const ErrorResult = () => {
return (
<Box
sx={{
height: "calc(100vh - 170px)",
width: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
}}
component="section">
<Box
height="25rem"
width="100%"
alt="empty result"
src={ErrorIllustration}
component="img"></Box>
<Box component="section">
<Typography
sx={{
color: "#fff",
fontSize: {
xs: "1.2rem",
md: "1.5rem",
},
fontWeight: 400,
textAlign: "center",
}}
variant="h5"
component="h5">
Sorry, page not found.
</Typography>
<Link style={{ textDecoration: "none" }} to="/explore">
<Typography
sx={{
color: "#1a5bff",
fontSize: {
xs: "1rem",
md: "1.2rem",
},
fontWeight: 400,
borderBottom: "3px solid #1a5bff",
mx: "auto",
mt: "1rem",
width: "fit-content",
}}
variant="h5"
component="h5">
Return to Explore videos
</Typography>
</Link>
</Box>
</Box>
);
};
2 changes: 2 additions & 0 deletions src/components/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { EmptyResult } from "./emptyResult/EmptyResult";
import { PrivateCard } from "./PrivateCard/PrivateCard";
import { PlaylistModal } from "./playlistModal/PlaylistModal";
import { PlaylistCard } from "./playlistCard/PlaylistCard";
import { ErrorResult } from "./errorResult/ErrorResult";

export {
Navbar,
Expand All @@ -32,4 +33,5 @@ export {
PrivateCard,
PlaylistModal,
PlaylistCard,
ErrorResult,
};
7 changes: 6 additions & 1 deletion src/pages/error/Error.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react";
import { ErrorResult } from "../../components";

export const Error = () => {
return <div>404 Not Found</div>;
return (
<main className="wrapper p-1">
<ErrorResult />
</main>
);
};