-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(site): handle navigation bar on mobile remove unnecessary @mate…
…rial-ui/core (#769)
- Loading branch information
Showing
15 changed files
with
160 additions
and
163 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
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,17 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import TestContext from '../components/TestContext'; | ||
import NavigationMenu from '../../pages/components/Navbar/NavigationMenu'; | ||
import { navigationLinks } from '../../shared/constants/navigationLinks'; | ||
|
||
describe('NavigationMenu', () => { | ||
it('renders the navigation menu', async () => { | ||
const { findByText } = render( | ||
<TestContext> | ||
<NavigationMenu /> | ||
</TestContext> | ||
); | ||
|
||
await Promise.all(navigationLinks.map(async ({ label }) => await findByText(label))); | ||
}); | ||
}); |
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,17 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import TestContext from '../components/TestContext'; | ||
import NavigationOptions from '../../pages/components/Navbar/NavigationOptions'; | ||
import { navigationLinks } from '../../shared/constants/navigationLinks'; | ||
|
||
describe('NavigationOptions', () => { | ||
it('renders the navigation options', async () => { | ||
const { findByText } = render( | ||
<TestContext> | ||
<NavigationOptions /> | ||
</TestContext> | ||
); | ||
|
||
await Promise.all(navigationLinks.map(async ({ label }) => await findByText(label))); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
import React from 'react'; | ||
import Link from 'next/link'; | ||
import { Menu, MenuButton, MenuList, MenuItem, IconButton } from '@chakra-ui/react'; | ||
import { FiChevronDown } from 'react-icons/fi'; | ||
import { navigationLinks } from '../../../shared/constants/navigationLinks'; | ||
|
||
const NavigationMenu = () => ( | ||
<Menu> | ||
<MenuButton | ||
as={IconButton} | ||
icon={<FiChevronDown />} | ||
variant="ghost" | ||
_hover={{ backgroundColor: 'transparent' }} | ||
_focus={{ backgroundColor: 'transparent' }} | ||
_active={{ backgroundColor: 'transparent' }} | ||
/> | ||
<MenuList> | ||
{navigationLinks.map(({ href, label }) => ( | ||
<MenuItem key={label}> | ||
<Link href={href}>{label}</Link> | ||
</MenuItem> | ||
))} | ||
</MenuList> | ||
</Menu> | ||
); | ||
|
||
export default NavigationMenu; |
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,20 @@ | ||
import React from 'react'; | ||
import { UnorderedList, ListItem, Link } from '@chakra-ui/react'; | ||
import { navigationLinks } from '../../../shared/constants/navigationLinks'; | ||
|
||
const NavigationOptions = () => ( | ||
<UnorderedList | ||
className="w-full flex flex-row justify-center items-center space-x-3" | ||
data-test="sub-menu" | ||
> | ||
x | ||
{navigationLinks.map(({ href, label }) => ( | ||
<ListItem className="transition-element" key={label}> | ||
<Link className="cursor-pointer font-normal" href={href} role="link" fontWeight="semibold"> | ||
{label} | ||
</Link> | ||
</ListItem> | ||
))} | ||
</UnorderedList> | ||
); | ||
export default NavigationOptions; |
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
export const navigationLinks: { href: string, label: string }[] = [ | ||
{ | ||
href: '#features', | ||
label: 'Features', | ||
}, | ||
{ | ||
href: '/about', | ||
label: 'About', | ||
}, | ||
{ | ||
href: '/docs', | ||
label: 'Docs', | ||
}, | ||
{ | ||
href: '/signup', | ||
label: 'Get an API Key', | ||
}, | ||
]; |
Oops, something went wrong.