11import React from "react" ;
22import styled from "styled-components" ;
3- import { AppBar , Toolbar } from "@material-ui/core" ;
3+ import { AppBar , Toolbar , withStyles , Tabs , Tab } from "@material-ui/core" ;
44import ThemeSwitch from "components/ThemeSwitch" ;
5- import MapSwitch from "components/MapSwitch" ;
65
76const AppTitle = styled . h3 `
87 font-weight: 700;
@@ -17,17 +16,55 @@ const ToolbarControls = styled.div`
1716 align-items: center;
1817` ;
1918
19+ const StyledTabs = withStyles ( {
20+ indicator : {
21+ display : "flex" ,
22+ justifyContent : "center" ,
23+ backgroundColor : "transparent" ,
24+ height : 4 ,
25+ "& > span" : {
26+ maxWidth : 40 ,
27+ width : "100%" ,
28+ backgroundColor : "#fff" ,
29+ borderRadius : 8 ,
30+ } ,
31+ } ,
32+ } ) ( ( props ) => < Tabs { ...props } TabIndicatorProps = { { children : < span /> } } /> ) ;
33+
34+ const StyledTab = withStyles ( ( theme ) => ( {
35+ root : {
36+ textTransform : "none" ,
37+ color : "#fff" ,
38+ fontWeight : theme . typography . fontWeightRegular ,
39+ fontSize : theme . typography . pxToRem ( 12 ) ,
40+ marginRight : theme . spacing ( 1 ) ,
41+ minWidth : 80 ,
42+ "&:focus" : {
43+ opacity : 1 ,
44+ } ,
45+ } ,
46+ } ) ) ( ( props ) => < Tab disableRipple { ...props } /> ) ;
47+
2048export default function Header ( {
49+ currentTab,
2150 handleThemeChange,
22- handleMapsRendererChange ,
51+ handleTabChange ,
2352} ) {
2453 return (
2554 < AppBar position = "fixed" >
2655 < Toolbar >
27- < AppTitle > Navigator </ AppTitle >
56+ < AppTitle > Implement Maps in React </ AppTitle >
2857 < Grow />
2958 < ToolbarControls >
30- < MapSwitch handleMapsRendererChange = { handleMapsRendererChange } />
59+ < StyledTabs
60+ value = { currentTab }
61+ onChange = { handleTabChange }
62+ aria-label = "styled tabs example"
63+ >
64+ < StyledTab label = "Google Maps API" />
65+ < StyledTab label = "MapBox GL" />
66+ < StyledTab label = "@react-google-maps" />
67+ </ StyledTabs >
3168 < ThemeSwitch handleThemeChange = { handleThemeChange } />
3269 </ ToolbarControls >
3370 </ Toolbar >
0 commit comments