// @flow // import 'scss/component/_header.scss'; // ody codesplits this; no. import { ENABLE_UI_NOTIFICATIONS } from 'config'; import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button'; import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import HeaderMenuLink from 'component/common/header-menu-link'; import Icon from 'component/common/icon'; import NotificationHeaderButton from 'component/headerNotificationButton'; import React from 'react'; import Tooltip from 'component/common/tooltip'; type HeaderMenuButtonProps = { authenticated: boolean, automaticDarkModeEnabled: boolean, currentTheme: string, user: ?User, handleThemeToggle: (boolean, string) => void, }; export default function HeaderMenuButtons(props: HeaderMenuButtonProps) { const { automaticDarkModeEnabled, currentTheme, user, handleThemeToggle } = props; const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); return (
{notificationsEnabled && } handleThemeToggle(automaticDarkModeEnabled, currentTheme)}> {currentTheme === 'light' ? __('Dark') : __('Light')}
); }