This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d409ebd
commit 7c65457
Showing
15 changed files
with
349 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
html body #root { | ||
height: 100%; | ||
} |
17 changes: 17 additions & 0 deletions
17
...Integrando frontend e backend/gerenciador-tarefas-frontend/src/components/PrivateRoute.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from 'react'; | ||
|
||
import { Route, Redirect } from 'react-router-dom'; | ||
|
||
import { isLoggedIn } from '../utils/LoginManager'; | ||
|
||
export default ({ render, ...others }) => ( | ||
<Route {...others} render={isLoggedIn() | ||
? render | ||
: props => ( | ||
<Redirect to={{ | ||
pathname: '/login', | ||
state: { from: props.location } | ||
}} /> | ||
) | ||
} /> | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import { Route } from 'react-router-dom'; | ||
import { Layout } from 'antd'; | ||
|
||
// import HomePage from '../pages/HomePage'; | ||
// import TarefasPage from '../pages/TarefasPage'; | ||
// import SobrePage from '../pages/SobrePage'; | ||
|
||
const { Content } = Layout; | ||
|
||
export default class ContentRoutes extends Component { | ||
|
||
state = {} | ||
|
||
render() { | ||
return ( | ||
<Content style={{ margin: '24px 16px 0' }}> | ||
<div style={{ padding: 24, background: '#fff', minHeight: 360 }}> | ||
|
||
{/* <Route path="/" exact component={HomePage} /> | ||
<Route path="/tarefas" component={TarefasPage} /> | ||
<Route path="/sobre" component={SobrePage} /> */} | ||
|
||
</div> | ||
</Content> | ||
); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
08 - Integrando frontend e backend/gerenciador-tarefas-frontend/src/layouts/MainLayout.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.main-layout { | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
08 - Integrando frontend e backend/gerenciador-tarefas-frontend/src/layouts/SideMenu.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.side-menu-logo { | ||
height: 32px; | ||
line-height: 32px; | ||
background: rgba(255,255,255,.2); | ||
margin: 16px; | ||
text-align: center; | ||
} | ||
|
||
.side-menu-logo, h1 { | ||
color: white !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import React, { Component } from 'react'; | ||
|
||
import { Layout, Menu, Icon } from 'antd'; | ||
import { Link, withRouter } from 'react-router-dom'; | ||
|
||
import './SideMenu.css'; | ||
import { removeToken } from '../utils/LoginManager'; | ||
|
||
const { Sider } = Layout; | ||
|
||
const MENU_ITEMS = [ | ||
{ | ||
to: '/', | ||
text: 'Home', | ||
icon: 'home' | ||
}, { | ||
to: '/tarefas', | ||
text: 'Tarefas', | ||
icon: 'file-text' | ||
}, { | ||
to: '/sobre', | ||
text: 'Sobre', | ||
icon: "info-circle-o", | ||
} | ||
]; | ||
|
||
class SideMenu extends Component { | ||
|
||
state = { | ||
collapsed: false, | ||
}; | ||
|
||
_onCollapse = (collapsed, type) => { | ||
this.setState({ collapsed }); | ||
} | ||
|
||
_logout = () => { | ||
removeToken(); | ||
this.props.history.push('/'); | ||
} | ||
|
||
render() { | ||
const { collapsed } = this.state; | ||
|
||
const menuItems = MENU_ITEMS.map(item => ( | ||
<Menu.Item key={item.to} > | ||
<Link to={item.to}> | ||
<Icon type={item.icon} /> | ||
<span className="nav-text"> | ||
{item.text} | ||
</span> | ||
</Link> | ||
</Menu.Item > | ||
)); | ||
|
||
return ( | ||
<Sider | ||
breakpoint="md" | ||
collapsedWidth="0" | ||
onCollapse={this._onCollapse} | ||
collapsed={collapsed} | ||
> | ||
|
||
<div className="side-menu-logo" > | ||
<h1>Logotipo</h1> | ||
</div> | ||
|
||
<Menu theme="dark" mode="inline" | ||
selectedKeys={[this.props.location.pathname]} | ||
defaultSelectedKeys={['/']}> | ||
|
||
{menuItems} | ||
|
||
<Menu.Item > | ||
<a onClick={this._logout}> | ||
<Icon type="logout" /> | ||
<span className="nav-text"> | ||
Sair | ||
</span> | ||
</a> | ||
</Menu.Item > | ||
</Menu> | ||
|
||
</Sider> | ||
); | ||
} | ||
} | ||
|
||
export default withRouter(SideMenu); |
8 changes: 8 additions & 0 deletions
8
08 - Integrando frontend e backend/gerenciador-tarefas-frontend/src/pages/CadastroPage.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.cadastro-page-form { | ||
max-width: 500px; | ||
margin: 16px auto !important; | ||
padding: 24px !important; | ||
background: #fbfbfb; | ||
border: 1px solid #d9d9d9; | ||
border-radius: 6px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
08 - Integrando frontend e backend/gerenciador-tarefas-frontend/src/pages/LoginPage.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.login-page-form { | ||
max-width: 332px; | ||
margin: 16px auto !important; | ||
|
||
padding: 24px !important; | ||
background: #fbfbfb; | ||
border: 1px solid #d9d9d9; | ||
border-radius: 6px; | ||
} | ||
|
||
.login-page-form-button { | ||
width: 100%; | ||
} |
Oops, something went wrong.