Changeset View
Changeset View
Standalone View
Standalone View
web/topbar/topbar.react.js
// @flow | // @flow | ||||
import * as React from 'react'; | import * as React from 'react'; | ||||
import type { NavInfo } from '../types/nav-types'; | import type { NavInfo } from '../types/nav-types'; | ||||
import AppSwitcher from './app-switcher.react'; | |||||
import css from './topbar.css'; | import css from './topbar.css'; | ||||
type Props = { | type Props = { | ||||
navInfo: NavInfo, | navInfo: NavInfo, | ||||
}; | }; | ||||
function Topbar(props: Props): React.Node { | function Topbar(props: Props): React.Node { | ||||
const { navInfo } = props; | const { navInfo } = props; | ||||
if (navInfo.tab === 'settings') { | if (navInfo.tab === 'settings') { | ||||
return null; | return null; | ||||
} | } | ||||
return <div className={css.container}>dummy</div>; | return ( | ||||
<div className={css.container}> | |||||
<AppSwitcher /> | |||||
</div> | |||||
); | |||||
} | } | ||||
const MemoizedTopbar: React.ComponentType<Props> = React.memo<Props>(Topbar); | const MemoizedTopbar: React.ComponentType<Props> = React.memo<Props>(Topbar); | ||||
export default MemoizedTopbar; | export default MemoizedTopbar; |