11import React , { useContext } from 'react' ;
2- import { navigate , useLocation } from '@reach/router' ;
2+ import { useLocation } from '@reach/router' ;
33import Icon from '@ably/ui/core/Icon' ;
44import AblyHeader from '@ably/ui/core/Header' ;
55import { SearchBar } from '../SearchBar' ;
66import LeftSidebar from './LeftSidebar' ;
77import UserContext from 'src/contexts/user-context' ;
88import ExamplesList from '../Examples/ExamplesList' ;
99import TabMenu from '@ably/ui/core/TabMenu' ;
10+ import Link from '../Link' ;
1011
1112type HeaderProps = {
1213 searchBar ?: boolean ;
@@ -23,18 +24,22 @@ const Header: React.FC<HeaderProps> = ({ searchBar = true }) => {
2324 account : userContext . sessionState . account ?? { links : { dashboard : { href : '#' } } } ,
2425 } ;
2526
26- const tabs = [ 'Docs' , 'Examples' ] ;
27- const tabLinks = [ '/docs' , '/examples' ] ;
27+ const desktopTabs = [
28+ < Link key = "docs" to = "/docs" className = "p-4" >
29+ Docs
30+ </ Link > ,
31+ < Link key = "examples" to = "/examples" className = "p-4" >
32+ Examples
33+ </ Link > ,
34+ ] ;
35+ const mobileTabs = [ 'Docs' , 'Examples' ] ;
2836
2937 return (
3038 < AblyHeader
3139 nav = {
3240 < TabMenu
33- tabs = { tabs }
34- tabClassName = "ui-text-menu3 !px-4"
35- tabOnClick = { ( index ) => {
36- navigate ( tabLinks [ index ] ?? '#' ) ;
37- } }
41+ tabs = { desktopTabs }
42+ tabClassName = "!p-0"
3843 options = { {
3944 underline : false ,
4045 flexibleTabHeight : true ,
@@ -44,7 +49,7 @@ const Header: React.FC<HeaderProps> = ({ searchBar = true }) => {
4449 }
4550 mobileNav = {
4651 < TabMenu
47- tabs = { tabs }
52+ tabs = { mobileTabs }
4853 contents = { [
4954 < LeftSidebar inHeader key = "nav-mobile-documentation-tab" /> ,
5055 < ExamplesList key = "nav-mobile-examples-tab" /> ,
0 commit comments