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

Added a navigation menu #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 11 additions & 0 deletions src/components/header/PageHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ import React from 'react';
import PropTypes from 'prop-types';
import './PageHeader.css';
import ToggleButton from '../toggleButton/ToggleButton';
import Menu from '../menu/Menu';

const menuOptions = [
{
label: 'Home',
link: '/'
}
];

const PageHeader = ({ drawerClickHandler }) => {
return (
<header className="page-header">
<Menu
options={menuOptions}
/>
<ToggleButton className="header-toggle-button" click={drawerClickHandler} />
<h1>SOLUCIONARIO - POSCOMP</h1>
</header>
Expand Down
31 changes: 31 additions & 0 deletions src/components/menu/Menu.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ul, li {
list-style-type:none;
}
.Menu--container {
display: block;
width: 100%;
height: 50px;
text-align: right;
background: #000;
color: #fff;
border-radius: 25px;
}
.Menu__option {
height: 100%;
display: inline-block;
padding: 16px;
-webkit-transition: ease-in-out .2s;
-o-transition: ease-in-out .2s;
transition: ease-in-out .2s;
border-radius: 30px;
}
.Menu__option:hover {
color: #000;
background: #fff;
cursor: pointer;
}
.MenuOption {
color: inherit;
text-decoration: none;
text-transform: uppercase;
}
21 changes: 21 additions & 0 deletions src/components/menu/Menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import MenuOption from './MenuOption';
import './Menu.css';

const Menu = ({ options }) =>
<div className="Menu--container">
<ul className="Menu__options">
{
options.map(({ label, link }) =>
<li className="Menu__option">
<MenuOption
label={label}
link={link}
/>
</li>
)
}
</ul>
</div>

export default Menu;
9 changes: 9 additions & 0 deletions src/components/menu/MenuOption.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

const MenuOption = ({ label, link }) =>
<a href={link} className="MenuOption">
{label}
</a>


export default MenuOption;