Skip to content

Commit

Permalink
fix: codacy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lsantos1873 committed Oct 4, 2023
1 parent 1eb9232 commit 0d4d5ee
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Gympass `<NavigationMenu />` displays a navigation menu with 3 optional main are

`<NavigationMenu.Header />` and `<NavigationMenu.Footer />` are containers that can be used to display components like logos, `<NavigationMenu.Menu />` or `<NavigationMenu.Switcher />`.

`<NavigationMenu.Items />` should be used to display items and subitems.
`<NavigationMenu.Items />` must be used to display items and subitems.

The menu is responsive by default and controled by props. `<NavigationMenu.BottomItems />` and `<NavigationMenu.BottomItem />` should be used to display the items in the bottom bar.<br /><br />
The menu is responsive by default and controled by props. `<NavigationMenu.BottomItems />` and `<NavigationMenu.BottomItem />` must be used to display the items in the bottom bar.<br /><br />

Available components:

Expand Down
11 changes: 0 additions & 11 deletions packages/labnative/pages/NavigationMenu.jsx

This file was deleted.

2 changes: 0 additions & 2 deletions packages/labnative/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Banner from './Banner';
import Heading from './Heading';
import Skeleton from './Skeleton';
import ActionRequirement from './ActionRequirement';
import NavigationMenu from './NavigationMenu';

export {
Button,
Expand Down Expand Up @@ -55,5 +54,4 @@ export {
Heading,
Skeleton,
ActionRequirement,
NavigationMenu,
};
4 changes: 3 additions & 1 deletion packages/yoga/src/NavigationMenu/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { default } from './web';
import WebNavigationMenu from './web';

export default WebNavigationMenu;
4 changes: 3 additions & 1 deletion packages/yoga/src/NavigationMenu/web/Menu/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default } from './Menu';
import Menu from './Menu';

export type { MenuProps } from './Menu';

export default Menu;
19 changes: 14 additions & 5 deletions packages/yoga/src/NavigationMenu/web/NavigationMenu.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ import { Help, Doc } from '@gympass/yoga-icons';

import NavigationMenu from './NavigationMenu';

type IconProps = {
icon: React.ReactElement<typeof Icon>;
};

describe('<NavigationMenu />', () => {
describe('Snapshots', () => {
it('should match NavigationMenu', () => {
const renderWrapper = ({ children }) => <a href="#">{children}</a>;
const IconComponent = ({ icon }) => <Icon as={icon} />;
const renderWrapper = ({ children }) => {
return <a href="https://www.gympass.com">{children}</a>;
};

const IconComponent = ({ icon }: IconProps) => {
return <Icon as={icon} />;
};

const itemGroups = [
[
Expand Down Expand Up @@ -94,7 +103,7 @@ describe('<NavigationMenu />', () => {
avatar={<Avatar.Circle />}
title="Company"
subtitle="Reseller"
onClick={() => alert('Menu was clicked')}
onClick={() => null}
/>
</NavigationMenu.Header>
</NavigationMenu>
Expand All @@ -109,12 +118,12 @@ describe('<NavigationMenu />', () => {
{
id: 'Action 1',
label: 'Action 1',
onClick: () => alert('Action 1 was selected'),
onClick: () => null,
},
{
id: 'Action 2',
label: 'Action 2',
onClick: () => alert('Action 2 was selected'),
onClick: () => null,
},
];

Expand Down
4 changes: 3 additions & 1 deletion packages/yoga/src/NavigationMenu/web/Switcher/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default } from './Switcher';
import Switcher from './Switcher';

export type { SwitcherProps, SwitcherActionsProps } from './Switcher';

export default Switcher;
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ exports[`<NavigationMenu /> Snapshots should match NavigationMenu 1`] = `
class="c10"
>
<a
href="#"
href="https://www.gympass.com"
>
<div
class="c11 c12"
Expand Down Expand Up @@ -510,7 +510,7 @@ exports[`<NavigationMenu /> Snapshots should match NavigationMenu 1`] = `
class="c10"
>
<a
href="#"
href="https://www.gympass.com"
>
<div
class="c11 c20"
Expand All @@ -528,7 +528,7 @@ exports[`<NavigationMenu /> Snapshots should match NavigationMenu 1`] = `
class="c21"
>
<a
href="#"
href="https://www.gympass.com"
>
<div
class="c11 c12"
Expand Down Expand Up @@ -556,7 +556,7 @@ exports[`<NavigationMenu /> Snapshots should match NavigationMenu 1`] = `
class="c10"
>
<a
href="#"
href="https://www.gympass.com"
>
<div
class="c11 c12"
Expand Down
4 changes: 3 additions & 1 deletion packages/yoga/src/NavigationMenu/web/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export { default } from './NavigationMenu';
import NavigationMenu from './NavigationMenu';

export default NavigationMenu;

0 comments on commit 0d4d5ee

Please sign in to comment.