Skip to content

Commit

Permalink
Componente de error 404 criado
Browse files Browse the repository at this point in the history
  • Loading branch information
felipemjesus committed Jul 30, 2020
1 parent b2ab0f9 commit c044420
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/PageDefault/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ const Main = styled.main`
padding-right: 5%;
`

export default ({ children }) => {
export default ({ children, className }) => {
return (
<>
<Menu />
<Main>
<Main className={className}>
{children}
</Main>
<Footer />
Expand Down
9 changes: 9 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ a {
min-height: calc(100vh - var(--bodyPaddingTop));
display: flex;
flex-direction: column;
}

.error404 {
text-align: center;
padding: 50px;
}

.error404 h3 {
text-transform: uppercase;
}
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import './index.css';
import Home from './pages/Home';
import CadastroVideo from './pages/cadastro/Video'
import CadastroCategoria from './pages/cadastro/Categoria'
import PaginaErro404 from './pages/PaginaErro404'

ReactDOM.render(
<BrowserRouter>
<Switch>
<Route path="/" component={Home} exact />
<Route path="/cadastro/video" component={CadastroVideo} />
<Route path="/cadastro/categoria" component={CadastroCategoria} />
<Route component={() => 'Página 404'} />
<Route component={PaginaErro404} />
</Switch>
</BrowserRouter>,
document.getElementById('root')
Expand Down
11 changes: 11 additions & 0 deletions src/pages/PaginaErro404/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react'
import PageDefault from '../../components/PageDefault'

export default () => {
return (
<PageDefault className="error404">
<h1>404</h1>
<h3>Página não encontrada</h3>
</PageDefault>
)
}

1 comment on commit c044420

@vercel
Copy link

@vercel vercel bot commented on c044420 Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.