Skip to content

Commit

Permalink
feat(responsiveness): add responsivenss to navigation menu
Browse files Browse the repository at this point in the history
  • Loading branch information
navish committed Jun 4, 2019
1 parent d6fb876 commit 74a4658
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/NavigationMenu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,21 @@ const NavigationMenuItem = ({ name, icon, path, disabled, description }) => (
*/
const NavigationMenu = ({ routes, match }) => {
let url = '';
let colSpan = 12;
let colSpan = { span: 12 };

if (match) {
({ url } = match);
}

if (routes.length > 4) {
colSpan = 8;
colSpan = { xxl: 8, xl: 8, lg: 8, md: 8, sm: 12, xs: 12 };
}

return (
<div className="NavigationMenu">
<Row type="flex" align="middle">
{routes.map(route => (
<Col key={route.path} span={colSpan}>
<Col key={route.path} {...colSpan}>
<NavigationMenuItem
name={route.name}
icon={route.icon}
Expand Down
12 changes: 12 additions & 0 deletions src/components/NavigationMenu/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
.NavigationMenu .NavigationMenuItem .text-disabled {
color: #a0b0b8;
}

@media screen and (max-width: 768px) {
.NavigationMenu {
width: 80%;
}
}

@media screen and (max-width: 426px) {
.NavigationMenu {
width: 100%;
}
}

0 comments on commit 74a4658

Please sign in to comment.