// @flow import { SETTINGS_GRP } from 'constants/settings'; import React from 'react'; import * as SETTINGS from 'constants/settings'; import Card from 'component/common/card'; import { FormField } from 'component/common/form'; import Button from 'component/button'; import FileSelector from 'component/common/file-selector'; import HomepageSelector from 'component/homepageSelector'; import SettingLanguage from 'component/settingLanguage'; import SettingsRow from 'component/settingsRow'; import ThemeSelector from 'component/themeSelector'; // $FlowFixMe import homepages from 'homepages'; type Props = { disableBackground: boolean, backgroundMode: string, customBackgroundImage: string, clock24h: boolean, searchInLanguage: boolean, hideBalance: boolean, setClientSetting: (string, boolean | string | number) => void, setSearchInLanguage: (boolean) => void, }; export default function SettingAppearance(props: Props) { const { clock24h, disableBackground, backgroundMode, customBackgroundImage, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage, } = props; function handleBackgroundImageChosen(fileWithPath: FileWithPath) { const file = fileWithPath && fileWithPath.file; if (!file) return; const reader = new FileReader(); reader.onload = () => { if (reader.result) { setClientSetting(SETTINGS.CUSTOM_BACKGROUND_IMAGE, reader.result.toString()); } }; reader.readAsDataURL(file); } return ( <>