From c4d8626abf81657288032a33625019742c0a1240 Mon Sep 17 00:00:00 2001 From: hello Date: Sat, 7 Dec 2024 06:48:44 +0000 Subject: [PATCH] Acho que esta --- frontend/src/App.js | 18 ++++++------ frontend/src/pages/NotFound.js | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 frontend/src/pages/NotFound.js diff --git a/frontend/src/App.js b/frontend/src/App.js index 95c5bc4..9dcd8ea 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,11 +1,7 @@ +// src/App.js import React from 'react'; - - import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import LoginPage from './pages/LoginPageMain'; // Ajuste o caminho conforme a estrutura de pastas - -import { ToastContainer } from 'react-toastify'; -import 'react-toastify/dist/ReactToastify.css'; +import LoginPage from './pages/LoginPageMain'; import RegisterPage from './pages/RegisterPage'; import StorysPage from './pages/StorysPage'; import HomePage from './pages/HomePagee'; @@ -15,10 +11,14 @@ import ThirdLayout from './layouts/ThirdLayout'; import Profile from './pages/Profile'; import CreateStory from './pages/CreateStory'; import Story from './pages/Story'; +import NotFound from './pages/NotFound'; // Importação da página 404 + +import { ToastContainer } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; function App() { return ( - + {/* Certifique-se de substituir "/StoryTime" pelo nome do seu repositório */} }> } /> @@ -39,11 +39,13 @@ function App() { } /> } /> + + {/* Rota para páginas não encontradas */} + } /> ); } - export default App; diff --git a/frontend/src/pages/NotFound.js b/frontend/src/pages/NotFound.js new file mode 100644 index 0000000..70cd7ca --- /dev/null +++ b/frontend/src/pages/NotFound.js @@ -0,0 +1,52 @@ +// src/pages/NotFound.js +import React from 'react'; +import { Link } from 'react-router-dom'; +import styled from 'styled-components'; + +const Container = styled.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 100vh; + background-color: #f8f9fa; + text-align: center; +`; + +const Title = styled.h1` + font-size: 4rem; + color: #343a40; +`; + +const Message = styled.p` + font-size: 1.5rem; + color: #6c757d; + margin-bottom: 2rem; +`; + +const HomeButton = styled(Link)` + padding: 0.75rem 1.5rem; + background-color: #007bff; + color: #fff; + border: none; + border-radius: 0.25rem; + text-decoration: none; + font-size: 1rem; + transition: background-color 0.3s ease; + + &:hover { + background-color: #0056b3; + } +`; + +const NotFound = () => { + return ( + + 404 + Oops! A página que você está procurando não foi encontrada. + Voltar para Home + + ); +}; + +export default NotFound;