Skip to content

Commit

Permalink
Fix collapsible nav props (#18)
Browse files Browse the repository at this point in the history
* Fix collapsible nav props

* Bump to 1.4.1
  • Loading branch information
ariefrahmansyah authored Apr 29, 2021
1 parent 2da6b3f commit 425ee80
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gojek/mlp-ui",
"version": "1.4.0",
"version": "1.4.1",
"private": true,
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions ui/packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "mlp-ui",
"version": "1.4.0",
"version": "1.4.1",
"private": true,
"license": "Apache-2.0",
"dependencies": {
"@elastic/datemath": "5.0.3",
"@elastic/eui": "31.10.0",
"@gojek/mlp-ui": "1.4.0",
"@gojek/mlp-ui": "1.4.1",
"@reach/router": "1.3.3",
"@sentry/browser": "5.15.5",
"moment": "2.25.3",
Expand Down
2 changes: 1 addition & 1 deletion ui/packages/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gojek/mlp-ui",
"version": "1.4.0",
"version": "1.4.1",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
39 changes: 18 additions & 21 deletions ui/packages/lib/src/components/nav_drawer/NavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
EuiHeaderSectionItemButton,
EuiIcon,
EuiFlexItem,
EuiSpacer,
EuiShowFor
EuiSpacer
} from "@elastic/eui";
import ApplicationsContext from "../../providers/application/context";
import { CurrentProjectContext } from "../../providers/project";
Expand Down Expand Up @@ -68,7 +67,7 @@ export const NavDrawer = ({ homeUrl = "/", docLinks }) => {
<EuiFlexItem grow={true}>
{mlpLinks.length > 0 && (
<EuiCollapsibleNavGroup
isCollapsible={false}
isCollapsible={true}
initialIsOpen={appExpanded}
onToggle={toggleAppExpanded}
iconType="apps"
Expand All @@ -88,7 +87,7 @@ export const NavDrawer = ({ homeUrl = "/", docLinks }) => {
<EuiCollapsibleNavGroup
title="Learn"
iconType="training"
isCollapsible={false}
isCollapsible={true}
initialIsOpen={docsExpanded}
onToggle={toggleDocsExpanded}>
<EuiListGroup
Expand Down Expand Up @@ -120,23 +119,21 @@ export const NavDrawer = ({ homeUrl = "/", docLinks }) => {
<EuiHorizontalRule margin="none" />

<EuiFlexItem grow={false}>
<EuiShowFor sizes={["l", "xl"]}>
<EuiCollapsibleNavGroup>
<EuiListGroupItem
size="s"
color="subdued"
label={`${navIsDocked ? "Undock" : "Dock"} navigation`}
onClick={() => {
setNavIsDocked(!navIsDocked);
localStorage.setItem(
'mlp-navIsDocked',
JSON.stringify(!navIsDocked)
);
}}
iconType={navIsDocked ? "lock" : "lockOpen"}
/>
</EuiCollapsibleNavGroup>
</EuiShowFor>
<EuiCollapsibleNavGroup>
<EuiListGroupItem
size="s"
color="subdued"
label={`${navIsDocked ? "Undock" : "Dock"} navigation`}
onClick={() => {
setNavIsDocked(!navIsDocked);
localStorage.setItem(
'mlp-navIsDocked',
JSON.stringify(!navIsDocked)
);
}}
iconType={navIsDocked ? "lock" : "lockOpen"}
/>
</EuiCollapsibleNavGroup>
</EuiFlexItem>
</EuiFlexGroup>
</EuiCollapsibleNav>
Expand Down

0 comments on commit 425ee80

Please sign in to comment.