@@ -2,16 +2,11 @@ import * as React from 'react'
22import { navigate } from 'gatsby'
33import { useIntl , IntlContext } from 'react-intl'
44
5- import { Command , Item , Tooltip , Box , List , Transition , Portal } from '@fluent-ui/core'
6- import {
7- EarthLine as EarthLineIcon ,
8- PaletteLine as PaletteLineIcon ,
9- MenuLine as MenuLineIcon
10- } from '@fluent-ui/icons' // TODO tree-shaking
11- import { useDispatch , usePopper , useClickOutside , useGlobal } from '@fluent-ui/hooks'
5+ import { Item , Box , List , Transition , Portal } from '@fluent-ui/core'
6+ import { EarthLine as EarthLineIcon , PaletteLine as PaletteLineIcon } from '@fluent-ui/icons' // TODO tree-shaking
7+ import { usePopper , useClickOutside , useGlobal } from '@fluent-ui/hooks'
128import { createUseStyles } from '@fluent-ui/styles'
139
14- import Search from '../search'
1510import { langKeys , LangKey } from '../../translations'
1611import { pathnameToLanguage } from '../../utils'
1712
@@ -21,9 +16,7 @@ const useStyles = createUseStyles({
2116 }
2217} )
2318
24- const Header = ( ) : React . ReactElement => {
25- const dispatch = useDispatch ( { type : 'navigation/expand' , payload : ( v : boolean ) : boolean => ! v } )
26-
19+ const NavFooter = ( ) : React . ReactElement => {
2720 const classes = useStyles ( )
2821
2922 const home = < img className = { classes . iconButton } src = "/images/fluent-ui.svg" alt = "fluent-ui" />
@@ -33,7 +26,7 @@ const Header = (): React.ReactElement => {
3326
3427 const [ changeLanguageVisible , setChangeLanguageVisible ] = React . useState ( false )
3528 const [ referenceRef , popperRef ] = usePopper < HTMLDivElement , HTMLDivElement > ( {
36- placement : 'bottom -start' ,
29+ placement : 'right -start' ,
3730 positionFixed : true
3831 } )
3932 const handleChangeLanguageVisible = React . useCallback ( ( ) : void => {
@@ -65,35 +58,22 @@ const Header = (): React.ReactElement => {
6558
6659 return (
6760 < >
68- < Command position = "sticky" top = "0" height = { 56 } backgroundColor = "white.default" zIndex = { 99 } >
69- < Tooltip title = { formatMessage ( { id : 'command.change-language' } ) } >
70- < div onClick = { handleChangeLanguageVisible } style = { { display : 'flex' } } >
71- < Item ref = { referenceRef } prefix = { < EarthLineIcon /> } />
72- </ div >
73- </ Tooltip >
74- < Tooltip title = { formatMessage ( { id : 'command.edit-website-colors' } ) } >
75- < Item onClick = { handleNavigateToColorTool } prefix = { < PaletteLineIcon /> } />
76- </ Tooltip >
77- < Tooltip title = { formatMessage ( { id : 'command.home-page' } ) } >
78- < Item onClick = { handleNavigateToHome } prefix = { home } />
79- </ Tooltip >
80- < Tooltip title = { formatMessage ( { id : 'command.github-repository' } ) } >
81- < Item as = "a" href = "https://github.com/fluent-org/fluent-ui" prefix = { github } />
82- </ Tooltip >
83-
84- < Command . Content >
85- < Box display = { [ 'none' , 'block' ] } >
86- < Search />
87- </ Box >
88- < Box display = { [ 'block' , 'none' ] } >
89- < Item onClick = { dispatch } prefix = { < MenuLineIcon /> } />
90- </ Box >
91- </ Command . Content >
92- </ Command >
61+ < Item ref = { referenceRef } prefix = { < EarthLineIcon /> } onClick = { handleChangeLanguageVisible } >
62+ { formatMessage ( { id : 'command.change-language' } ) }
63+ </ Item >
64+ < Item onClick = { handleNavigateToColorTool } prefix = { < PaletteLineIcon /> } >
65+ { formatMessage ( { id : 'command.edit-website-colors' } ) }
66+ </ Item >
67+ < Item onClick = { handleNavigateToHome } prefix = { home } >
68+ { formatMessage ( { id : 'command.home-page' } ) }
69+ </ Item >
70+ < Item as = "a" href = "https://github.com/fluent-org/fluent-ui" prefix = { github } >
71+ { formatMessage ( { id : 'command.github-repository' } ) }
72+ </ Item >
9373
9474 < Portal >
9575 < Transition visible = { changeLanguageVisible } wrapper = { false } mountOnEnter unmountOnExit >
96- < Box ref = { popperRef } zIndex = { 1000 } width = { 160 } >
76+ < Box ref = { popperRef } zIndex = { 1003 } width = { 160 } >
9777 < List >
9878 { ( Object . keys ( langKeys ) as LangKey [ ] ) . map (
9979 ( langKey ) : React . ReactElement => {
@@ -122,4 +102,4 @@ const Header = (): React.ReactElement => {
122102 )
123103}
124104
125- export default Header
105+ export default NavFooter
0 commit comments