-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: navigation dropdown refactoring (#392)
* feat: navigation dropdown refactoring
- Loading branch information
Showing
27 changed files
with
548 additions
and
626 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
src/navigation/components/DesktopNavigation/DesktopNavigation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
|
||
import _ from 'lodash'; | ||
|
||
import OverflowScroller from '../../../components/OverflowScroller/OverflowScroller'; | ||
import {block} from '../../../utils'; | ||
import {DesktopNavigationProps, ItemColumnName, NavigationLayout} from '../../models'; | ||
import Logo from '../Logo/Logo'; | ||
import {MobileMenuButton} from '../MobileMenuButton/MobileMenuButton'; | ||
import {NavigationList} from '../NavigationList/NavigationList'; | ||
|
||
import './DesktopNavigation.scss'; | ||
|
||
const b = block('desktop-navigation'); | ||
|
||
const DesktopNavigation: React.FC<DesktopNavigationProps> = ({ | ||
logo, | ||
leftItemsWithIconSize, | ||
rightItemsWithIconSize, | ||
isSidebarOpened, | ||
onSidebarOpenedChange, | ||
onActiveItemChange, | ||
activeItemId, | ||
}) => ( | ||
<div className={b('wrapper')}> | ||
{logo && ( | ||
<div className={b('left')}> | ||
<Logo {...logo} className={b('logo')} /> | ||
</div> | ||
)} | ||
<div className={b('navigation-container')}> | ||
<OverflowScroller className={b('navigation')} onScrollStart={onActiveItemChange}> | ||
<NavigationList | ||
items={leftItemsWithIconSize} | ||
onActiveItemChange={onActiveItemChange} | ||
className={b('links')} | ||
itemClassName={b('item')} | ||
column={ItemColumnName.Left} | ||
activeItemId={activeItemId} | ||
menuLayout={NavigationLayout.Desktop} | ||
/> | ||
</OverflowScroller> | ||
</div> | ||
<div className={b('right')}> | ||
<MobileMenuButton | ||
isSidebarOpened={isSidebarOpened} | ||
onSidebarOpenedChange={onSidebarOpenedChange} | ||
/> | ||
{rightItemsWithIconSize && ( | ||
<NavigationList | ||
onActiveItemChange={onActiveItemChange} | ||
column={ItemColumnName.Right} | ||
items={rightItemsWithIconSize} | ||
activeItemId={activeItemId} | ||
className={b('buttons')} | ||
itemClassName={b('item')} | ||
menuLayout={NavigationLayout.Desktop} | ||
/> | ||
)} | ||
</div> | ||
</div> | ||
); | ||
|
||
export default DesktopNavigation; |
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
src/navigation/components/MobileMenuButton/MobileMenuButton.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@import '../../../../styles/mixins'; | ||
|
||
$block: '.#{$ns}mobile-menu-button'; | ||
|
||
#{$block} { | ||
@include add-specificity(&) { | ||
@include mobile-tablet-only(); | ||
} | ||
} |
Oops, something went wrong.