-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add mobile header items and renderNavigation method (#989)
* refactor: component Control using Button from uikit * refactor: add exports in navigation * feat: add mobile header items * refactor: navigation component Navigation * refactor: replace ControlProps.size with type on ButtonSize from uikit * revert: component MobileMenuButton size * revert: menuLayout mobileHorizontal * refactor: rename mobileHeaderItems to customMobileHeaderItems * Revert "refactor: component Control using Button from uikit" This reverts commit 82b85ab. * refactor: add JSDoc description for customMobileHeaderItems props * revert: change size in MobileMenuButton * refactor: move the custom hooks to a separate files * refactor: replace hooks into navgiation folder * fix: mobile header flex model * feat: add story in Navigation.story.book.tsx * fix: change customMobileHeader items storie on one icon in list * fix: type error * feat: add padding to mobile header items --------- Co-authored-by: Ruslan Bagautdinov <[email protected]>
- Loading branch information
Showing
18 changed files
with
231 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.custom-button { | ||
white-space: nowrap; | ||
|
||
transition: transform 300ms; | ||
|
||
&_active { | ||
transform: scale(0.9); | ||
} | ||
} |
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,25 @@ | ||
import React from 'react'; | ||
|
||
import {TriangleUp} from '@gravity-ui/icons'; | ||
import {Button} from '@gravity-ui/uikit'; | ||
|
||
import {cn} from '../../../utils'; | ||
import {NavigationItemProps} from '../../models'; | ||
|
||
import './CustomButton.scss'; | ||
|
||
const b = cn('custom-button'); | ||
|
||
type DCDropdownNavigationItemProps = Pick<NavigationItemProps, 'onClick' | 'isActive'>; | ||
|
||
export const CustomButton: React.FC<DCDropdownNavigationItemProps> = (props) => { | ||
const {onClick, isActive} = props; | ||
|
||
return ( | ||
<Button size="l" view="flat" className={b({active: isActive})} onClick={onClick}> | ||
<Button.Icon> | ||
<TriangleUp height={20} width={20} /> | ||
</Button.Icon> | ||
</Button> | ||
); | ||
}; |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export {default as useActiveNavItem} from './useActiveNavItem'; | ||
export {default as useShowBorder} from './useShowBorder'; |
Oops, something went wrong.