Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Update: review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
MadanKumarGovindaswamy committed May 21, 2024
1 parent 6803d0a commit cee03bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
18 changes: 17 additions & 1 deletion packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ class NavigationSideMenu extends Component {
const listMenuItems = this.menuContainer && this.menuContainer.querySelectorAll('[data-menu-item]');
const currentIndex = Array.from(listMenuItems).indexOf(event.target);
const lastIndex = listMenuItems.length - 1;

if (event.nativeEvent.keyCode === KeyCode.KEY_ESCAPE) {
const parentKey = this.state.parents[this.props.selectedMenuKey];
if (parentKey) {

Check failure on line 268 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 6 spaces but found 8
this.handleBackClick(event);

Check failure on line 269 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 10
} else if (this.props.routingStackBack) {

Check failure on line 270 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 6 spaces but found 8
this.props.routingStackBack();

Check failure on line 271 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 8 spaces but found 10
}

Check failure on line 272 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Expected indentation of 6 spaces but found 8
}

Check failure on line 274 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Trailing spaces not allowed
if (event.nativeEvent.keyCode === KeyCode.KEY_SPACE || event.nativeEvent.keyCode === KeyCode.KEY_RETURN) {
event.preventDefault();
if (!item.isDisabled) {
Expand Down Expand Up @@ -408,6 +418,12 @@ class NavigationSideMenu extends Component {
theme.className,
]);

const titleStyles = cx([
'title',
{ 'nav-side-menu-title' : (variant === VARIANTS.NAVIGATION_SIDE_MENU) },

Check failure on line 423 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Extra space after key 'nav-side-menu-title'
{ '.drill-in-title' : (variant === VARIANTS.DRILL_IN) },

Check failure on line 424 in packages/terra-navigation-side-menu/src/NavigationSideMenu.jsx

View workflow job for this annotation

GitHub Actions / build

Extra space after key '.drill-in-title'
]);

let header;
if (this.onBack || (currentItem && !currentItem.isRootMenu)) {
header = (
Expand All @@ -423,7 +439,7 @@ class NavigationSideMenu extends Component {
data-navigation-side-menu
>
{(this.onBack) ? <span className={cx(['header-icon', 'back'])} /> : null}
<HeaderElement className={(variant === VARIANTS.DRILL_IN) ? cx('drill-in-title') : cx('title')}>{currentItem ? currentItem.text : null}</HeaderElement>
<HeaderElement className={titleStyles}>{currentItem ? currentItem.text : null}</HeaderElement>
</div>
{toolbar}
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@

.title {
color: var(--terra-navigation-side-menu-header-color);
font-size: var(--terra-navigation-side-menu-font-size, 1.10714rem);
font-weight: var(--terra-navigation-side-menu-font-weight, 500);
hyphens: auto;
margin: 5px;
overflow-wrap: break-word; /* Modern browsers */
Expand All @@ -85,14 +83,12 @@
word-wrap: break-word; /* For IE 10 and IE 11 */
}

.nav-side-menu-title {
font-size: var(--terra-navigation-side-menu-font-size, 1.10714rem);
font-weight: var(--terra-navigation-side-menu-font-weight, 500);
}

.drill-in-title {
color: var(--terra-navigation-side-menu-header-color);
font-weight: 700;
hyphens: auto;
margin: 5px;
overflow-wrap: break-word; /* Modern browsers */
padding: 0.28571rem;
width: 100%;
word-wrap: break-word; /* For IE 10 and IE 11 */
}
}

0 comments on commit cee03bd

Please sign in to comment.