Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add standalone navigation #693

Merged
merged 4 commits into from
Nov 15, 2023
Merged

feat: add standalone navigation #693

merged 4 commits into from
Nov 15, 2023

Conversation

gorgeousvlad
Copy link
Collaborator

No description provided.

@gravity-ui-bot
Copy link
Contributor

Preview is ready.

@@ -21,7 +22,7 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
...props
}: NavigationItemProps) => {
const {type = NavigationItemType.Link} = data;
const {navItemMap} = useContext(InnerContext);
const navItemMap = useNavItemMap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion:

Suggested change
const navItemMap = useNavItemMap();
const navItemMap = useNavigationItemMap();


import Navigation, {NavigationProps} from './../../components/Navigation/Navigation';

const Standalone = (props: NavigationProps) => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is const exists and its name Standalone?

Copy link
Collaborator Author

@gorgeousvlad gorgeousvlad Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I called it so because you can import and use this Navigation component regardless of constructor itself
This case requires an addition of g-root class to parent , thats why this component exists

Copy link
Contributor

@yuberdysheva yuberdysheva Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add to readme the example of how to import navigation and use it with theme please?

@gorgeousvlad gorgeousvlad merged commit 38d5b88 into main Nov 15, 2023
3 checks passed
@gorgeousvlad gorgeousvlad deleted the export-navigation branch November 15, 2023 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants