Skip to content

Commit 6409d1f

Browse files
committed
Disabled sub-nav links unless Component tab selected
1 parent c41b8cc commit 6409d1f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

source/demo/Application.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class Application extends Component {
132132
key={component}
133133
activeComponent={activeComponent}
134134
component={component}
135+
disabled={activeNavLink === NAV_LINKS.Wizard}
135136
setActiveComponent={setActiveComponent}
136137
/>
137138
))}
@@ -143,6 +144,7 @@ class Application extends Component {
143144
key={component}
144145
activeComponent={activeComponent}
145146
component={component}
147+
disabled={activeNavLink === NAV_LINKS.Wizard}
146148
setActiveComponent={setActiveComponent}
147149
/>
148150
))}

source/demo/ComponentLink.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
.ActiveComponentLink {
1919
color: #fff;
2020
}
21+
.DisabledComponentLink {
22+
pointer-events: none;
23+
opacity: 0.5;
24+
}
2125

2226
@media (max-width: 500px) {
2327
.ComponentLink {

source/demo/ComponentLink.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import React from 'react'
22
import cn from 'classnames'
33
import styles from './ComponentLink.css'
44

5-
export default function ComponentLink ({ activeComponent, component, setActiveComponent }) {
5+
export default function ComponentLink ({ activeComponent, component, disabled, setActiveComponent }) {
66
const classNames = cn(styles.ComponentLink, {
7-
[styles.ActiveComponentLink]: activeComponent === component
7+
[styles.ActiveComponentLink]: activeComponent === component,
8+
[styles.DisabledComponentLink]: disabled
89
})
910

1011
return (

0 commit comments

Comments
 (0)