Skip to content

Commit

Permalink
Merge branch 'main' into lunory/hide-decoration-node
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunory authored Oct 24, 2024
2 parents 2a4a8ef + 0d823a0 commit 323cacf
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [2.28.0](https://github.com/gravity-ui/navigation/compare/v2.27.0...v2.28.0) (2024-10-24)


### Features

* **AsideHeader:** add onAllPagesClick callback ([#329](https://github.com/gravity-ui/navigation/issues/329)) ([c8978c0](https://github.com/gravity-ui/navigation/commit/c8978c014f432ce09a57403ff95dd87dd7e4c6d5))
* **TopPanel:** add align prop ([#317](https://github.com/gravity-ui/navigation/issues/317)) ([c85b17b](https://github.com/gravity-ui/navigation/commit/c85b17ba41b26cf1a06d429a1e6a93fcc80ad648))

## [2.27.0](https://github.com/gravity-ui/navigation/compare/v2.26.0...v2.27.0) (2024-10-11)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gravity-ui/navigation",
"version": "2.27.0",
"version": "2.28.0",
"description": "Gravity UI Navigation components",
"license": "MIT",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions src/components/AsideHeader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const Aside: FC = () => {
| onClosePanel | Callback will be called when closing panel. You can add panels via `PanelItems` prop | `() => void;` | |
| onMenuItemsChanged | Callback will be called when updating list of the menuItems in `AllPagesPanel` | `(items: Array<MenuItem>) => void` | |
| onMenuMoreClick | Callback will be called when some items don't fit and "more" button is clicked | `() => void;` | |
| onAllPagesClick | Callback will be called when "All pages" button is clicked | `() => void;` | |
| openModalSubscriber | Function notifies `AsideHeader` about Modals visibility changes | `( (open: boolean) => void) => void` | |
| panelItems | Items for `Drawer` component. Used for show additional information over main content | [`Array<DrawerItem>`](./../Drawer/README.md#draweritem-props) | `[]` |
| renderContent | Function rendering the main content at the right of the `AsideHeader` | `(data: {size: number}) => React.ReactNode` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export const AsideHeaderShowcase: React.FC<AsideHeaderShowcaseProps> = ({
setCompact(v);
}}
onMenuMoreClick={() => console.log('onMenuMoreClick')}

Check warning on line 298 in src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected console statement
onAllPagesClick={() => console.log('onAllPagesClick')}

Check warning on line 299 in src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx

View workflow job for this annotation

GitHub Actions / Verify Files

Unexpected console statement
/>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions src/components/AsideHeader/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface AsideHeaderGeneralProps extends QAProps {
onClosePanel?: () => void;
onChangeCompact?: (compact: boolean) => void;
onMenuMoreClick?: () => void;
onAllPagesClick?: () => void;
openModalSubscriber?: (subscriber: OpenModalSubscriber) => void;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EMPTY_MENU_ITEMS: MenuItem[] = [];
export const useAsideHeaderInnerContextValue = (
props: AsideHeaderProps & {size: number},
): AsideHeaderInnerContextType => {
const {size, onClosePanel, menuItems, panelItems, onMenuItemsChanged} = props;
const {size, onClosePanel, menuItems, panelItems, onMenuItemsChanged, onAllPagesClick} = props;
const [innerVisiblePanel, setInnerVisiblePanel] = useState<InnerPanels | undefined>();
const ALL_PAGES_MENU_ITEM = React.useMemo(() => {
return getAllPagesMenuItem();
Expand Down Expand Up @@ -59,10 +59,11 @@ export const useAsideHeaderInnerContextValue = (
{
...ALL_PAGES_MENU_ITEM,
current: innerVisiblePanel === InnerPanels.AllPages,
onItemClick: onAllPagesClick,
},
]
: menuItems || EMPTY_MENU_ITEMS,
[allPagesIsAvailable, menuItems, innerVisiblePanel, ALL_PAGES_MENU_ITEM],
[allPagesIsAvailable, menuItems, innerVisiblePanel, ALL_PAGES_MENU_ITEM, onAllPagesClick],
);

const innerPanelItems = useMemo(() => {
Expand Down

0 comments on commit 323cacf

Please sign in to comment.