You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			TypeScript
		
	
| import React from 'react';
 | |
| // tslint:disable-next-line: no-submodule-imports
 | |
| import useUpdate from 'react-use/lib/useUpdate';
 | |
| import { SettingsKey } from '../../../data/settings-key';
 | |
| import { isHideMenuBarSupported } from '../../../types/Settings';
 | |
| 
 | |
| import { SessionToggleWithDescription } from '../SessionSettingListItem';
 | |
| import { SettingsThemeSwitcher } from '../SettingsThemeSwitcher';
 | |
| import { ZoomingSessionSlider } from '../ZoomingSessionSlider';
 | |
| 
 | |
| export const SettingsCategoryAppearance = (props: { hasPassword: boolean | null }) => {
 | |
|   const forceUpdate = useUpdate();
 | |
| 
 | |
|   if (props.hasPassword !== null) {
 | |
|     const isHideMenuBarActive =
 | |
|       window.getSettingValue(SettingsKey.settingsMenuBar) === undefined
 | |
|         ? true
 | |
|         : window.getSettingValue(SettingsKey.settingsMenuBar);
 | |
| 
 | |
|     return (
 | |
|       <>
 | |
|         {window.sessionFeatureFlags.useSettingsThemeSwitcher && <SettingsThemeSwitcher />}
 | |
|         <ZoomingSessionSlider />
 | |
|         {isHideMenuBarSupported() && (
 | |
|           <SessionToggleWithDescription
 | |
|             onClickToggle={() => {
 | |
|               window.toggleMenuBar();
 | |
|               forceUpdate();
 | |
|             }}
 | |
|             title={window.i18n('hideMenuBarTitle')}
 | |
|             description={window.i18n('hideMenuBarDescription')}
 | |
|             active={isHideMenuBarActive}
 | |
|           />
 | |
|         )}
 | |
|       </>
 | |
|     );
 | |
|   }
 | |
|   return null;
 | |
| };
 |